Skip to content

Commit 080f252

Browse files
committedJul 22, 2014
Merge pull request #1512 from radosuav/small_processing_fixes_3
[Processing] Small fixes
2 parents 8f0b898 + 38390bf commit 080f252

File tree

6 files changed

+32
-23
lines changed

6 files changed

+32
-23
lines changed
 

‎python/plugins/processing/algs/grass/description/r.fillnulls.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ r.fillnulls
22
r.fillnulls - Fills no-data areas in a raster layer using v.surf.rst splines interpolation or v.surf.bspline interpolation
33
Raster (r.*)
44
ParameterRaster|input|Input raster layer to fill|False
5+
ParameterSelection|method|Method|bilinear;bicubic;rst|2
56
ParameterNumber|tension|Spline tension parameter|None|None|40.0
67
ParameterNumber|smooth|Spline smoothing parameter|None|None|0.1
78
OutputRaster|output|Filled layer
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
r.univar
2+
r.univar - Calculates univariate statistics from the non-null cells of a raster map.
3+
Raster (r.*)
4+
ParameterMultipleInput|map|Name of input raster map(s)|3.0|False
5+
ParameterRaster|zones|Raster map used for zoning, must be of type CELL|True
6+
*ParameterBoolean|-e|Calculate extended statistics|False
7+
*ParameterBoolean|-g|Print the stats in shell script style|False
8+
*ParameterBoolean|-t|Table output format instead of standard output format|False
9+
*ParameterNumber|percentile|Percentile to calculate (requires extended statistics flag)|0.0|100.0|90
10+
OutputFile|output|Name for output text file

‎python/plugins/processing/algs/otb/OTBAlgorithm.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,18 @@ def defineCharacteristicsFromFile(self):
146146

147147
for line in the_result:
148148
try:
149-
if line.startswith("Parameter"):
150-
param = getParameterFromString(line)
149+
if line.startswith("Parameter") or line.startswith("*Parameter"):
150+
if line.startswith("*Parameter"):
151+
param = ParameterFactory.getFromString(line[1:])
152+
param.isAdvanced = True
153+
else:
154+
param = getParameterFromString(line)
151155
# Hack for initializing the elevation parameters from Processing configuration
152156
if param.name == "-elev.dem.path" or param.name == "-elev.dem" or "elev.dem" in param.name:
153157
param.default = OTBUtils.otbSRTMPath()
154158
elif param.name == "-elev.dem.geoid" or param.name == "-elev.geoid" or "elev.geoid" in param.name:
155159
param.default = OTBUtils.otbGeoidPath()
156160
self.addParameter(param)
157-
elif line.startswith("*Parameter"):
158-
param = getParameterFromString(line[1:])
159-
param.isAdvanced = True
160-
self.addParameter(param)
161161
elif line.startswith("Extent"):
162162
self.addParameter(ParameterExtent(self.REGION_OF_INTEREST, "Region of interest", "0,1,0,1"))
163163
self.hasROI = True
@@ -340,9 +340,9 @@ def processAlgorithm(self, progress):
340340
if not found:
341341
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "Adapter for %s not found" % the_key)
342342

343-
frames = inspect.getouterframes(inspect.currentframe())[1:]
344-
for a_frame in frames:
345-
frame,filename,line_number,function_name,lines,index = a_frame
346-
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "%s %s %s %s %s %s" % (frame,filename,line_number,function_name,lines,index))
343+
#frames = inspect.getouterframes(inspect.currentframe())[1:]
344+
#for a_frame in frames:
345+
# frame,filename,line_number,function_name,lines,index = a_frame
346+
# ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "%s %s %s %s %s %s" % (frame,filename,line_number,function_name,lines,index))
347347

348348
OTBUtils.executeOtb(commands, progress)

‎python/plugins/processing/algs/otb/description/TrainImagesClassifier-svm.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<hidden />
4444
</parameter>
4545
<parameter>
46-
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
46+
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
4747
<key>elev.default</key>
4848
<name>Default elevation</name>
4949
<description>This parameter allows setting the default height above ellipsoid when there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles, and no geoid file has been set. This is also used by some application as an average elevation value.</description>
@@ -52,7 +52,7 @@
5252
<default>0</default>
5353
</parameter>
5454
<parameter>
55-
<parameter_type source_parameter_type="ParameterType_Int">ParameterNumber</parameter_type>
55+
<parameter_type source_parameter_type="ParameterType_Int">*ParameterNumber</parameter_type>
5656
<key>sample.mt</key>
5757
<name>Maximum training sample size per class</name>
5858
<description>Maximum size per class (in pixels) of the training sample list (default = 1000) (no limit = -1). If equal to -1, then the maximal size of the available training sample list per class will be equal to the surface area of the smallest class multiplied by the training sample ratio.</description>
@@ -61,7 +61,7 @@
6161
<default>1000</default>
6262
</parameter>
6363
<parameter>
64-
<parameter_type source_parameter_type="ParameterType_Int">ParameterNumber</parameter_type>
64+
<parameter_type source_parameter_type="ParameterType_Int">*ParameterNumber</parameter_type>
6565
<key>sample.mv</key>
6666
<name>Maximum validation sample size per class</name>
6767
<description>Maximum size per class (in pixels) of the validation sample list (default = 1000) (no limit = -1). If equal to -1, then the maximal size of the available validation sample list per class will be equal to the surface area of the smallest class multiplied by the validation sample ratio.</description>
@@ -70,7 +70,7 @@
7070
<default>1000</default>
7171
</parameter>
7272
<parameter>
73-
<parameter_type source_parameter_type="ParameterType_Empty">ParameterBoolean</parameter_type>
73+
<parameter_type source_parameter_type="ParameterType_Empty">*ParameterBoolean</parameter_type>
7474
<key>sample.edg</key>
7575
<name>On edge pixel inclusion</name>
7676
<description>Takes pixels on polygon edge into consideration when building training and validation samples.</description>
@@ -107,7 +107,7 @@
107107
<default>0</default>
108108
</parameter>
109109
<parameter>
110-
<parameter_type source_parameter_type="ParameterType_Choice">ParameterSelection</parameter_type>
110+
<parameter_type source_parameter_type="ParameterType_Choice">*ParameterSelection</parameter_type>
111111
<key>classifier.svm.m</key>
112112
<name>SVM Model Type</name>
113113
<description>Type of SVM formulation.</description>
@@ -145,7 +145,7 @@
145145
<default>1</default>
146146
</parameter>
147147
<parameter>
148-
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
148+
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
149149
<key>classifier.svm.nu</key>
150150
<name>Parameter nu of a SVM optimization problem (NU_SVC / ONE_CLASS)</name>
151151
<description>Parameter nu of a SVM optimization problem.</description>
@@ -154,7 +154,7 @@
154154
<default>0</default>
155155
</parameter>
156156
<parameter>
157-
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
157+
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
158158
<key>classifier.svm.coef0</key>
159159
<name>Parameter coef0 of a kernel function (POLY / SIGMOID)</name>
160160
<description>Parameter coef0 of a kernel function (POLY / SIGMOID).</description>
@@ -163,7 +163,7 @@
163163
<default>0</default>
164164
</parameter>
165165
<parameter>
166-
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
166+
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
167167
<key>classifier.svm.gamma</key>
168168
<name>Parameter gamma of a kernel function (POLY / RBF / SIGMOID)</name>
169169
<description>Parameter gamma of a kernel function (POLY / RBF / SIGMOID).</description>
@@ -172,7 +172,7 @@
172172
<default>1</default>
173173
</parameter>
174174
<parameter>
175-
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
175+
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
176176
<key>classifier.svm.degree</key>
177177
<name>Parameter degree of a kernel function (POLY)</name>
178178
<description>Parameter degree of a kernel function (POLY).</description>
@@ -191,7 +191,7 @@
191191
<default>True</default>
192192
</parameter>
193193
<parameter>
194-
<parameter_type source_parameter_type="ParameterType_Int">ParameterNumber</parameter_type>
194+
<parameter_type source_parameter_type="ParameterType_Int">*ParameterNumber</parameter_type>
195195
<key>rand</key>
196196
<name>set user defined seed</name>
197197
<description>Set specific seed. with integer value.</description>

‎python/plugins/processing/gui/BatchInputSelectionPanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def showFileSelectionDialog(self):
115115
path = ''
116116

117117
ret = QtGui.QFileDialog.getOpenFileNames(self, 'Open file', path,
118-
self.param.getFileFilter())
118+
'All files(*.*);;' + self.param.getFileFilter())
119119
if ret:
120120
files = list(ret)
121121
if len(files) == 1:

‎python/plugins/processing/script/ScriptAlgorithm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ def processAlgorithm(self, progress):
256256
ns = {}
257257
ns['progress'] = progress
258258

259-
print self.parameters
260259
for param in self.parameters:
261-
print param.name
262260
ns[param.name] = param.value
263261

264262
for out in self.outputs:

0 commit comments

Comments
 (0)
Please sign in to comment.