Commit edd7827a authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Removed 'optional' flag for parameters that have valid defaults. Added parameter ranges.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent be458f09
...@@ -163,8 +163,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -163,8 +163,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
name=self.P_CPUs, name=self.P_CPUs,
description='Number of CPU cores to be used for processing', description='Number of CPU cores to be used for processing',
type=QgsProcessingParameterNumber.Integer, type=QgsProcessingParameterNumber.Integer,
defaultValue=cpu_count(), minValue=0, maxValue=cpu_count(), defaultValue=cpu_count(), minValue=0, maxValue=cpu_count()),
optional=True),
advanced=True) advanced=True)
self.addParameter( self.addParameter(
...@@ -193,8 +192,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -193,8 +192,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
description='Average elevation in meters above sea level \n' description='Average elevation in meters above sea level \n'
'(may be provided if no DEM is available and ignored if DEM is given)', '(may be provided if no DEM is available and ignored if DEM is given)',
type=QgsProcessingParameterNumber.Integer, type=QgsProcessingParameterNumber.Integer,
defaultValue=0, defaultValue=0),
optional=True),
advanced=True) advanced=True)
self.addParameter( self.addParameter(
...@@ -267,7 +265,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -267,7 +265,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
name=self.P_scale_factor_toa_ref, name=self.P_scale_factor_toa_ref,
description='Scale factor to be applied to TOA reflectance result', description='Scale factor to be applied to TOA reflectance result',
type=QgsProcessingParameterNumber.Integer, type=QgsProcessingParameterNumber.Integer,
defaultValue=10000), defaultValue=10000, minValue=0),
advanced=True) advanced=True)
self.addParameter( self.addParameter(
...@@ -300,7 +298,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -300,7 +298,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
name=self.P_mode_ac, name=self.P_mode_ac,
description="Atmospheric correction mode", description="Atmospheric correction mode",
options=['land - SICOR is applied to land AND water', options=['land - SICOR is applied to land AND water',
'water - POLYMER is applied to water only; land is cleared ' 'water - POLYMER is applied to water only; land is cleared ',
'combined - SICOR is applied to land and POLYMER to water'], 'combined - SICOR is applied to land and POLYMER to water'],
defaultValue=2)) defaultValue=2))
...@@ -319,7 +317,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -319,7 +317,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
description='Number of threads for multiprocessing when running ACwater/Polymer \n' description='Number of threads for multiprocessing when running ACwater/Polymer \n'
"('0: no threads', '-1: automatic', '>0: number of threads')", "('0: no threads', '-1: automatic', '>0: number of threads')",
type=QgsProcessingParameterNumber.Integer, type=QgsProcessingParameterNumber.Integer,
defaultValue=-1), defaultValue=-1, minValue=-1, maxValue=cpu_count()),
advanced=True) advanced=True)
self.addParameter( self.addParameter(
...@@ -327,7 +325,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -327,7 +325,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
name=self.P_blocksize, name=self.P_blocksize,
description='Block size for multiprocessing when running ACwater/Polymer', description='Block size for multiprocessing when running ACwater/Polymer',
type=QgsProcessingParameterNumber.Integer, type=QgsProcessingParameterNumber.Integer,
defaultValue=100), defaultValue=100, minValue=1),
advanced=True) advanced=True)
self.addParameter( self.addParameter(
...@@ -343,7 +341,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm): ...@@ -343,7 +341,7 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
name=self.P_scale_factor_boa_ref, name=self.P_scale_factor_boa_ref,
description='Scale factor to be applied to BOA reflectance result', description='Scale factor to be applied to BOA reflectance result',
type=QgsProcessingParameterNumber.Integer, type=QgsProcessingParameterNumber.Integer,
defaultValue=10000), defaultValue=10000, minValue=0),
advanced=True) advanced=True)
self.addParameter( self.addParameter(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment