From dbd1050879bf69689e81320e80ebc55ee8801f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sat, 11 Jun 2016 11:27:23 +0200 Subject: [PATCH 01/15] [Processing][Tests] Improve Processing GRASS7 testsuite --- .../plugins/processing/tests/CMakeLists.txt | 3 +- .../tests/Grass7AlgorithmsImageryTest.py | 58 ++ ...sTest.py => Grass7AlgorithmsRasterTest.py} | 8 +- .../plugins/processing/tests/grass7_todo.md | 198 ++++++ ...l => grass7_algorithms_imagery_tests.yaml} | 0 .../grass7_algorithms_raster_tests.yaml | 620 ++++++++++++++++++ 6 files changed, 882 insertions(+), 5 deletions(-) create mode 100644 python/plugins/processing/tests/Grass7AlgorithmsImageryTest.py rename python/plugins/processing/tests/{Grass7AlgorithmsTest.py => Grass7AlgorithmsRasterTest.py} (88%) create mode 100644 python/plugins/processing/tests/grass7_todo.md rename python/plugins/processing/tests/testdata/{grass7_algorithm_tests.yaml => grass7_algorithms_imagery_tests.yaml} (100%) create mode 100644 python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml diff --git a/python/plugins/processing/tests/CMakeLists.txt b/python/plugins/processing/tests/CMakeLists.txt index c3c482f7c9d..ac9cb33c6b4 100644 --- a/python/plugins/processing/tests/CMakeLists.txt +++ b/python/plugins/processing/tests/CMakeLists.txt @@ -9,5 +9,6 @@ IF(ENABLE_TESTS) ADD_PYTHON_TEST(ProcessingParametersTest ParametersTest.py) ADD_PYTHON_TEST(ProcessingQgisAlgorithmsTest QgisAlgorithmsTest.py) ADD_PYTHON_TEST(ProcessingGdalAlgorithmsTest GdalAlgorithmsTest.py) - ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsTest Grass7AlgorithmsTest.py) + ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsImageryTest Grass7AlgorithmsImageryTest.py) + ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsRasterTest Grass7AlgorithmsRasterTest.py) ENDIF(ENABLE_TESTS) diff --git a/python/plugins/processing/tests/Grass7AlgorithmsImageryTest.py b/python/plugins/processing/tests/Grass7AlgorithmsImageryTest.py new file mode 100644 index 00000000000..74dda95afc7 --- /dev/null +++ b/python/plugins/processing/tests/Grass7AlgorithmsImageryTest.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + Grass7AlgorithmsImageryTest.py + ------------------------------ + Date : May 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : mederic dot ribreux at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'May 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = ':%H$' + +import AlgorithmsTestBase + +import nose2 +import shutil + +from qgis.testing import ( + start_app, + unittest +) + + +class TestGrass7AlgorithmsImageryTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest): + + @classmethod + def setUpClass(cls): + start_app() + from processing.core.Processing import Processing + Processing.initialize() + cls.cleanup_paths = [] + + @classmethod + def tearDownClass(cls): + for path in cls.cleanup_paths: + shutil.rmtree(path) + + def test_definition_file(self): + return 'grass7_algorithms_imagery_tests.yaml' + + +if __name__ == '__main__': + nose2.main() diff --git a/python/plugins/processing/tests/Grass7AlgorithmsTest.py b/python/plugins/processing/tests/Grass7AlgorithmsRasterTest.py similarity index 88% rename from python/plugins/processing/tests/Grass7AlgorithmsTest.py rename to python/plugins/processing/tests/Grass7AlgorithmsRasterTest.py index 8bc7a88dc37..1d195e4209b 100644 --- a/python/plugins/processing/tests/Grass7AlgorithmsTest.py +++ b/python/plugins/processing/tests/Grass7AlgorithmsRasterTest.py @@ -2,8 +2,8 @@ """ *************************************************************************** - Grass7AlgorithmTests.py - ----------------------- + Grass7AlgorithmsRasterTest.py + ----------------------------- Date : May 2016 Copyright : (C) 2016 by Médéric Ribreux Email : mederic dot ribreux at medspx dot fr @@ -36,7 +36,7 @@ from qgis.testing import ( ) -class TestGrass7Algorithms(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest): +class TestGrass7AlgorithmsRasterTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest): @classmethod def setUpClass(cls): @@ -51,7 +51,7 @@ class TestGrass7Algorithms(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest) shutil.rmtree(path) def test_definition_file(self): - return 'grass7_algorithm_tests.yaml' + return 'grass7_algorithms_raster_tests.yaml' if __name__ == '__main__': diff --git a/python/plugins/processing/tests/grass7_todo.md b/python/plugins/processing/tests/grass7_todo.md new file mode 100644 index 00000000000..9e27a6ea110 --- /dev/null +++ b/python/plugins/processing/tests/grass7_todo.md @@ -0,0 +1,198 @@ +# Here is a list of grass7 algorithms without test units + +## Raster algorithms + +* r.basins.fill +* r.blend.combine +* r.blend.rgb +* r.buffer +* r.buffer.lowmem +* r.carve +* r.category +* r.category.out +* r.circle +* r.clump +* r.coin +* r.colors +* r.colors.out +* r.colors.stddev +* r.composite +* r.contour.level +* r.contour.step +* r.cost.coordinates +* r.cost.points +* r.cost.raster +* r.covar +* r.cross +* r.describe +* r.distance +* r.drain +* r.fill.dir +* r.fillnulls +* r.flow +* r.flow.aspect +* r.flow.aspect.barrier +* r.flow.barrier +* r.grow +* r.grow.distance +* r.gwflow +* r.his +* r.horizon +* r.horizon.height +* r.in.lidar +* r.in.lidar.info +* r.info +* r.kappa +* r.lake.coords +* r.lake.layer +* r.latlong +* r.li.cwed +* r.li.cwed.ascii +* r.li.dominance +* r.li.dominance.ascii +* r.li.edgedensity +* r.li.edgedensity.ascii +* r.li.mpa +* r.li.mpa.ascii +* r.li.mps +* r.li.mps.ascii +* r.li.padcv +* r.li.padcv.ascii +* r.li.padrange +* r.li.padrange.ascii +* r.li.padsd +* r.li.padsd.ascii +* r.li.patchdensity +* r.li.patchdensity.ascii +* r.li.patchnum +* r.li.patchnum.ascii +* r.li.pielou +* r.li.pielou.ascii +* r.li.renyi +* r.li.renyi.ascii +* r.li.richness +* r.li.richness.ascii +* r.li.shannon +* r.li.shannon.ascii +* r.li.shape +* r.li.shape.ascii +* r.li.simpson +* r.li.simpson.ascii +* r.mapcalc +* r.mask.rast +* r.mask.vect +* r.median +* r.mfilter +* r.mfilter.fp +* r.mode +* r.neighbors +* r.null +* r.out.gridatb +* r.out.ppm +* r.out.vrml +* r.param.scale +* r.patch +* r.plane +* r.profile +* r.quant +* r.quantile +* r.random +* r.random.cells +* r.random.raster +* r.random.surface +* r.reclass +* r.reclass.area.greater +* r.reclass.area.lesser +* r.recode +* r.regression.line +* r.regression.multi +* r.relief +* r.relief.scaling +* r.report +* r.resamp.bspline +* r.resamp.filter +* r.resamp.interp +* r.resamp.rst +* r.resamp.stats +* r.resample +* r.rescale +* r.rescale.eq +* r.rgb +* r.ros +* r.series +* r.series.accumulate +* r.series.interp +* r.shade +* r.sim.sediment +* r.sim.water +* r.slope (il y en a 2) +* r.slope.aspect +* r.solute.transport +* r.spread +* r.spreadpath +* r.statistics +* r.stats +* r.stats.quantile.out +* r.stats.quantile.rast +* r.stream.extract +* r.sum +* r.sun +* r.sunhours +* r.sunmask.datetime +* r.sunmask.position +* r.support +* r.surf.area +* r.surf.contour +* r.surf.fractal +* r.surf.gauss +* r.surf.idw +* r.surf.random +* r.terraflow +* r.texture +* r.thin +* r.tile +* r.tileset +* r.to.vect +* r.topidx +* r.topmodel +* r.topmodel.topidxstats +* r.transect +* r.univar +* r.uslek +* r.usler +* r.viewshed +* r.volume +* r.walk.coords +* r.walk.points +* r.walk.rast +* r.water.outlet +* r.watershed +* r.what.color +* r.what.coords +* r.what.points + +## Imagery algorithms + +* i.albedo +* i.aster.toar +* i.cca +* i.colors.enhance +* i.eb.evapfr +* i.evapo.time +* i.fft +* i.his.rgb +* i.ifft +* i.in.spotvgt +* i.landsat.acca +* i.landsat.toar +* i.pca +* i.rectify +* i.tasscap +--* i.topo.coor.ill +* i.topo.corr + + + +## Vector algorithms + +We need to handle gml for output and input for GRASS7 algorithms before creating tests ! diff --git a/python/plugins/processing/tests/testdata/grass7_algorithm_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithms_imagery_tests.yaml similarity index 100% rename from python/plugins/processing/tests/testdata/grass7_algorithm_tests.yaml rename to python/plugins/processing/tests/testdata/grass7_algorithms_imagery_tests.yaml diff --git a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml new file mode 100644 index 00000000000..e966121ad37 --- /dev/null +++ b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml @@ -0,0 +1,620 @@ +# See ../README.md for a description of the file format + +tests: +# i.* modules + - algorithm: grass7:i.emissivity + name: GRASS7 i.emissivity + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + type: raster + name: custom/grass7/raster_4class.tif + results: + output: + type: rasterhash + hash: cef69ed56f0b0f991ae2f7f2a54b8a29319eaf8b7d65653c75cbf985 + + - algorithm: grass7:i.biomass + name: GRASS7 i.biomass + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + dayofyear: + name: custom/grass7/raster_4class.tif + type: raster + fpar: + name: custom/grass7/raster_4class.tif + type: raster + latitude: + name: custom/grass7/raster_4class.tif + type: raster + lightuse_efficiency: + name: custom/grass7/raster_4class.tif + type: raster + transmissivity_singleway: + name: custom/grass7/raster_4class.tif + type: raster + water_availability: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 358c7745aaa5d7fbc56b34a21821fdfdc61f68e6ca79fb996a2241d8 + type: rasterhash + + - algorithm: grass7:i.eb.eta + name: GRASS7 i.eb.eta + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + evaporativefraction: + name: custom/grass7/raster_4class.tif + type: raster + netradiationdiurnal: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 23e65e4c5384b48d7151f781bab10e5caa398b36d363ff8c1049c917 + type: rasterhash + + - algorithm: grass7:i.eb.netrad + name: GRASS7 i.eb.netrad + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + albedo: + name: custom/grass7/raster_4class.tif + type: raster + dayofyear: + name: custom/grass7/raster_4class.tif + type: raster + emissivity: + name: custom/grass7/raster_4class.tif + type: raster + localutctime: + name: custom/grass7/raster_4class.tif + type: raster + ndvi: + name: custom/grass7/raster_4class.tif + type: raster + sunzenithangle: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + temperaturedifference2m: + name: custom/grass7/raster_4class.tif + type: raster + transmissivity_singleway: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 361d48c66d978d4844ae7c073c9e6d042fdc8c7739b889a1efce3c3f + type: rasterhash + + - algorithm: grass7:i.eb.soilheatflux + name: GRASS7 i.eb.soilheatflux + params: + -r: 'False' + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + albedo: + name: custom/grass7/raster_4class.tif + type: raster + localutctime: + name: custom/grass7/raster_4class.tif + type: raster + ndvi: + name: custom/grass7/raster_4class.tif + type: raster + netradiation: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: a25c4b750dd1f2f2124a117c80ac3f0e3d9b353618a86389eca794e8 + type: rasterhash + + - algorithm: grass7:i.evapo.mh + name: GRASS7 i.evapo.mh + params: + -h: 'True' + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + average_temperature: + name: custom/grass7/raster_4class.tif + type: raster + maximum_temperature: + name: custom/grass7/raster_4class.tif + type: raster + minimum_temperature: + name: custom/grass7/raster_4class.tif + type: raster + netradiation_diurnal: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.evapo.pm + name: GRASS7 i.evapo.pm + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + cropheight: + name: custom/grass7/raster_4class.tif + type: raster + elevation: + name: custom/grass7/raster_4class.tif + type: raster + netradiation: + name: custom/grass7/raster_4class.tif + type: raster + relativehumidity: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + windspeed: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 419ae792b057d2324354ce76d971d01e36751cf1c45cf3d856634576 + type: rasterhash + + - algorithm: grass7:i.evapo.pt + name: GRASS7 i.evapo.pt + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + air_temperature: + name: custom/grass7/raster_4class.tif + type: raster + atmospheric_pressure: + name: custom/grass7/raster_4class.tif + type: raster + net_radiation: + name: custom/grass7/raster_4class.tif + type: raster + priestley_taylor_coeff: 1.26 + soil_heatflux: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.topo.coor.ill + name: GRASS7 i.topo.coor.ill + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + azimuth: 50 + basemap: + name: custom/grass7/raster_4class.tif + type: raster + zenith: 50 + results: + output: + hash: b08dc5b47f557ecadf0c125c99f249e49111c44e43f463c2444ab474 + type: rasterhash + + - algorithm: grass7:i.vi + name: GRASS7 i.vi + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + nir: + name: custom/grass7/raster_4class.tif + type: raster + red: + name: custom/grass7/raster_4class.tif + type: raster + storage_bit: 1 + viname: 10 + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.zc + name: GRASS7 i.zc + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + name: custom/grass7/raster_4class.tif + type: raster + orientations: 1 + threshold: 10 + width: 9 + results: + output: + hash: 270bbef9dd111af5df23a819cb0848e104e0cf4949e794a67fa0b3f2 + type: rasterhash + + - algorithm: grass7:i.group + name: GRASS7 i.group + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + type: multi + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + results: + group: + hash: e1a433546cc1fdf7061adc0d9b77676c9d66ee8e0773d471bdb39a37 + type: rasterhash + + - algorithm: grass7:i.cluster + name: GRASS7 i.cluster + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + classes: 5 + convergence: 98 + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + iterations: 30 + min_size: 17 + separation: 0 + results: + signaturefile: + type: regex + name: expected/grass7/i.cluster.sig.txt + rules: + - '#Class 1' + - '1.83333 1.53759 3.31579' + - '#Class 2' + - '2.11045 4.35498 3.32266' + - '#Class 3' + - '5.32655 1.72558 3.32713' + - '#Class 4' + - '4.34567 4.36522 3.30235' + - '#Class 5' + - '6 4.55734 3.30291' + + - algorithm: grass7:i.oif + name: GRASS7 i.oif + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + results: + output: + type: regex + name: expected/grass7/i.oif.txt + rules: + - '118773.1947' + - '4541.9055' + - '4369.2930' + - '128.6900' + +# this doesn't work in travis-ci environment (probably due to libfftw version). +# - algorithm: grass7:i.fft +# name: GRASS7 i.fft +# params: +# GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' +# input: +# name: custom/grass7/float_raster.tif +# type: raster +# results: +# imaginary: +# hash: 94249384dd8b6019f0024501bc9a093cba9dd025c183d3fb46d77027 +# type: rasterhash +# real: +# hash: 09ab93c65aa2dde4da422b62a5ed3e38208e2da072cec2b0eb837a47 +# type: rasterhash + + - algorithm: grass7:i.segment + name: GRASS7 i.segment + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + iterations: 20 + memory: 300 + method: 0 + minsize: 1 + similarity: 0 + threshold: 0.5 + results: + goodness: + hash: 4d7728e28734d2b67427a514bcd155d254d30b3424bf4e0ad8f0f0c6 + type: rasterhash + output: + hash: b65992a5d48b867d4a32a533f38e7a72cb1ba18f1e261c6be132baca + type: rasterhash + + - algorithm: grass7:i.gensig + name: GRASS7 i.gensig + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + type: multi + trainingmap: + name: custom/grass7/raster_4class.tif + type: raster + results: + signaturefile: + type: file + name: expected/grass7/i.gensig.txt + + - algorithm: grass7:i.gensigset + name: GRASS7 i.gensigset + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + type: multi + maxsig: 5 + trainingmap: + name: custom/grass7/raster_4class.tif + type: raster + results: + signaturefile: + type: file + name: expected/grass7/i.gensigset.txt + + - algorithm: grass7:i.rgb.his + name: GRASS7 i.rgb.his + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + blue: + name: custom/grass7/raster_6class.tif + type: raster + green: + name: custom/grass7/raster_5class.tif + type: raster + red: + name: custom/grass7/raster_4class.tif + type: raster + results: + hue: + hash: d82c717b0aca5c7bb49d6f2b086a188a6fbdc397c533734911261f74 + type: rasterhash + intensity: + hash: 6d75d7a40460611301a1f2c2b162d08ae20fb5527d80509f19748b3c + type: rasterhash + saturation: + hash: 07578ad38cf948473a519f040acb0235f60a592904ac8ef46aa607e1 + type: rasterhash + + - algorithm: grass7:i.pansharpen + name: GRASS7 i.pansharpen + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + blue: + name: custom/grass7/raster_4class.tif + type: raster + green: + name: custom/grass7/raster_5class.tif + type: raster + method: 2 + pan: + name: custom/grass7/float_raster.tif + type: raster + red: + name: custom/grass7/raster_6class.tif + type: raster + results: + blueoutput: + hash: 906de8be89e302057ed849d00eaf49332ecca73ffaba1374994f1a17 + type: rasterhash + greenoutput: + hash: 588ad1ef8360ce903fc2defb1a1728a1dc8335d737d5fa77797605ed + type: rasterhash + redoutput: + hash: ad80c0007faa1b0dc15c0b0c21ff4e0045ff5e67b454df0f65e68899 + type: rasterhash + + - algorithm: grass7:i.smap + name: GRASS7 i.smap + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + blocksize: 1024 + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + type: multi + signaturefile: + type: file + name: expected/grass7/i.gensigset.txt + results: + goodness: + hash: 26c3f407312e8a9e03e91c32e526f71ea9cfa78037a90a5f78f0818e + type: rasterhash + output: + hash: f9e99ac3891b23c650add0478bb5225444183c61c6a4c321a7c2a16f + type: rasterhash + + - algorithm: grass7:i.maxlik + name: GRASS7 i.maxlik + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + signaturefile: + type: file + name: custom/grass7/i.cluster.txt + results: + output: + hash: a7b63bdda06fdcac715b8fe22e440238594a3dd0e189ca2328a3d694 + type: rasterhash + reject: + hash: 87b3d0be1315a040a61c4d4dec2bd5837881ad207a4140a89a28997a + type: rasterhash + +# - algorithm: grass7:i.evapo.time +# name: GRASS7 i.evapo.time +# params: +# GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' +# eta: +# params: +# - name: custom/grass7/raster_5class.tif +# type: raster +# - name: custom/grass7/raster_4class.tif +# type: raster +# type: multi +# eta_doy: +# params: +# - name: custom/grass7/raster_6class.tif +# type: raster +# - name: custom/grass7/raster_5class.tif +# type: raster +# type: multi +# eto: +# params: +# - name: custom/grass7/float_raster.tif +# type: raster +# - name: custom/grass7/raster_6class.tif +# type: raster +# type: multi +# results: +# output: +# hash: a361b729bf0b0628fa66822297dc57e71e0b2e56331f7145c3cfdce6 +# type: rasterhash + + - algorithm: grass7:i.eb.hsebal01 + name: GRASS7 i.eb.hsebal01 + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + aerodynresistance: + name: custom/grass7/raster_6class.tif + type: raster + frictionvelocitystar: 0.32407 + netradiation: + name: custom/grass7/raster_4class.tif + type: raster + soilheatflux: + name: custom/grass7/raster_5class.tif + type: raster + temperaturemeansealevel: + name: custom/grass7/float_raster.tif + type: raster + vapourpressureactual: 1.511 + results: + output: + hash: cac9e91f9b5182fbad336fd46ecebcf5185327e009ae8dc4cc0367fc + type: rasterhash + + - algorithm: grass7:i.modis.qc + name: GRASS7 i.modis.qc + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + name: custom/grass7/float_raster.tif + type: raster + productname: 8 + qcname: 5 + results: + output: + hash: 0439e59b8c142a7f58cdece674c058891b64aafb1273ed6ce5e3ecf9 + type: rasterhash + + - algorithm: grass7:i.image.mosaic + name: GRASS7 i.image.mosaic + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + results: + output: + hash: 651bde2da0f150c0dbe7790da98f371e56de20a3f1cbb13ef6a69657 + type: rasterhash + + - algorithm: grass7:i.eb.hsebal01.coords + name: GRASS7 i.eb.hsebal01.coords + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + aerodynresistance: + name: custom/grass7/float_raster.tif + type: raster + column_dry_pixel: '50' + column_wet_pixel: '10' + frictionvelocitystar: 0.32407 + netradiation: + name: custom/grass7/float_raster.tif + type: raster + row_dry_pixel: '50' + row_wet_pixel: '10' + soilheatflux: + name: custom/grass7/float_raster.tif + type: raster + temperaturemeansealevel: + name: custom/grass7/float_raster.tif + type: raster + vapourpressureactual: 1.511 + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.atcorr + name: GRASS7 i.atcorr + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + name: custom/grass7/raster_6class.tif + type: raster + visibility: + name: custom/grass7/raster_5class.tif + type: raster + parameters: + type: file + name: custom/grass7/i.atcorr.txt + results: + output: + hash: e5fada2ec43658e25a34d0486e810dec1cad289b626f6d1c4bbfea18 + type: rasterhash From bf02d34f5588873a454381263a1dbdb28bae59ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sat, 11 Jun 2016 16:25:03 +0200 Subject: [PATCH 02/15] Blacklist qt5 tests for Travis --- ci/travis/linux/qt5/blacklist.txt | 3 ++- python/plugins/processing/tests/grass7_todo.md | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ci/travis/linux/qt5/blacklist.txt b/ci/travis/linux/qt5/blacklist.txt index ac0a554b147..c84049c57c8 100755 --- a/ci/travis/linux/qt5/blacklist.txt +++ b/ci/travis/linux/qt5/blacklist.txt @@ -13,4 +13,5 @@ PyQgsVirtualLayerDefinition PyQgsVirtualLayerProvider qgis_composermapgridtest qgis_composerutils -ProcessingGrass7AlgorithmsTest +ProcessingGrass7AlgorithmsImageryTest +ProcessingGrass7AlgorithmsRasterTest diff --git a/python/plugins/processing/tests/grass7_todo.md b/python/plugins/processing/tests/grass7_todo.md index 9e27a6ea110..b4b482e6d2c 100644 --- a/python/plugins/processing/tests/grass7_todo.md +++ b/python/plugins/processing/tests/grass7_todo.md @@ -188,11 +188,8 @@ * i.pca * i.rectify * i.tasscap ---* i.topo.coor.ill * i.topo.corr - - ## Vector algorithms We need to handle gml for output and input for GRASS7 algorithms before creating tests ! From 0cd449865806d136fb19a1e6451adffd9660111a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 12 Jun 2016 14:23:09 +0200 Subject: [PATCH 03/15] Improve Test generation --- python/plugins/processing/gui/TestTools.py | 57 +- .../testdata/custom/grass7/raster_1class.tif | Bin 0 -> 1599 bytes .../custom/grass7/raster_1class.tif.aux.xml | 23 + .../grass7_algorithms_raster_tests.yaml | 645 +++--------------- 4 files changed, 139 insertions(+), 586 deletions(-) create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml diff --git a/python/plugins/processing/gui/TestTools.py b/python/plugins/processing/gui/TestTools.py index aae1ed2c579..2ca0af9b4d8 100644 --- a/python/plugins/processing/gui/TestTools.py +++ b/python/plugins/processing/gui/TestTools.py @@ -26,6 +26,7 @@ __copyright__ = '(C) 2013, Victor Olaya' __revision__ = '$Format:%H$' import os +import re import yaml import hashlib @@ -50,7 +51,9 @@ from processing.core.parameters import ( ParameterRaster, ParameterVector, ParameterMultipleInput, - ParameterFile + ParameterFile, + ParameterString, + ParameterBoolean ) @@ -95,11 +98,31 @@ def extractSchemaPath(filepath): return schema, localpath +def parseParameters(command): + """ + Parse alg string to grab parameters value. + Can handle quotes and comma. + """ + pos = 0 + exp = re.compile(r"""(['"]?)(.*?)\1(,|$)""") + while True: + m = exp.search(command, pos) + result = m.group(2) + separator = m.group(3) + + yield result + + if not separator: + break + + pos = m.end(0) + + def createTest(text): definition = {} - tokens = text[len('processing.runalg('):-1].split(',') - cmdname = (tokens[0])[1:-1] + tokens = list(parseParameters(text[len('processing.runalg('):-1])) + cmdname = tokens[0] alg = Processing.getAlgorithm(cmdname) definition['name'] = 'Test ({})'.format(cmdname) @@ -117,8 +140,7 @@ def createTest(text): token = tokens[i] if isinstance(param, ParameterVector): - filename = token[1:-1] - schema, filepath = extractSchemaPath(filename) + schema, filepath = extractSchemaPath(token) p = { 'type': 'vector', 'name': filepath @@ -128,8 +150,7 @@ def createTest(text): params[param.name] = p elif isinstance(param, ParameterRaster): - filename = token[1:-1] - schema, filepath = extractSchemaPath(filename) + schema, filepath = extractSchemaPath(token) p = { 'type': 'raster', 'name': filepath @@ -139,7 +160,7 @@ def createTest(text): params[param.name] = p elif isinstance(param, ParameterMultipleInput): - multiparams = token[1:-1].split(';') + multiparams = token.split(';') newparam = [] # Handle datatype detection @@ -164,8 +185,7 @@ def createTest(text): params[param.name] = p elif isinstance(param, ParameterFile): - filename = token[1:-1] - schema, filepath = extractSchemaPath(filename) + schema, filepath = extractSchemaPath(token) p = { 'type': 'file', 'name': filepath @@ -174,6 +194,10 @@ def createTest(text): p['location'] = '[The source data is not in the testdata directory. Please use data in the processing/tests/testdata folder.]' params[param.name] = p + elif isinstance(param, ParameterString): + params[param.name] = token + elif isinstance(param, ParameterBoolean): + params[param.name] = token == 'True' else: try: params[param.name] = int(token) @@ -195,8 +219,7 @@ def createTest(text): if isinstance(out, (OutputNumber, OutputString)): results[out.name] = unicode(out) elif isinstance(out, OutputRaster): - filename = token[1:-1] - dataset = gdal.Open(filename, GA_ReadOnly) + dataset = gdal.Open(token, GA_ReadOnly) dataArray = nan_to_num(dataset.ReadAsArray(0)) strhash = hashlib.sha224(dataArray.data).hexdigest() @@ -205,8 +228,7 @@ def createTest(text): 'hash': strhash } elif isinstance(out, OutputVector): - filename = token[1:-1] - schema, filepath = extractSchemaPath(filename) + schema, filepath = extractSchemaPath(token) results[out.name] = { 'type': 'vector', 'name': filepath @@ -214,8 +236,7 @@ def createTest(text): if not schema: results[out.name]['location'] = '[The expected result data is not in the testdata directory. Please write it to processing/tests/testdata/expected. Prefer gml files.]' elif isinstance(out, OutputHTML): - filename = token[1:-1] - schema, filepath = extractSchemaPath(filename) + schema, filepath = extractSchemaPath(token) results[out.name] = { 'type': 'file', 'name': filepath @@ -224,7 +245,6 @@ def createTest(text): results[out.name]['location'] = '[The expected result file is not in the testdata directory. Please redirect the output to processing/tests/testdata/expected.]' definition['results'] = results - dlg = ShowTestDialog(yaml.dump([definition], default_flow_style=False)) dlg.exec_() @@ -244,7 +264,8 @@ class ShowTestDialog(QDialog): self.text = QTextEdit() self.text.setFontFamily("monospace") self.text.setEnabled(True) - self.text.setText(s) + # Add two spaces in front of each text for faster copy/paste + self.text.setText(' {}'.format(s.replace('\n', '\n '))) layout.addWidget(self.text) self.setLayout(layout) QMetaObject.connectSlotsByName(self) diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif b/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif new file mode 100644 index 0000000000000000000000000000000000000000..bf3f1b77b916496688e98bad419567c5b9ce1ad9 GIT binary patch literal 1599 zcmebD)MDUZU|&IPiWplpyTW+Lh_4 zv2k~C^zltCNlZyBNwniqP_XeVNzGNrOUzBRRdV+C@ehg*adh%=jSmX-aSe`l_7C+7 zQBo*Q%q_?PDlky8GqlkM=^&&vKFHlE-T+mno&gx7Y8x0R7$S3kj#U5(8JR1h@3Cd>!(|yVu zP(CNehIU3^d~<_ob_QNB&B4G2q?s8wfzb^yhY3nEgJ}*17BH=;%*F%K&&0qErkNRd zz%(NRFPLUv-~-bv4E$gkl$MczgS!KS#{r=mJfM6xFnu6K73|*tU9i6$mW4z(uK4+S zitLgis5%CmpfnGZs8VX&or4wpfGh=Dh4i9g3xgV$#FElnAg?qpJ1@UHuf{beC$pe9 zKQjd==AN3Ll3J3P93PaLmRgjWmz)|OTv-fEZ}EnfK&=5qnYqB!3RG8=nwnRhnVeBm z!_dGG|G`2(Mc;;OP~ z#+`MddM&4(37uRr^S|+|v(Jq?d!9Mk%=gbQsAA>obXx4S(qv~!S+~!E%P&K@mWIg& ztq#+=vg>MIJomb@Ii}UBRf}Vqf**ug9__2mTYE?6O4r&`FN=Hbt`}Y1`l>&FPy7et z-+R*x>kd9jsmS#GEZni{(WXeADcjZw{NbP+#KYH4Yf;V^8P1j#|_3$^V z&w2IPdjlSP|2XH(|LDpqFMsTf{qN?!`1Q_Pzo*S_KmPjOw_}@k`=2}h?ulu}?_XE# z->qSLa$x-yVOH}C(VQ%f=d!q&5BZ5`d~?#DCDG8(VE-Th9EObzi2^&4|B3Q;xFiL1 z)cEO&_c$hPm~p1eR(^sWnz`x}uhgKODOu6_ea)dvSKUWOt82-{Dz2}V6U8G$6ePSd$e`t zUbdS|+ixjcm+GDORBv}=j=AU2XMe?a9DYB2cI>PFF{?}-)nO^&HsGT e_xt}WZ>TjduKW4xfBgP+#Xqj^|G<^k&;S4+AK;h( literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml new file mode 100644 index 00000000000..9dc5622602e --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml @@ -0,0 +1,23 @@ + + + + + 1 + 1 + 1 + 0 + 0 + 0 + + + + 1 + 1.000000e+00 1.000000e+00 255 0 127 255 0 127 + GRASS GIS 7.0.4 + 1 + 1 + 1 + 0 + + + diff --git a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml index e966121ad37..572abbef166 100644 --- a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml +++ b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml @@ -1,620 +1,129 @@ # See ../README.md for a description of the file format tests: -# i.* modules - - algorithm: grass7:i.emissivity - name: GRASS7 i.emissivity +# r.* modules + - algorithm: grass7:r.plane + name: GRASS7 r.plane params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - type: raster - name: custom/grass7/raster_4class.tif + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + azimuth: 125 + dip: 45 + easting: 351610 + elevation: 50 + northing: 6688312 + type: 1 results: output: - type: rasterhash - hash: cef69ed56f0b0f991ae2f7f2a54b8a29319eaf8b7d65653c75cbf985 - - - algorithm: grass7:i.biomass - name: GRASS7 i.biomass - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - dayofyear: - name: custom/grass7/raster_4class.tif - type: raster - fpar: - name: custom/grass7/raster_4class.tif - type: raster - latitude: - name: custom/grass7/raster_4class.tif - type: raster - lightuse_efficiency: - name: custom/grass7/raster_4class.tif - type: raster - transmissivity_singleway: - name: custom/grass7/raster_4class.tif - type: raster - water_availability: - name: custom/grass7/raster_4class.tif - type: raster - results: - output: - hash: 358c7745aaa5d7fbc56b34a21821fdfdc61f68e6ca79fb996a2241d8 + hash: a9326678c39b6f925e7f22f6e79a48217100071cc8af85d675f28462 type: rasterhash - - algorithm: grass7:i.eb.eta - name: GRASS7 i.eb.eta + - algorithm: grass7:r.reclass + name: GRASS7 r.reclass params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - evaporativefraction: - name: custom/grass7/raster_4class.tif - type: raster - netradiationdiurnal: - name: custom/grass7/raster_4class.tif - type: raster - temperature: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + input: name: custom/grass7/raster_4class.tif type: raster + txtrules: 1 = 1\n* = NULL results: output: - hash: 23e65e4c5384b48d7151f781bab10e5caa398b36d363ff8c1049c917 + hash: c50654b0c3ea019a14e9319e5f9be673d0e7fdd40a002a753fe88a7b type: rasterhash - - algorithm: grass7:i.eb.netrad - name: GRASS7 i.eb.netrad + - algorithm: grass7:r.buffer + name: GRASS7 r.buffer params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - albedo: - name: custom/grass7/raster_4class.tif - type: raster - dayofyear: - name: custom/grass7/raster_4class.tif - type: raster - emissivity: - name: custom/grass7/raster_4class.tif - type: raster - localutctime: - name: custom/grass7/raster_4class.tif - type: raster - ndvi: - name: custom/grass7/raster_4class.tif - type: raster - sunzenithangle: - name: custom/grass7/raster_4class.tif - type: raster - temperature: - name: custom/grass7/raster_4class.tif - type: raster - temperaturedifference2m: - name: custom/grass7/raster_4class.tif - type: raster - transmissivity_singleway: - name: custom/grass7/raster_4class.tif + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + distances: 500,1500 + input: + name: custom/grass7/raster_1class.tif type: raster + units: 0 results: output: - hash: 361d48c66d978d4844ae7c073c9e6d042fdc8c7739b889a1efce3c3f + hash: 288fa95adddf1f1d139db7a56678e1bf3726610cfacde4c95d9d0ed5 type: rasterhash - - algorithm: grass7:i.eb.soilheatflux - name: GRASS7 i.eb.soilheatflux + - algorithm: grass7:r.buffer.lowmem + name: GRASS7 r.buffer.lowmem params: - -r: 'False' - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - albedo: - name: custom/grass7/raster_4class.tif - type: raster - localutctime: - name: custom/grass7/raster_4class.tif - type: raster - ndvi: - name: custom/grass7/raster_4class.tif - type: raster - netradiation: - name: custom/grass7/raster_4class.tif - type: raster - temperature: - name: custom/grass7/raster_4class.tif + -z: False + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + distances: 500,1500 + input: + name: custom/grass7/raster_1class.tif type: raster + units: 0 results: output: - hash: a25c4b750dd1f2f2124a117c80ac3f0e3d9b353618a86389eca794e8 + hash: 288fa95adddf1f1d139db7a56678e1bf3726610cfacde4c95d9d0ed5 type: rasterhash - - algorithm: grass7:i.evapo.mh - name: GRASS7 i.evapo.mh + - algorithm: grass7:r.blend.combine + name: GRASS7 r.blend.combine params: - -h: 'True' - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - average_temperature: - name: custom/grass7/raster_4class.tif - type: raster - maximum_temperature: - name: custom/grass7/raster_4class.tif - type: raster - minimum_temperature: - name: custom/grass7/raster_4class.tif - type: raster - netradiation_diurnal: - name: custom/grass7/raster_4class.tif - type: raster - results: - output: - hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 - type: rasterhash - - - algorithm: grass7:i.evapo.pm - name: GRASS7 i.evapo.pm - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - cropheight: - name: custom/grass7/raster_4class.tif - type: raster - elevation: - name: custom/grass7/raster_4class.tif - type: raster - netradiation: - name: custom/grass7/raster_4class.tif - type: raster - relativehumidity: - name: custom/grass7/raster_4class.tif - type: raster - temperature: - name: custom/grass7/raster_4class.tif - type: raster - windspeed: - name: custom/grass7/raster_4class.tif - type: raster - results: - output: - hash: 419ae792b057d2324354ce76d971d01e36751cf1c45cf3d856634576 - type: rasterhash - - - algorithm: grass7:i.evapo.pt - name: GRASS7 i.evapo.pt - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - air_temperature: - name: custom/grass7/raster_4class.tif - type: raster - atmospheric_pressure: - name: custom/grass7/raster_4class.tif - type: raster - net_radiation: - name: custom/grass7/raster_4class.tif - type: raster - priestley_taylor_coeff: 1.26 - soil_heatflux: - name: custom/grass7/raster_4class.tif - type: raster - results: - output: - hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 - type: rasterhash - - - algorithm: grass7:i.topo.coor.ill - name: GRASS7 i.topo.coor.ill - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - azimuth: 50 - basemap: - name: custom/grass7/raster_4class.tif - type: raster - zenith: 50 - results: - output: - hash: b08dc5b47f557ecadf0c125c99f249e49111c44e43f463c2444ab474 - type: rasterhash - - - algorithm: grass7:i.vi - name: GRASS7 i.vi - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - nir: - name: custom/grass7/raster_4class.tif - type: raster - red: - name: custom/grass7/raster_4class.tif - type: raster - storage_bit: 1 - viname: 10 - results: - output: - hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 - type: rasterhash - - - algorithm: grass7:i.zc - name: GRASS7 i.zc - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - name: custom/grass7/raster_4class.tif - type: raster - orientations: 1 - threshold: 10 - width: 9 - results: - output: - hash: 270bbef9dd111af5df23a819cb0848e104e0cf4949e794a67fa0b3f2 - type: rasterhash - - - algorithm: grass7:i.group - name: GRASS7 i.group - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - type: multi - params: - - name: custom/grass7/raster_6class.tif - type: raster - - name: custom/grass7/raster_5class.tif - type: raster - - name: custom/grass7/raster_4class.tif - type: raster - results: - group: - hash: e1a433546cc1fdf7061adc0d9b77676c9d66ee8e0773d471bdb39a37 - type: rasterhash - - - algorithm: grass7:i.cluster - name: GRASS7 i.cluster - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - classes: 5 - convergence: 98 - input: - params: - - name: custom/grass7/raster_6class.tif - type: raster - - name: custom/grass7/raster_5class.tif - type: raster - - name: custom/grass7/raster_4class.tif - type: raster - type: multi - iterations: 30 - min_size: 17 - separation: 0 - results: - signaturefile: - type: regex - name: expected/grass7/i.cluster.sig.txt - rules: - - '#Class 1' - - '1.83333 1.53759 3.31579' - - '#Class 2' - - '2.11045 4.35498 3.32266' - - '#Class 3' - - '5.32655 1.72558 3.32713' - - '#Class 4' - - '4.34567 4.36522 3.30235' - - '#Class 5' - - '6 4.55734 3.30291' - - - algorithm: grass7:i.oif - name: GRASS7 i.oif - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - params: - - name: custom/grass7/float_raster.tif - type: raster - - name: custom/grass7/raster_6class.tif - type: raster - - name: custom/grass7/raster_5class.tif - type: raster - - name: custom/grass7/raster_4class.tif - type: raster - type: multi - results: - output: - type: regex - name: expected/grass7/i.oif.txt - rules: - - '118773.1947' - - '4541.9055' - - '4369.2930' - - '128.6900' - -# this doesn't work in travis-ci environment (probably due to libfftw version). -# - algorithm: grass7:i.fft -# name: GRASS7 i.fft -# params: -# GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' -# input: -# name: custom/grass7/float_raster.tif -# type: raster -# results: -# imaginary: -# hash: 94249384dd8b6019f0024501bc9a093cba9dd025c183d3fb46d77027 -# type: rasterhash -# real: -# hash: 09ab93c65aa2dde4da422b62a5ed3e38208e2da072cec2b0eb837a47 -# type: rasterhash - - - algorithm: grass7:i.segment - name: GRASS7 i.segment - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - params: - - name: custom/grass7/raster_6class.tif - type: raster - - name: custom/grass7/raster_5class.tif - type: raster - - name: custom/grass7/raster_4class.tif - type: raster - type: multi - iterations: 20 - memory: 300 - method: 0 - minsize: 1 - similarity: 0 - threshold: 0.5 - results: - goodness: - hash: 4d7728e28734d2b67427a514bcd155d254d30b3424bf4e0ad8f0f0c6 - type: rasterhash - output: - hash: b65992a5d48b867d4a32a533f38e7a72cb1ba18f1e261c6be132baca - type: rasterhash - - - algorithm: grass7:i.gensig - name: GRASS7 i.gensig - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - params: - - name: custom/grass7/float_raster.tif - type: raster - type: multi - trainingmap: - name: custom/grass7/raster_4class.tif - type: raster - results: - signaturefile: - type: file - name: expected/grass7/i.gensig.txt - - - algorithm: grass7:i.gensigset - name: GRASS7 i.gensigset - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - params: - - name: custom/grass7/float_raster.tif - type: raster - type: multi - maxsig: 5 - trainingmap: - name: custom/grass7/raster_4class.tif - type: raster - results: - signaturefile: - type: file - name: expected/grass7/i.gensigset.txt - - - algorithm: grass7:i.rgb.his - name: GRASS7 i.rgb.his - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - blue: - name: custom/grass7/raster_6class.tif - type: raster - green: - name: custom/grass7/raster_5class.tif - type: raster - red: - name: custom/grass7/raster_4class.tif - type: raster - results: - hue: - hash: d82c717b0aca5c7bb49d6f2b086a188a6fbdc397c533734911261f74 - type: rasterhash - intensity: - hash: 6d75d7a40460611301a1f2c2b162d08ae20fb5527d80509f19748b3c - type: rasterhash - saturation: - hash: 07578ad38cf948473a519f040acb0235f60a592904ac8ef46aa607e1 - type: rasterhash - - - algorithm: grass7:i.pansharpen - name: GRASS7 i.pansharpen - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - blue: - name: custom/grass7/raster_4class.tif - type: raster - green: - name: custom/grass7/raster_5class.tif - type: raster - method: 2 - pan: + GRASS_REGION_CELLSIZE_PARAMETER: 0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + first: name: custom/grass7/float_raster.tif type: raster - red: + percent: 50 + second: name: custom/grass7/raster_6class.tif type: raster results: - blueoutput: - hash: 906de8be89e302057ed849d00eaf49332ecca73ffaba1374994f1a17 - type: rasterhash - greenoutput: - hash: 588ad1ef8360ce903fc2defb1a1728a1dc8335d737d5fa77797605ed - type: rasterhash - redoutput: - hash: ad80c0007faa1b0dc15c0b0c21ff4e0045ff5e67b454df0f65e68899 - type: rasterhash - - - algorithm: grass7:i.smap - name: GRASS7 i.smap - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - blocksize: 1024 - input: - params: - - name: custom/grass7/float_raster.tif - type: raster - type: multi - signaturefile: - type: file - name: expected/grass7/i.gensigset.txt - results: - goodness: - hash: 26c3f407312e8a9e03e91c32e526f71ea9cfa78037a90a5f78f0818e - type: rasterhash output: - hash: f9e99ac3891b23c650add0478bb5225444183c61c6a4c321a7c2a16f - type: rasterhash - - - algorithm: grass7:i.maxlik - name: GRASS7 i.maxlik - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - params: - - name: custom/grass7/raster_6class.tif - type: raster - - name: custom/grass7/raster_5class.tif - type: raster - - name: custom/grass7/raster_4class.tif - type: raster - type: multi - signaturefile: - type: file - name: custom/grass7/i.cluster.txt - results: - output: - hash: a7b63bdda06fdcac715b8fe22e440238594a3dd0e189ca2328a3d694 - type: rasterhash - reject: - hash: 87b3d0be1315a040a61c4d4dec2bd5837881ad207a4140a89a28997a - type: rasterhash - -# - algorithm: grass7:i.evapo.time -# name: GRASS7 i.evapo.time -# params: -# GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' -# eta: -# params: -# - name: custom/grass7/raster_5class.tif -# type: raster -# - name: custom/grass7/raster_4class.tif -# type: raster -# type: multi -# eta_doy: -# params: -# - name: custom/grass7/raster_6class.tif -# type: raster -# - name: custom/grass7/raster_5class.tif -# type: raster -# type: multi -# eto: -# params: -# - name: custom/grass7/float_raster.tif -# type: raster -# - name: custom/grass7/raster_6class.tif -# type: raster -# type: multi -# results: -# output: -# hash: a361b729bf0b0628fa66822297dc57e71e0b2e56331f7145c3cfdce6 -# type: rasterhash - - - algorithm: grass7:i.eb.hsebal01 - name: GRASS7 i.eb.hsebal01 - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - aerodynresistance: - name: custom/grass7/raster_6class.tif - type: raster - frictionvelocitystar: 0.32407 - netradiation: - name: custom/grass7/raster_4class.tif - type: raster - soilheatflux: - name: custom/grass7/raster_5class.tif - type: raster - temperaturemeansealevel: - name: custom/grass7/float_raster.tif - type: raster - vapourpressureactual: 1.511 - results: - output: - hash: cac9e91f9b5182fbad336fd46ecebcf5185327e009ae8dc4cc0367fc + hash: a32af325d511525f74df50a3ffcf0f448e28fe9018a3e3116e34947e type: rasterhash - - algorithm: grass7:i.modis.qc - name: GRASS7 i.modis.qc + - algorithm: grass7:r.blend.rgb + name: GRASS7 r.blend.rgb params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: + GRASS_REGION_CELLSIZE_PARAMETER: 0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + first: name: custom/grass7/float_raster.tif type: raster - productname: 8 - qcname: 5 + percent: 50 + second: + name: custom/grass7/raster_6class.tif + type: raster results: - output: - hash: 0439e59b8c142a7f58cdece674c058891b64aafb1273ed6ce5e3ecf9 + output_blue: + hash: f8ab20fdd7aead09f6d42d7eee668168dec102df85bac3d5632ea30b + type: rasterhash + output_green: + hash: 7b7f26391fdb60f6cfff3b976720ee7464a80da62e2d4e7c0a1f639a + type: rasterhash + output_red: + hash: a1cedc7dd0b5ba977aff5e0908fb8b0f40edae82daef54295d98e6df type: rasterhash - - algorithm: grass7:i.image.mosaic - name: GRASS7 i.image.mosaic + - algorithm: grass7:r.circle + name: GRASS7 r.circle params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - input: - params: - - name: custom/grass7/raster_6class.tif - type: raster - - name: custom/grass7/raster_5class.tif - type: raster - - name: custom/grass7/raster_4class.tif - type: raster - type: multi + -b: false + GRASS_REGION_CELLSIZE_PARAMETER: 0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + coordinates: 351610,6688312 + max: 2000 + min: 500 + multiplier: '1' results: output: - hash: 651bde2da0f150c0dbe7790da98f371e56de20a3f1cbb13ef6a69657 + hash: e4eab441b88a873df44afe26c7c96d40d0944a5743953ffc18696c73 type: rasterhash - - - algorithm: grass7:i.eb.hsebal01.coords - name: GRASS7 i.eb.hsebal01.coords + + - algorithm: grass7:r.clump + name: GRASS7 r.clump params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' - aerodynresistance: - name: custom/grass7/float_raster.tif - type: raster - column_dry_pixel: '50' - column_wet_pixel: '10' - frictionvelocitystar: 0.32407 - netradiation: - name: custom/grass7/float_raster.tif - type: raster - row_dry_pixel: '50' - row_wet_pixel: '10' - soilheatflux: - name: custom/grass7/float_raster.tif - type: raster - temperaturemeansealevel: - name: custom/grass7/float_raster.tif - type: raster - vapourpressureactual: 1.511 - results: - output: - hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 - type: rasterhash - - - algorithm: grass7:i.atcorr - name: GRASS7 i.atcorr - params: - GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + GRASS_REGION_CELLSIZE_PARAMETER: 0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 input: name: custom/grass7/raster_6class.tif type: raster - visibility: - name: custom/grass7/raster_5class.tif - type: raster - parameters: - type: file - name: custom/grass7/i.atcorr.txt + title: TESTS results: output: - hash: e5fada2ec43658e25a34d0486e810dec1cad289b626f6d1c4bbfea18 - type: rasterhash + hash: 93df1dbc135f28781730d7b20a6ee52f0505320e355132a454abb4b9 + type: rasterhash \ No newline at end of file From b951c94746f71cd2c97d29a9d7c2852356de0456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 12 Jun 2016 14:46:42 +0200 Subject: [PATCH 04/15] Handle OutputFile in test generation --- python/plugins/processing/gui/TestTools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/plugins/processing/gui/TestTools.py b/python/plugins/processing/gui/TestTools.py index 2ca0af9b4d8..0e2eb2b9bb1 100644 --- a/python/plugins/processing/gui/TestTools.py +++ b/python/plugins/processing/gui/TestTools.py @@ -44,7 +44,8 @@ from processing.core.outputs import ( OutputString, OutputRaster, OutputVector, - OutputHTML + OutputHTML, + OutputFile ) from processing.core.parameters import ( @@ -235,7 +236,7 @@ def createTest(text): } if not schema: results[out.name]['location'] = '[The expected result data is not in the testdata directory. Please write it to processing/tests/testdata/expected. Prefer gml files.]' - elif isinstance(out, OutputHTML): + elif isinstance(out, OutputHTML) or isinstance(out, OutputFile): schema, filepath = extractSchemaPath(token) results[out.name] = { 'type': 'file', From cb1fec07bb2e2e3cf9ee43cddc68826c18f97bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 12 Jun 2016 16:48:06 +0200 Subject: [PATCH 05/15] Remove r.sum because it doesn't exists anymore in GRASS7 --- python/plugins/processing/algs/grass7/description/r.sum.txt | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 python/plugins/processing/algs/grass7/description/r.sum.txt diff --git a/python/plugins/processing/algs/grass7/description/r.sum.txt b/python/plugins/processing/algs/grass7/description/r.sum.txt deleted file mode 100644 index 772974c63ac..00000000000 --- a/python/plugins/processing/algs/grass7/description/r.sum.txt +++ /dev/null @@ -1,4 +0,0 @@ -r.sum -Sums up the raster cell values. -Raster (r.*) -ParameterRaster|rast|Name of incidence or density file|False From 8aad144ff5f930241a744835a239f6431e82ff8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 12 Jun 2016 16:48:38 +0200 Subject: [PATCH 06/15] Fix r.topidx, r.viewshed and r.volume description files --- .../algs/grass7/description/r.topidx.txt | 2 +- .../algs/grass7/description/r.viewshed.txt | 15 ++++++++++----- .../algs/grass7/description/r.volume.txt | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/python/plugins/processing/algs/grass7/description/r.topidx.txt b/python/plugins/processing/algs/grass7/description/r.topidx.txt index caff875ee41..154c994e72b 100644 --- a/python/plugins/processing/algs/grass7/description/r.topidx.txt +++ b/python/plugins/processing/algs/grass7/description/r.topidx.txt @@ -2,4 +2,4 @@ r.topidx Creates topographic index layer from elevation raster layer Raster (r.*) ParameterRaster|input|Input elevation layer|False -OutputRaster|Topographic index +OutputRaster|output|Topographic index diff --git a/python/plugins/processing/algs/grass7/description/r.viewshed.txt b/python/plugins/processing/algs/grass7/description/r.viewshed.txt index 55478e38dd5..8fd113767c9 100644 --- a/python/plugins/processing/algs/grass7/description/r.viewshed.txt +++ b/python/plugins/processing/algs/grass7/description/r.viewshed.txt @@ -2,9 +2,14 @@ r.viewshed Computes the viewshed of a point on an elevation raster map. Raster (r.*) ParameterRaster|input|Elevation|False -ParameterString|coordinates|Coordinate identifying the viewing position|0,0 -ParameterString|observer_elevation|Viewing position height above the ground|1.75 -ParameterString|target_elevation|Offset for target elevation above the ground|0.0 -ParameterString|max_distance|Maximum distance from the viewing point (meters)|10000 -ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False +ParameterString|coordinates|Coordinate identifying the viewing position|0,0|False|False +ParameterString|observer_elevation|Viewing elevation above the ground|1.75|False|False +ParameterString|target_elevation|Offset for target elevation above the ground|0.0|False|False +ParameterString|max_distance|Maximum distance from the viewing point (meters)|-1|False|False +ParameterNumber|refraction_coeff|Refraction coefficient|0.0|1.0|0.14286|False +ParameterNumber|memory|Amount of memory to use in MB|1|None|500|False +*ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False +*ParameterBoolean|-r|Consider the effect of atmospheric refraction|False +*ParameterBoolean|-b|Output format is invisible = 0, visible = 1|False +*ParameterBoolean|-e|Output format is invisible = NULL, else current elev - viewpoint_elev|False OutputRaster|output|Intervisibility diff --git a/python/plugins/processing/algs/grass7/description/r.volume.txt b/python/plugins/processing/algs/grass7/description/r.volume.txt index e8fa9de76e3..855ac8034cf 100644 --- a/python/plugins/processing/algs/grass7/description/r.volume.txt +++ b/python/plugins/processing/algs/grass7/description/r.volume.txt @@ -1,7 +1,7 @@ r.volume Calculates the volume of data "clumps". Raster (r.*) -ParameterRaster|data|Layer representing data that will be summed within clumps|False +ParameterRaster|input|Name of input raster map representing data that will be summed within clumps|False ParameterRaster|clump|Clumps layer (preferably the output of r.clump)|False *ParameterBoolean|-f|Generate unformatted report|False OutputVector|centroids|Centroids From 9011becb6f83f0404ff9072895039c797b9f282e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 12 Jun 2016 17:19:29 +0200 Subject: [PATCH 07/15] Fix r.aspect and r.slope algorithms --- .../processing/algs/grass7/description/r.aspect.txt | 8 ++++---- .../processing/algs/grass7/description/r.slope.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/plugins/processing/algs/grass7/description/r.aspect.txt b/python/plugins/processing/algs/grass7/description/r.aspect.txt index 42bf2412445..7d2ed6bf3fa 100644 --- a/python/plugins/processing/algs/grass7/description/r.aspect.txt +++ b/python/plugins/processing/algs/grass7/description/r.aspect.txt @@ -1,9 +1,9 @@ r.slope.aspect -r.aspect - Generates raster maps of aspect from a elevation raster map. +r.aspect - Generates raster maps of aspect from an elevation raster map. Raster (r.*) ParameterRaster|elevation|Elevation|False -ParameterSelection|precision|Data type|FCELL;CELL;DCELL -ParameterBoolean|-a|Do not align the current region to the elevation layer|True -ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0 +ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0 +*ParameterBoolean|-a|Do not align the current region to the elevation layer|False +ParameterNumber|zscale|Multiplicative factor to convert elevation units to meters|None|None|1.0 ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0 OutputRaster|aspect|Aspect diff --git a/python/plugins/processing/algs/grass7/description/r.slope.txt b/python/plugins/processing/algs/grass7/description/r.slope.txt index 09d7ecb3df1..25c1f1f2694 100644 --- a/python/plugins/processing/algs/grass7/description/r.slope.txt +++ b/python/plugins/processing/algs/grass7/description/r.slope.txt @@ -1,9 +1,9 @@ r.slope.aspect -r.slope - Generates raster maps of slope from a elevation raster map. +r.slope - Generates raster maps of slope from an elevation raster map. Raster (r.*) ParameterRaster|elevation|Elevation|False -ParameterSelection|precision|Data type|FCELL;CELL;DCELL -ParameterBoolean|-a|Do not align the current region to the elevation layer|True -ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0 +ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0 +*ParameterBoolean|-a|Do not align the current region to the elevation layer|False +ParameterNumber|zscale|Multiplicative factor to convert elevation units to meters|None|None|1.0 ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0 OutputRaster|slope|Slope From bb94a179a958111769e9960b5a6911dec353e2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 12 Jun 2016 17:36:42 +0200 Subject: [PATCH 08/15] Add new test data and a bunch of unit tests --- python/plugins/processing/gui/TestTools.py | 37 +- .../plugins/processing/tests/grass7_todo.md | 84 +-- .../tests/testdata/custom/grass7/points.dbf | Bin 0 -> 432 bytes .../tests/testdata/custom/grass7/points.prj | 1 + .../tests/testdata/custom/grass7/points.qpj | 1 + .../tests/testdata/custom/grass7/points.shp | Bin 0 -> 184 bytes .../tests/testdata/custom/grass7/points.shx | Bin 0 -> 124 bytes .../expected/grass7/r.stats.quantile.txt | 30 + .../testdata/expected/grass7/r.stats.txt | 188 +++++ .../testdata/expected/grass7/r.surf.area.txt | 6 + .../testdata/expected/grass7/r.terraflow.txt | 1 + .../testdata/expected/grass7/r.tileset.txt | 1 + .../grass7/r.topomodel.topidxstats.txt | 30 + .../testdata/expected/grass7/r.transect.txt | 10 + .../testdata/expected/grass7/r.univar.txt | 2 + .../expected/grass7/r.what.colors.txt | 2 + .../expected/grass7/r.what.coords.txt | 1 + .../expected/grass7/r.what.points.txt | 3 + .../grass7_algorithms_raster_tests.yaml | 660 +++++++++++++++++- 19 files changed, 982 insertions(+), 75 deletions(-) create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points.dbf create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points.prj create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points.qpj create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points.shp create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points.shx create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.stats.quantile.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.stats.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.surf.area.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.terraflow.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.tileset.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.topomodel.topidxstats.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.transect.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.univar.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.what.colors.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.what.coords.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.what.points.txt diff --git a/python/plugins/processing/gui/TestTools.py b/python/plugins/processing/gui/TestTools.py index 0e2eb2b9bb1..7f5f63c6d71 100644 --- a/python/plugins/processing/gui/TestTools.py +++ b/python/plugins/processing/gui/TestTools.py @@ -54,6 +54,7 @@ from processing.core.parameters import ( ParameterMultipleInput, ParameterFile, ParameterString, + ParameterNumber, ParameterBoolean ) @@ -77,7 +78,7 @@ def extractSchemaPath(filepath): path = filepath part = True - while part: + while part and filepath: (path, part) = os.path.split(path) if part == 'testdata' and not localpath: localparts = parts @@ -111,6 +112,14 @@ def parseParameters(command): result = m.group(2) separator = m.group(3) + # Handle special values: + if result == 'None': + result = None + elif result.lower() == unicode(True).lower(): + result = True + elif result.lower() == unicode(False).lower(): + result = False + yield result if not separator: @@ -139,6 +148,9 @@ def createTest(text): i += 1 token = tokens[i] + # Handle empty parameters that are optionals + if param.optional and token is None: + continue if isinstance(param, ParameterVector): schema, filepath = extractSchemaPath(token) @@ -198,19 +210,18 @@ def createTest(text): elif isinstance(param, ParameterString): params[param.name] = token elif isinstance(param, ParameterBoolean): - params[param.name] = token == 'True' - else: - try: + params[param.name] = token + elif isinstance(param, ParameterNumber): + if param.isInteger: params[param.name] = int(token) - except ValueError: - try: - params[param.name] = float(token) - except ValueError: - if token[0] == '"': - token = token[1:] - if token[-1] == '"': - token = token[:-1] - params[param.name] = token + else: + params[param.name] = float(token) + else: + if token[0] == '"': + token = token[1:] + if token[-1] == '"': + token = token[:-1] + params[param.name] = token definition['params'] = params diff --git a/python/plugins/processing/tests/grass7_todo.md b/python/plugins/processing/tests/grass7_todo.md index b4b482e6d2c..865dde41e39 100644 --- a/python/plugins/processing/tests/grass7_todo.md +++ b/python/plugins/processing/tests/grass7_todo.md @@ -3,15 +3,9 @@ ## Raster algorithms * r.basins.fill -* r.blend.combine -* r.blend.rgb -* r.buffer -* r.buffer.lowmem -* r.carve +* r.carve: needs a vector input * r.category * r.category.out -* r.circle -* r.clump * r.coin * r.colors * r.colors.out @@ -92,7 +86,6 @@ * r.out.vrml * r.param.scale * r.patch -* r.plane * r.profile * r.quant * r.quantile @@ -100,7 +93,6 @@ * r.random.cells * r.random.raster * r.random.surface -* r.reclass * r.reclass.area.greater * r.reclass.area.lesser * r.recode @@ -118,58 +110,28 @@ * r.rescale * r.rescale.eq * r.rgb -* r.ros -* r.series -* r.series.accumulate -* r.series.interp -* r.shade -* r.sim.sediment -* r.sim.water -* r.slope (il y en a 2) -* r.slope.aspect -* r.solute.transport -* r.spread -* r.spreadpath -* r.statistics -* r.stats -* r.stats.quantile.out -* r.stats.quantile.rast -* r.stream.extract -* r.sum -* r.sun -* r.sunhours -* r.sunmask.datetime -* r.sunmask.position -* r.support -* r.surf.area -* r.surf.contour -* r.surf.fractal -* r.surf.gauss -* r.surf.idw -* r.surf.random -* r.terraflow -* r.texture -* r.thin -* r.tile -* r.tileset -* r.to.vect -* r.topidx -* r.topmodel -* r.topmodel.topidxstats -* r.transect -* r.univar -* r.uslek -* r.usler -* r.viewshed -* r.volume -* r.walk.coords -* r.walk.points -* r.walk.rast -* r.water.outlet -* r.watershed -* r.what.color -* r.what.coords -* r.what.points +* r.ros: too much input rasters ! +* r.series.accumulate: can't reproduce same results ! +* r.series.interp: needs to handle output directories +* r.sim.sediment: too much input rasters ! +* r.sim.water: too much input rasters ! +* r.solute.transport: too much input rasters ! +* r.spreadpath: segfaults with test dataset ! +* r.stats.quantile.rast: needs to handle output directories +* r.sunhours: can't reproduce same results ! +* r.support: create a new test for raster: test after metadata. +* r.surf.fractal: random results ! +* r.surf.gauss: random results ! +* r.surf.random: random results ! +* r.terraflow: can't produce output with test dataset ! +* r.texture: needs to handle output directories +* r.tile: needs to handle output directories +* r.tileset: can't reproduce same results +* r.to.vect: needs a vector output in GML +* r.topmodel: too much manual inputs. +* r.uslek: can't produce output with test dataset (needs reclassified float rasters) ! +* r.viewshed: can't produce output with test dataset ! +* r.volume: needs a vector output in GML ## Imagery algorithms diff --git a/python/plugins/processing/tests/testdata/custom/grass7/points.dbf b/python/plugins/processing/tests/testdata/custom/grass7/points.dbf new file mode 100644 index 0000000000000000000000000000000000000000..1aa8c162f26ad38b04fc7c91392cffd7d44e9512 GIT binary patch literal 432 zcmZQBVdG(DU|?uuNClFZATtFn<_BVN!MPBIkE4^T4}|Fqq5>dnI2q>X6Y2`#Vb#y8 t00#zcnMK7Va4z*2h6V_;41-gX^Yc;=0@Pv|BUxe;l95?N13MJV%mHjnF;D;i literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/points.prj b/python/plugins/processing/tests/testdata/custom/grass7/points.prj new file mode 100644 index 00000000000..5adb2a9108a --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/points.prj @@ -0,0 +1 @@ +PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]] \ No newline at end of file diff --git a/python/plugins/processing/tests/testdata/custom/grass7/points.qpj b/python/plugins/processing/tests/testdata/custom/grass7/points.qpj new file mode 100644 index 00000000000..52a60bf44d9 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/points.qpj @@ -0,0 +1 @@ +PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2154"]] diff --git a/python/plugins/processing/tests/testdata/custom/grass7/points.shp b/python/plugins/processing/tests/testdata/custom/grass7/points.shp new file mode 100644 index 0000000000000000000000000000000000000000..24054e808819a6a2f3b9e2ae865691001e742023 GIT binary patch literal 184 zcmZQzQ0HR64q{#~GcYg$ Date: Sun, 26 Jun 2016 11:58:19 +0200 Subject: [PATCH 09/15] Fix r.composite --- python/plugins/processing/algs/grass7/Grass7Algorithm.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/python/plugins/processing/algs/grass7/Grass7Algorithm.py b/python/plugins/processing/algs/grass7/Grass7Algorithm.py index 7a703c1cc83..e5ccf0bfdbb 100644 --- a/python/plugins/processing/algs/grass7/Grass7Algorithm.py +++ b/python/plugins/processing/algs/grass7/Grass7Algorithm.py @@ -472,11 +472,6 @@ class Grass7Algorithm(GeoAlgorithm): self.commands.append(command) self.outputCommands.append(command) - command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"' - command += ' input=' - command += 'correctedoutput' + self.uniqueSufix - command += ' output="' + filename + '"' - elif self.grass7Name == 'r.composite': command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"' command += ' input=' command += 'correctedoutput' + self.uniqueSufix @@ -487,9 +482,6 @@ class Grass7Algorithm(GeoAlgorithm): if self.grass7Name == 'r.horizon': command += out.name + self.uniqueSufix + '_0' - elif self.grass7Name == 'r.composite': - self.commands.append(command) - self.outputCommands.append(command) elif self.grass7Name == 'r.statistics': self.commands.append(command) self.outputCommands.append(command) From b68800e188c6e3b3d378080404955b63d3c847ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 26 Jun 2016 12:36:27 +0200 Subject: [PATCH 10/15] Fix r.fillnulls --- .../processing/algs/grass7/description/r.fillnulls.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/plugins/processing/algs/grass7/description/r.fillnulls.txt b/python/plugins/processing/algs/grass7/description/r.fillnulls.txt index 3be7bc4f6a8..badde7889b1 100644 --- a/python/plugins/processing/algs/grass7/description/r.fillnulls.txt +++ b/python/plugins/processing/algs/grass7/description/r.fillnulls.txt @@ -1,7 +1,11 @@ r.fillnulls -Fills no-data areas in a raster layer using v.surf.rst splines interpolation or v.surf.bspline interpolation +Fills no-data areas in raster maps using spline interpolation. Raster (r.*) ParameterRaster|input|Input raster layer to fill|False +ParameterSelection|method|Interpolation method to use|bilinear;bicubic;rst|2 ParameterNumber|tension|Spline tension parameter|None|None|40.0 ParameterNumber|smooth|Spline smoothing parameter|None|None|0.1 +ParameterNumber|edge|Width of hole edge used for interpolation (in cells)|2|100|3|True +ParameterNumber|npmin|Minimum number of points for approximation in a segment (>segmax)|2|10000|600|True +ParameterNumber|segmax|Maximum number of points in a segment|2|10000|300|True OutputRaster|output|Filled From 758f917ecb643dc5fc18fb21568a2f48b8259a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 26 Jun 2016 12:48:31 +0200 Subject: [PATCH 11/15] Fix r.his --- python/plugins/processing/algs/grass7/description/r.his.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/plugins/processing/algs/grass7/description/r.his.txt b/python/plugins/processing/algs/grass7/description/r.his.txt index 6927d649ebd..2c0d8a3bfa0 100644 --- a/python/plugins/processing/algs/grass7/description/r.his.txt +++ b/python/plugins/processing/algs/grass7/description/r.his.txt @@ -4,7 +4,7 @@ Raster (r.*) ParameterRaster|hue|Hue|False ParameterRaster|intensity|Intensity|False ParameterRaster|saturation|Saturation|False -ParameterBoolean|-n|Respect NULL values while drawing|False +ParameterBoolean|-c|Use colors from color tables for NULL values|False OutputRaster|red|Red OutputRaster|green|Green OutputRaster|blue|Blue From 2a98098c1387b94622dbb854f034e7d91e9f5516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 26 Jun 2016 16:12:03 +0200 Subject: [PATCH 12/15] Fix r.li interfaces --- .../processing/algs/grass7/description/r.li.cwed.ascii.txt | 2 +- python/plugins/processing/algs/grass7/description/r.li.cwed.txt | 2 +- .../processing/algs/grass7/description/r.li.renyi.ascii.txt | 2 +- .../plugins/processing/algs/grass7/description/r.li.renyi.txt | 2 +- python/plugins/processing/algs/grass7/ext/r_li_cwed.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_mpa.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_mps.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_padcv.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_padrange.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_padsd.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_patchnum.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_pielou.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_renyi.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_richness.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_shannon.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_shape.py | 2 +- python/plugins/processing/algs/grass7/ext/r_li_simpson.py | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/python/plugins/processing/algs/grass7/description/r.li.cwed.ascii.txt b/python/plugins/processing/algs/grass7/description/r.li.cwed.ascii.txt index 2235f466455..2109e617c33 100644 --- a/python/plugins/processing/algs/grass7/description/r.li.cwed.ascii.txt +++ b/python/plugins/processing/algs/grass7/description/r.li.cwed.ascii.txt @@ -4,5 +4,5 @@ Raster (r.*) ParameterRaster|input|Name of input raster map|False ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterFile|config|Landscape structure configuration file|False|True -ParameterFile|path|Name of file that contains the weight to calculate the index|False +ParameterFile|path|Name of file that contains the weight to calculate the index|False|False OutputFile|output|CWED diff --git a/python/plugins/processing/algs/grass7/description/r.li.cwed.txt b/python/plugins/processing/algs/grass7/description/r.li.cwed.txt index ac91495d8bb..43c37ef299e 100644 --- a/python/plugins/processing/algs/grass7/description/r.li.cwed.txt +++ b/python/plugins/processing/algs/grass7/description/r.li.cwed.txt @@ -4,5 +4,5 @@ Raster (r.*) ParameterRaster|input|Name of input raster map|False ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterFile|config|Landscape structure configuration file|False|True -ParameterFile|path|Name of file that contains the weight to calculate the index|False +ParameterFile|path|Name of file that contains the weight to calculate the index|False|False OutputRaster|output|CWED diff --git a/python/plugins/processing/algs/grass7/description/r.li.renyi.ascii.txt b/python/plugins/processing/algs/grass7/description/r.li.renyi.ascii.txt index 409f65e3f70..29b2e9c4170 100644 --- a/python/plugins/processing/algs/grass7/description/r.li.renyi.ascii.txt +++ b/python/plugins/processing/algs/grass7/description/r.li.renyi.ascii.txt @@ -4,5 +4,5 @@ Raster (r.*) ParameterRaster|input|Name of input raster map|False ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterFile|config|Landscape structure configuration file|False|True -ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|True +ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|False OutputFile|output|Renyi diff --git a/python/plugins/processing/algs/grass7/description/r.li.renyi.txt b/python/plugins/processing/algs/grass7/description/r.li.renyi.txt index 9429d3b85bf..5f4b2a210c1 100644 --- a/python/plugins/processing/algs/grass7/description/r.li.renyi.txt +++ b/python/plugins/processing/algs/grass7/description/r.li.renyi.txt @@ -4,5 +4,5 @@ Raster (r.*) ParameterRaster|input|Name of input raster map|False ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterFile|config|Landscape structure configuration file|False|True -ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|True +ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|False OutputRaster|output|Renyi diff --git a/python/plugins/processing/algs/grass7/ext/r_li_cwed.py b/python/plugins/processing/algs/grass7/ext/r_li_cwed.py index a0219530f26..563cbafb54d 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_cwed.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_cwed.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py b/python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py index b6d9eb71dae..af80a6c42ed 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_mpa.py b/python/plugins/processing/algs/grass7/ext/r_li_mpa.py index 4c617b78db9..fe6fc066e2d 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_mpa.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_mpa.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_mps.py b/python/plugins/processing/algs/grass7/ext/r_li_mps.py index 4a8e2881784..dbf086065f7 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_mps.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_mps.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_padcv.py b/python/plugins/processing/algs/grass7/ext/r_li_padcv.py index 7b4088fe1e0..08731fb93e6 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_padcv.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_padcv.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_padrange.py b/python/plugins/processing/algs/grass7/ext/r_li_padrange.py index c0ca0cfd900..20762ddfbe4 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_padrange.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_padrange.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_padsd.py b/python/plugins/processing/algs/grass7/ext/r_li_padsd.py index 63631ef7335..ff1cc42abca 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_padsd.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_padsd.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py b/python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py index bcc1547516a..95a14467bc8 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_patchnum.py b/python/plugins/processing/algs/grass7/ext/r_li_patchnum.py index 983da80e5f7..fa0fc9d3f7b 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_patchnum.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_patchnum.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_pielou.py b/python/plugins/processing/algs/grass7/ext/r_li_pielou.py index ecd067e5313..1ddfa827bbe 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_pielou.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_pielou.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_renyi.py b/python/plugins/processing/algs/grass7/ext/r_li_renyi.py index 843dfb8ba81..07e5d084d06 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_renyi.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_renyi.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_richness.py b/python/plugins/processing/algs/grass7/ext/r_li_richness.py index 097c6087ed9..3a4af1ea397 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_richness.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_richness.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_shannon.py b/python/plugins/processing/algs/grass7/ext/r_li_shannon.py index e95ea8df58d..b1a14d8f7bb 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_shannon.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_shannon.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_shape.py b/python/plugins/processing/algs/grass7/ext/r_li_shape.py index d94460b5e31..38f4dd71772 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_shape.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_shape.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): diff --git a/python/plugins/processing/algs/grass7/ext/r_li_simpson.py b/python/plugins/processing/algs/grass7/ext/r_li_simpson.py index 56d44766586..d8735afdc3e 100644 --- a/python/plugins/processing/algs/grass7/ext/r_li_simpson.py +++ b/python/plugins/processing/algs/grass7/ext/r_li_simpson.py @@ -29,7 +29,7 @@ from r_li import checkMovingWindow, configFile def checkParameterValuesBeforeExecuting(alg): - checkMovingWindow(alg) + return checkMovingWindow(alg) def processCommand(alg): From a1c541ee6dcff4b94282221cc87eda542b12dc6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 26 Jun 2016 16:13:39 +0200 Subject: [PATCH 13/15] Add another bunch of tests for rasters --- .../plugins/processing/tests/grass7_todo.md | 82 +- .../tests/testdata/custom/grass7/points2.dbf | Bin 0 -> 432 bytes .../tests/testdata/custom/grass7/points2.prj | 1 + .../tests/testdata/custom/grass7/points2.qpj | 1 + .../tests/testdata/custom/grass7/points2.shp | Bin 0 -> 184 bytes .../tests/testdata/custom/grass7/points2.shx | Bin 0 -> 124 bytes .../custom/grass7/raster_4class.tif.aux.xml | 2 +- .../custom/grass7/raster_5class.tif.aux.xml | 2 +- .../custom/grass7/raster_6class.tif.aux.xml | 2 +- .../tests/testdata/custom/grass7/rliconfig | 2 + .../testdata/custom/grass7/rliconfigmoving | 3 + .../tests/testdata/custom/grass7/weighted.csv | 4 + .../expected/grass7/r.category.out.txt | 5 + .../tests/testdata/expected/grass7/r.coin.txt | 35 + .../testdata/expected/grass7/r.colors.out.txt | 4 + .../testdata/expected/grass7/r.covar.txt | 4 + .../testdata/expected/grass7/r.describe.txt | 1 + .../testdata/expected/grass7/r.distance.txt | 4 + .../tests/testdata/expected/grass7/r.info.txt | 29 + .../testdata/expected/grass7/r.kappa.txt | 59 + .../expected/grass7/r.li.cwed.ascii.txt | 1 + .../expected/grass7/r.li.dominance.ascii.txt | 1 + .../grass7/r.li.edgedensity.ascii.txt | 1 + .../expected/grass7/r.li.mpa.ascii.txt | 1 + .../expected/grass7/r.li.mps.ascii.txt | 1 + .../expected/grass7/r.li.padcv.ascii.txt | 1 + .../expected/grass7/r.li.padrange.ascii.txt | 1 + .../expected/grass7/r.li.padsd.ascii.txt | 1 + .../grass7/r.li.patchdensity.ascii.txt | 1 + .../expected/grass7/r.li.patchnum.ascii.txt | 1 + .../expected/grass7/r.li.pielou.ascii.txt | 1 + .../expected/grass7/r.li.renyi.ascii.txt | 1 + .../expected/grass7/r.li.richness.ascii.txt | 1 + .../expected/grass7/r.li.shannon.ascii.txt | 1 + .../expected/grass7/r.li.shape.ascii.txt | 1 + .../expected/grass7/r.li.simpson.ascii.txt | 1 + .../grass7_algorithms_raster_tests.yaml | 1030 ++++++++++++++++- 37 files changed, 1185 insertions(+), 101 deletions(-) create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points2.dbf create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points2.prj create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points2.qpj create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points2.shp create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/points2.shx create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/rliconfig create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/rliconfigmoving create mode 100644 python/plugins/processing/tests/testdata/custom/grass7/weighted.csv create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.category.out.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.coin.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.colors.out.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.covar.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.describe.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.distance.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.info.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.kappa.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.cwed.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.dominance.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.edgedensity.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.mpa.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.mps.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.padcv.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.padrange.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.padsd.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.patchdensity.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.patchnum.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.pielou.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.renyi.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.richness.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.shannon.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.shape.ascii.txt create mode 100644 python/plugins/processing/tests/testdata/expected/grass7/r.li.simpson.ascii.txt diff --git a/python/plugins/processing/tests/grass7_todo.md b/python/plugins/processing/tests/grass7_todo.md index 865dde41e39..ed1de96ebe1 100644 --- a/python/plugins/processing/tests/grass7_todo.md +++ b/python/plugins/processing/tests/grass7_todo.md @@ -2,76 +2,22 @@ ## Raster algorithms -* r.basins.fill -* r.carve: needs a vector input -* r.category -* r.category.out -* r.coin -* r.colors -* r.colors.out -* r.colors.stddev -* r.composite -* r.contour.level -* r.contour.step -* r.cost.coordinates -* r.cost.points -* r.cost.raster -* r.covar -* r.cross -* r.describe -* r.distance -* r.drain -* r.fill.dir -* r.fillnulls -* r.flow -* r.flow.aspect -* r.flow.aspect.barrier -* r.flow.barrier -* r.grow -* r.grow.distance -* r.gwflow -* r.his +* r.basins.fill: needs different input rasters (result is always empty). +* r.carve: needs a vector input. +* r.colors: needs to handle output directories. +* r.colors.stddev: needs to find a way to test color table. +* r.contour.level: needs to export vector to GeoJSON (instead of Shapefile). +* r.contour.step: needs to export vector to GeoJSON (instead of Shapefile). +* r.drain: needs another dataset. +* r.flow.aspect.barrier: needs another dataset. +* r.flow.barrier: needs another dataset. +* r.grow: needs another dataset. +* r.grow.distance: needs another dataset. +* r.gwflow: needs another (huge) dataset. * r.horizon * r.horizon.height -* r.in.lidar -* r.in.lidar.info -* r.info -* r.kappa -* r.lake.coords -* r.lake.layer -* r.latlong -* r.li.cwed -* r.li.cwed.ascii -* r.li.dominance -* r.li.dominance.ascii -* r.li.edgedensity -* r.li.edgedensity.ascii -* r.li.mpa -* r.li.mpa.ascii -* r.li.mps -* r.li.mps.ascii -* r.li.padcv -* r.li.padcv.ascii -* r.li.padrange -* r.li.padrange.ascii -* r.li.padsd -* r.li.padsd.ascii -* r.li.patchdensity -* r.li.patchdensity.ascii -* r.li.patchnum -* r.li.patchnum.ascii -* r.li.pielou -* r.li.pielou.ascii -* r.li.renyi -* r.li.renyi.ascii -* r.li.richness -* r.li.richness.ascii -* r.li.shannon -* r.li.shannon.ascii -* r.li.shape -* r.li.shape.ascii -* r.li.simpson -* r.li.simpson.ascii +* r.in.lidar: needs another dataset. +* r.in.lidar.info: needs another dataset. * r.mapcalc * r.mask.rast * r.mask.vect diff --git a/python/plugins/processing/tests/testdata/custom/grass7/points2.dbf b/python/plugins/processing/tests/testdata/custom/grass7/points2.dbf new file mode 100644 index 0000000000000000000000000000000000000000..4e0de29048c3dee2e124e406d5e8505ade660bbb GIT binary patch literal 432 zcmZQBVUuEJU|?uuNClFZATtFn<_BVN!MPBIkE4^T4}|Fqq5>dnI2q>X6Y2`#Vb#y8 t00#zcnMK7Va4z*2h6V_;41-gX^Yc;=0@Pv|BUxe;l95?N13MJV%mIVKF + 5 1.000000e+00 1.600000e+00 255 255 0 0 255 0 1.600000e+00 2.200000e+00 0 255 0 0 255 255 2.200000e+00 2.800000e+00 0 255 255 0 0 255 2.800000e+00 3.400000e+00 0 0 255 255 0 255 3.400000e+00 4.000000e+00 255 0 255 255 0 0 - 5 GRASS GIS 7.0.3 4 3.3133333333333 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml index ab04631ee81..a5b37b9a743 100644 --- a/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml +++ b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml @@ -11,12 +11,12 @@ + 5 1.000000e+00 1.800000e+00 255 255 0 0 255 0 1.800000e+00 2.600000e+00 0 255 0 0 255 255 2.600000e+00 3.400000e+00 0 255 255 0 0 255 3.400000e+00 4.200000e+00 0 0 255 255 0 255 4.200000e+00 5.000000e+00 255 0 255 255 0 0 - 5 GRASS GIS 7.0.3 5 3.4714760638298 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml index 4384222b185..40cd7dd73d7 100644 --- a/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml +++ b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml @@ -11,12 +11,12 @@ + 5 1.000000e+00 2.000000e+00 255 255 0 0 255 0 2.000000e+00 3.000000e+00 0 255 0 0 255 255 3.000000e+00 4.000000e+00 0 255 255 0 0 255 4.000000e+00 5.000000e+00 0 0 255 255 0 255 5.000000e+00 6.000000e+00 255 0 255 255 0 0 - 5 GRASS GIS 7.0.3 6 4.1343333333333 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/rliconfig b/python/plugins/processing/tests/testdata/custom/grass7/rliconfig new file mode 100644 index 00000000000..203391b0328 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/rliconfig @@ -0,0 +1,2 @@ +SAMPLINGFRAME 0|0|1|1 +SAMPLEAREA 0.0|0.0|1.0|1.0 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/rliconfigmoving b/python/plugins/processing/tests/testdata/custom/grass7/rliconfigmoving new file mode 100644 index 00000000000..48a896bf0e9 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/rliconfigmoving @@ -0,0 +1,3 @@ +SAMPLINGFRAME 0.1223021582733813|0.14678899082568808|0.26605504587155965|0.39568345323741005 +SAMPLEAREA -1|-1|0.09174311926605505|0.07194244604316546 +MOVINGWINDOW diff --git a/python/plugins/processing/tests/testdata/custom/grass7/weighted.csv b/python/plugins/processing/tests/testdata/custom/grass7/weighted.csv new file mode 100644 index 00000000000..b604ffa0168 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/weighted.csv @@ -0,0 +1,4 @@ +1,2,0.65 +3,4,0.32 +5,6,0.54 + diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.category.out.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.category.out.txt new file mode 100644 index 00000000000..adb51fe5233 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.category.out.txt @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.coin.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.coin.txt new file mode 100644 index 00000000000..3ea66dacecb --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.coin.txt @@ -0,0 +1,35 @@ + ++------------------------------------------------------------------------------+ +| COINCIDENCE TABULATION REPORT | +|------------------------------------------------------------------------------| +| Location: temp_location Mapset: PERMANENT Date: Sun Jun 26 11:43:50 | +| | +| Layer 1: tmp146693422996-- | +| Layer 2: tmp146693422996-- | +| Mask: Aucun | +| | +| Units: percent cover | +|------------------------------------------------------------------------------| +| Window: North: 6693700 | +| West: 344500 East: 358400 | +| South: 6682800 | ++------------------------------------------------------------------------------+ + +Panel #1 of 1 ++--------------------------------------------------------------------------------+ +-----------------------+ +| | tmp14669342299627 | Panel Row Total | | Table Row Total | +| cat# | 1 | 2 | 3 | 4 | w cat 0 | w/o cat 0 | | w cat 0 | w/o cat 0 | +|--------------------------------------------------------------------------------| |-----------------------| +|t 1 | 0.29 | 1.55 | 5.10 | 6.14 | 13.08 | 13.08 | | 13.08 | 13.08 | +|m 2 | 0.12 | 0.69 | 2.36 | 2.81 | 5.98 | 5.98 | | 5.98 | 5.98 | +|p 3 | 0.28 | 1.39 | 5.50 | 6.59 | 13.75 | 13.75 | | 13.75 | 13.75 | +|1 4 | 0.36 | 2.20 | 8.22 | 8.86 | 19.64 | 19.64 | | 19.64 | 19.64 | +|4 5 | 0.30 | 1.35 | 5.04 | 6.14 | 12.83 | 12.83 | | 12.83 | 12.83 | +|6 6 | 0.61 | 3.89 | 12.91 | 15.31 | 32.73 | 32.73 | | 32.73 | 32.73 | +|--------------------------------------------------------------------------------| |-----------------------| +|Total | | | | | | | | | | +|with 0 | 1.96 | 11.08 | 39.13 | 45.85 | 98.02 | 98.02 | | 98.02 | 98.02 | +|--------------------------------------------------------------------------------| |-----------------------| +|w/o 0 | 1.96 | 11.08 | 39.13 | 45.85 | 98.02 | 98.02 | | 98.02 | 98.02 | ++--------------------------------------------------------------------------------+ +-----------------------+ + diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.colors.out.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.colors.out.txt new file mode 100644 index 00000000000..5c280fb7d1b --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.colors.out.txt @@ -0,0 +1,4 @@ +-303 0:0:0 +14847 255:255:255 +nv 255:255:255 +default 255:255:255 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.covar.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.covar.txt new file mode 100644 index 00000000000..56823bb5649 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.covar.txt @@ -0,0 +1,4 @@ +N = 14743 +3.032568 0.048485 -0.000132 +0.048485 2.232202 -0.013692 +-0.000132 -0.013692 0.561513 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.describe.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.describe.txt new file mode 100644 index 00000000000..0b73010262a --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.describe.txt @@ -0,0 +1 @@ +0 1-6 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.distance.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.distance.txt new file mode 100644 index 00000000000..d1ce89ca7b4 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.distance.txt @@ -0,0 +1,4 @@ +1:1:0:344550:6693650:344550:6693650 +2:1:100:355550:6693650:355550:6693550 +3:1:100:352750:6693650:352650:6693650 +4:1:100:344650:6693650:344550:6693650 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.info.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.info.txt new file mode 100644 index 00000000000..699e947667a --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.info.txt @@ -0,0 +1,29 @@ + +----------------------------------------------------------------------------+ + | Map: tmp14669386814521 Date: Sun Jun 26 12:58:01 2016 | + | Mapset: PERMANENT Login of Creator: medspx | + | Location: temp_location | + | DataBase: /tmp/processingd1287b3c04994d8a8ed29b67a67c13bb/grassdata | + | Title: ( tmp14669386814521 ) | + | Timestamp: none | + |----------------------------------------------------------------------------| + | | + | Type of Map: raster Number of Categories: 0 | + | Data Type: FCELL | + | Rows: 109 | + | Columns: 139 | + | Total Cells: 15151 | + | Projection: unnamed | + | N: 6693700 S: 6682800 Res: 100 | + | E: 358400 W: 344500 Res: 100 | + | Range of data: min = -303 max = 14847 | + | | + | Data Description: | + | gnr par r.external | + | | + | Comments: | + | r.external --overwrite -o input="/home/medspx/projects/QGIS/code/pyt\ | + | hon/plugins/processing/tests/testdata/custom/grass7/float_raster.tif\ | + | " output="tmp14669386814521" band=1 | + | | + +----------------------------------------------------------------------------+ + diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.kappa.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.kappa.txt new file mode 100644 index 00000000000..5fa803cb651 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.kappa.txt @@ -0,0 +1,59 @@ + ACCURACY ASSESSMENT +LOCATION: temp_location Sun Jun 26 12:49:27 2016 +MASK: none +MAPS: MAP1 = (untitled) (tmp14669381667410 in PERMANENT) + MAP2 = (untitled) (tmp1466938166749 in PERMANENT) + +Error Matrix +Panel #1 of 2 + MAP1 + cat# 1 2 3 4 5 + M 1 44 18 42 55 45 + A 2 0 0 0 0 0 + P 3 0 0 0 0 0 + 2 4 0 0 0 0 0 + 5 0 0 0 0 0 + 6 0 0 0 0 0 +Col Sum 44 18 42 55 45 + +Panel #2 of 2 + MAP1 + cat# 6 Row Sum + M 1 93 297 + A 2 0 0 + P 3 0 0 + 2 4 0 0 + 5 0 0 + 6 0 0 +Col Sum 93 297 + + +Cats % Commission % Ommission Estimated Kappa +1 85.185185 0.000000 0.000000 +2 NA NA NA +3 NA NA NA +4 NA NA NA +5 NA NA NA +6 NA NA NA + +Kappa Kappa Variance +0.000000 0.005729 + +Obs Correct Total Obs % Observed Correct +44 297 14.814815 + +MAP1 Category Description +1: (no description) +2: (no description) +3: (no description) +4: (no description) +5: (no description) +6: (no description) + +MAP2 Category Description +1: (no description) +2: (no description) +3: (no description) +4: (no description) +5: (no description) +6: (no description) diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.cwed.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.cwed.ascii.txt new file mode 100644 index 00000000000..f9d9d99a6be --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.cwed.ascii.txt @@ -0,0 +1 @@ +RESULT 1|1484.18 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.dominance.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.dominance.ascii.txt new file mode 100644 index 00000000000..f82a542fbb6 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.dominance.ascii.txt @@ -0,0 +1 @@ +RESULT 1|0.121643391969718 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.edgedensity.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.edgedensity.ascii.txt new file mode 100644 index 00000000000..2ac947344bd --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.edgedensity.ascii.txt @@ -0,0 +1 @@ +RESULT 1|24.86 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.mpa.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.mpa.ascii.txt new file mode 100644 index 00000000000..7a96448525b --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.mpa.ascii.txt @@ -0,0 +1 @@ +RESULT 1|4.13433333333333 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.mps.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.mps.ascii.txt new file mode 100644 index 00000000000..6f8ebc8b3a1 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.mps.ascii.txt @@ -0,0 +1 @@ +RESULT 1|1.6642627316099 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.padcv.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.padcv.ascii.txt new file mode 100644 index 00000000000..6607dfd2b33 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.padcv.ascii.txt @@ -0,0 +1 @@ +RESULT 1|102.492806034809 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.padrange.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.padrange.ascii.txt new file mode 100644 index 00000000000..3aa788964a1 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.padrange.ascii.txt @@ -0,0 +1 @@ +RESULT 1|36 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.padsd.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.padsd.ascii.txt new file mode 100644 index 00000000000..311c4e0556d --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.padsd.ascii.txt @@ -0,0 +1 @@ +RESULT 1|1.70574957341855 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.patchdensity.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.patchdensity.ascii.txt new file mode 100644 index 00000000000..dd57e2eb8f0 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.patchdensity.ascii.txt @@ -0,0 +1 @@ +RESULT 1|60.0866666666667 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.patchnum.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.patchnum.ascii.txt new file mode 100644 index 00000000000..65b416966f3 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.patchnum.ascii.txt @@ -0,0 +1 @@ +RESULT 1|9013 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.pielou.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.pielou.ascii.txt new file mode 100644 index 00000000000..8bee3e49d23 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.pielou.ascii.txt @@ -0,0 +1 @@ +RESULT 1|0.932109530291962 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.renyi.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.renyi.ascii.txt new file mode 100644 index 00000000000..a505901dadb --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.renyi.ascii.txt @@ -0,0 +1 @@ +RESULT 1|1.47108219688802 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.richness.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.richness.ascii.txt new file mode 100644 index 00000000000..0cc0de09a54 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.richness.ascii.txt @@ -0,0 +1 @@ +RESULT 1|6 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.shannon.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.shannon.ascii.txt new file mode 100644 index 00000000000..8825943c5a1 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.shannon.ascii.txt @@ -0,0 +1 @@ +RESULT 1|1.67011607725834 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.shape.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.shape.ascii.txt new file mode 100644 index 00000000000..8384dcd5047 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.shape.ascii.txt @@ -0,0 +1 @@ +RESULT 1|97.1875880278272 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/r.li.simpson.ascii.txt b/python/plugins/processing/tests/testdata/expected/grass7/r.li.simpson.ascii.txt new file mode 100644 index 00000000000..462cb8df316 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/r.li.simpson.ascii.txt @@ -0,0 +1 @@ +RESULT 1|0.790194657777778 diff --git a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml index 410cbbbfb6c..b8c3f6757d9 100644 --- a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml +++ b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml @@ -129,7 +129,7 @@ tests: type: rasterhash - algorithm: grass7:r.what.points - name: Test (grass7:r.what.points) + name: GRASS7 r.what.points params: -c: false -f: false @@ -154,7 +154,7 @@ tests: name: expected/grass7/r.what.points.txt - algorithm: grass7:r.what.coords - name: Test (grass7:r.what.coords) + name: GRASS7 r.what.coords params: -c: false -f: false @@ -174,7 +174,7 @@ tests: type: file name: expected/grass7/r.what.coords.txt - algorithm: grass7:r.what.color - name: Test (grass7:r.what.color) + name: GRASS7 r.what.color params: GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 format: '' @@ -187,7 +187,7 @@ tests: name: expected/grass7/r.what.colors.txt type: file - algorithm: grass7:r.watershed - name: Test (grass7:r.watershed) + name: GRASS7 r.watershed params: '-4': false -a: false @@ -230,7 +230,7 @@ tests: type: rasterhash - algorithm: grass7:r.water.outlet - name: Test (grass7:r.water.outlet) + name: GRASS7 r.water.outlet params: GRASS_REGION_CELLSIZE_PARAMETER: 0.0 GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -244,7 +244,7 @@ tests: type: rasterhash - algorithm: grass7:r.walk.rast - name: Test (grass7:r.walk.rast) + name: GRASS7 r.walk.rast params: -k: false -n: false @@ -274,7 +274,7 @@ tests: type: rasterhash - algorithm: grass7:r.walk.points - name: Test (grass7:r.walk.points) + name: GRASS7 r.walk.points params: -k: false -n: false @@ -306,7 +306,7 @@ tests: type: rasterhash - algorithm: grass7:r.walk.coords - name: Test (grass7:r.walk.coords) + name: GRASS7 r.walk.coords params: -k: false -n: false @@ -335,7 +335,7 @@ tests: type: rasterhash - algorithm: grass7:r.usler - name: Test (grass7:r.usler) + name: GRASS7 r.usler params: GRASS_REGION_CELLSIZE_PARAMETER: 0 GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -349,7 +349,7 @@ tests: type: rasterhash - algorithm: grass7:r.univar - name: Test (grass7:r.univar) + name: GRASS7 r.univar params: -e: false GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -368,7 +368,7 @@ tests: type: file - algorithm: grass7:r.transect - name: Test (grass7:r.transect) + name: GRASS7 r.transect params: -g: false GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -383,7 +383,7 @@ tests: type: file - algorithm: grass7:r.topmodel.topidxstats - name: Test (grass7:r.topmodel.topidxstats) + name: GRASS7 r.topmodel.topidxstats params: GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 ntopidxclasses: 30 @@ -396,7 +396,7 @@ tests: type: file - algorithm: grass7:r.topidx - name: Test (grass7:r.topidx) + name: GRASS7 r.topidx params: GRASS_REGION_CELLSIZE_PARAMETER: 0.0 GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -409,7 +409,7 @@ tests: type: rasterhash - algorithm: grass7:r.thin - name: Test (grass7:r.thin) + name: GRASS7 r.thin params: GRASS_REGION_CELLSIZE_PARAMETER: 0.0 GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -423,7 +423,7 @@ tests: type: rasterhash - algorithm: grass7:r.surf.idw - name: Test (grass7:r.surf.idw) + name: GRASS7 r.surf.idw params: -e: false GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -438,7 +438,7 @@ tests: type: rasterhash - algorithm: grass7:r.surf.contour - name: Test (grass7:r.surf.contour) + name: GRASS7 r.surf.contour params: GRASS_REGION_CELLSIZE_PARAMETER: 0.0 GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -451,7 +451,7 @@ tests: type: rasterhash - algorithm: grass7:r.surf.area - name: Test (grass7:r.surf.area) + name: GRASS7 r.surf.area params: GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 map: @@ -465,7 +465,7 @@ tests: type: file - algorithm: grass7:r.sunmask.position - name: Test (grass7:r.sunmask.position) + name: GRASS7 r.sunmask.position params: -s: false -z: false @@ -484,7 +484,7 @@ tests: type: rasterhash - algorithm: grass7:r.sunmask.datetime - name: Test (grass7:r.sunmask.datetime) + name: GRASS7 r.sunmask.datetime params: -s: false -z: true @@ -508,7 +508,7 @@ tests: type: rasterhash - algorithm: grass7:r.sun - name: Test (grass7:r.sun) + name: GRASS7 r.sun params: -m: false -p: false @@ -545,7 +545,7 @@ tests: type: rasterhash - algorithm: grass7:r.stream.extract - name: Test (grass7:r.stream.extract) + name: GRASS7 r.stream.extract params: GRASS_OUTPUT_TYPE_PARAMETER: '0' GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -566,7 +566,7 @@ tests: type: rasterhash - algorithm: grass7:r.stats.quantile.out - name: Test (grass7:r.stats.quantile.out) + name: GRASS7 r.stats.quantile.out params: -r: false GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 @@ -585,7 +585,7 @@ tests: type: file - algorithm: grass7:r.stats - name: Test (grass7:r.stats) + name: GRASS7 r.stats params: '-1': false -A: true @@ -619,7 +619,7 @@ tests: type: file - algorithm: grass7:r.statistics - name: Test (grass7:r.statistics) + name: GRASS7 r.statistics params: -c: false GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -637,7 +637,7 @@ tests: type: rasterhash - algorithm: grass7:r.spread - name: Test (grass7:r.spread) + name: GRASS7 r.spread params: -i: false -s: false @@ -671,7 +671,7 @@ tests: type: rasterhash - algorithm: grass7:r.slope.aspect - name: Test (grass7:r.slope.aspect) + name: GRASS7 r.slope.aspect params: -a: true GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -713,7 +713,7 @@ tests: type: rasterhash - algorithm: grass7:r.slope - name: Test (grass7:r.slope) + name: GRASS7 r.slope params: -a: false GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -730,7 +730,7 @@ tests: type: rasterhash - algorithm: grass7:r.aspect - name: Test (grass7:r.aspect) + name: GRASS7 r.aspect params: -a: false GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -747,7 +747,7 @@ tests: type: rasterhash - algorithm: grass7:r.shade - name: Test (grass7:r.shade) + name: GRASS7 r.shade params: -c: false GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -766,7 +766,7 @@ tests: type: rasterhash - algorithm: grass7:r.series - name: Test (grass7:r.series) + name: GRASS7 r.series params: -n: false GRASS_REGION_CELLSIZE_PARAMETER: 0.0 @@ -785,3 +785,973 @@ tests: hash: 19ca3124af3dc68294f73327a0c80596eaed5fcbf46cfb7e784d17f5 type: rasterhash + - algorithm: grass7:r.category + name: GRASS7 r.category + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + name: custom/grass7/raster_4class.tif + type: raster + txtrules: '1: First\n2: Second\n3: Nothing\n4: What you want' + results: + output: + hash: 59b41078ca329fc59eab84097ba8601cf9a1ad823867bf16d1bac044 + type: rasterhash + + - algorithm: grass7:r.category.out + name: GRASS7 r.category.out + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + name: custom/grass7/raster_5class.tif + type: raster + results: + output: + name: expected/grass7/r.category.out.txt + type: file + + - algorithm: grass7:r.coin + name: GRASS7 r.coin + params: + -w: true + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + first: + name: custom/grass7/raster_4class.tif + type: raster + second: + name: custom/grass7/raster_6class.tif + type: raster + units: '1' + results: + rawoutput: + type: regex + name: expected/grass7/r.coin.txt + rules: + - '|t 1 | 0.29 | 1.55 | 5.10 | 6.14 | 13.08 | 13.08 |' + - '|m 2 | 0.12 | 0.69 | 2.36 | 2.81 | 5.98 | 5.98 |' + - '|p 3 | 0.28 | 1.39 | 5.50 | 6.59 | 13.75 | 13.75 |' + - '|1 4 | 0.36 | 2.20 | 8.22 | 8.86 | 19.64 | 19.64 |' + - '|4 5 | 0.30 | 1.35 | 5.04 | 6.14 | 12.83 | 12.83 |' + - '|6 6 | 0.61 | 3.89 | 12.91 | 15.31 | 32.73 | 32.73 |' + + - algorithm: grass7:r.colors.out + name: GRASS7 r.colors.out) + params: + -p: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + name: custom/grass7/float_raster.tif + type: raster + results: + rules: + name: expected/grass7/r.colors.out.txt + type: file + + - algorithm: grass7:r.composite + name: GRASS7 r.composite + params: + -c: true + -d: false + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + blue: + name: custom/grass7/raster_6class.tif + type: raster + green: + name: custom/grass7/raster_5class.tif + type: raster + level_blue: 32 + level_green: 32 + level_red: 32 + red: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 48aa021881c74821c3ad6a5d2205ef74421814b5b2ac7bb8918d44d2 + type: rasterhash + + - algorithm: grass7:r.cost.coordinates + name: GRASS7 r.cost.coordinates + params: + -k: false + -n: true + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + input: + name: custom/grass7/raster_6class.tif + type: raster + max_cost: 0 + memory: 300 + null_cost: 0 + start_coordinates: 346371,6690604 + stop_coordinates: 356300,6688453 + results: + output: + hash: ed392f88d156af060917cec8e3fd69cd5b962cd82a67274861682ea1 + type: rasterhash + + - algorithm: grass7:r.cost.raster + name: GRASS7 r.cost.raster + params: + -k: false + -n: true + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + input: + name: custom/grass7/raster_6class.tif + type: raster + max_cost: 0 + memory: 300 + null_cost: 0 + start_raster: + name: custom/grass7/raster_1class.tif + type: raster + results: + output: + hash: ae9b2f9ddc60b57e1dbb7a0f989cbcf732fd339e80b450bbdfe48f20 + type: rasterhash + + - algorithm: grass7:r.cost.points + name: GRASS7 r.cost.points + params: + -k: false + -n: true + GRASS_MIN_AREA_PARAMETER: 0.0001 + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + GRASS_SNAP_TOLERANCE_PARAMETER: -1.0 + input: + name: custom/grass7/raster_6class.tif + type: raster + start_points: + name: custom/grass7/points.shp + type: vector + stop_points: + name: custom/grass7/points2.shp + type: vector + results: + output: + hash: d08b86dbf86d283f642381dd38ef62e0d6ec2ec905fcbee66fe631cd + type: rasterhash + + - algorithm: grass7:r.covar + name: GRASS7 r.covar + params: + -r: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + results: + rawoutput: + name: expected/grass7/r.covar.txt + type: file + + - algorithm: grass7:r.cross + name: GRASS7 r.cross + params: + -z: true + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + results: + output: + hash: 1eccafaa5b459c8a57e72d449f1586a4088bda82fe891f8687dbd94b + type: rasterhash + + - algorithm: grass7:r.describe + name: GRASS7 r.describe + params: + -d: false + -i: false + -n: false + -r: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + name: custom/grass7/raster_6class.tif + type: raster + nsteps: 255 + nv: 0 + results: + rawoutput: + name: expected/grass7/r.describe.txt + type: file + + - algorithm: grass7:r.distance + name: GRASS7 r.distance + params: + -l: false + -n: false + -o: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + params: + - name: custom/grass7/raster_4class.tif + type: raster + - name: custom/grass7/raster_1class.tif + type: raster + type: multi + separator: ':' + sort: '0' + results: + output: + name: expected/grass7/r.distance.txt + type: file + + - algorithm: grass7:r.fill.dir + name: GRASS7 r.fill.dir + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + format: '0' + input: + name: custom/grass7/float_raster.tif + type: raster + results: + areas: + hash: 5edf01dbbe2d08fd89a52f662373bbe6acfa4bbc86f002697ecd9dcc + type: rasterhash + direction: + hash: 093995e21463d59ccd17b9e432a3a10cd2c1c25e8e415d3770578384 + type: rasterhash + output: + hash: c9b138bce89dbb17dfc3995c8338380e480ac5a1736981c73f146160 + type: rasterhash + + - algorithm: grass7:r.fillnulls + name: GRASS7 r.fillnulls + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + edge: 4 + input: + name: custom/grass7/raster_6class.tif + type: raster + method: '0' + npmin: 20 + segmax: 10 + smooth: 1.1 + tension: 20.0 + results: + output: + hash: 04e780c464528fc411f1531175a6ba78a44ce5f429e7b5f67f935b9f + type: rasterhash + + - algorithm: grass7:r.flow + name: GRASS7 r.flow + params: + '-3': false + -m: false + -u: false + GRASS_OUTPUT_TYPE_PARAMETER: '0' + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + bound: 1609 + elevation: + name: custom/grass7/float_raster.tif + type: raster + skip: 7 + results: + flowaccumulation: + hash: f9ac137eba82ffb462f2ee92ef6f51a27138d3aa3e2b59ad318884b7 + type: rasterhash + flowlength: + hash: 1396f17f7a5afbffdc3c31704029a0f826f56bc39a2c2a4a5a7d6efd + type: rasterhash + + - algorithm: grass7:r.flow.aspect + name: GRASS7 r.flow.aspect + params: + '-3': false + -m: false + -u: false + GRASS_OUTPUT_TYPE_PARAMETER: '0' + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + aspect: + name: custom/grass7/raster_6class.tif + type: raster + bound: 1609 + elevation: + name: custom/grass7/float_raster.tif + type: raster + skip: 7 + results: + flowaccumulation: + hash: cea321bb920029ebac058ac56b0052c1e7745d1e0ecc89fb00dc76d1 + type: rasterhash + flowlength: + hash: a9bd95b064f0ad585a2e71bee3c36cc32c4bf8010e35401074b9cdd0 + type: rasterhash + + - algorithm: grass7:r.his + name: GRASS7 r.his + params: + -c: true + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + hue: + name: custom/grass7/float_raster.tif + type: raster + intensity: + name: custom/grass7/raster_4class.tif + type: raster + saturation: + name: custom/grass7/raster_5class.tif + type: raster + results: + blue: + hash: 7fab6db4c0517dbd4a3d61181874ad0544383896ba5f4292c9418be2 + type: rasterhash + green: + hash: 7fab6db4c0517dbd4a3d61181874ad0544383896ba5f4292c9418be2 + type: rasterhash + red: + hash: 7fab6db4c0517dbd4a3d61181874ad0544383896ba5f4292c9418be2 + type: rasterhash + + - algorithm: grass7:r.kappa + name: GRASS7 r.kappa + params: + -h: false + -w: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + classification: + name: custom/grass7/raster_1class.tif + type: raster + reference: + name: custom/grass7/raster_6class.tif + type: raster + title: ACCURACY ASSESSMENT + results: + output: + name: expected/grass7/r.kappa.txt + type: regex + rules: + - '44 297 14.814815' + + - algorithm: grass7:r.lake.coords + name: GRASS7 r.lake.coords + params: + -n: false + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + coordinates: 350854,6688401 + elevation: + name: custom/grass7/raster_6class.tif + type: raster + water_level: 30.0 + results: + lake: + hash: 32056cee99277fa769e1e135f76c82bb122b30060485890112819126 + type: rasterhash + + - algorithm: grass7:r.lake.layer + name: GRASS7 r.lake.layer + params: + -n: false + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + elevation: + name: custom/grass7/float_raster.tif + type: raster + seed: + name: custom/grass7/raster_1class.tif + type: raster + water_level: 10000.0 + results: + lake: + hash: 539f4ac0347ad6b688f9a1af14d78ab26bbccac3f9916cc6f5204bc6 + type: rasterhash + + - algorithm: grass7:r.latlong + name: GRASS7 r.latlong + params: + -l: false + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + input: + name: custom/grass7/float_raster.tif + type: raster + results: + output: + hash: 418f93ebf06c0b5ae3c7a126513fe4384a3aaa6f8fb570f3d39e2877 + type: rasterhash + + - algorithm: grass7:r.info + name: GRASS7 r.info + params: + -d: false + -g: false + -h: false + -m: false + -p: false + -r: false + -s: false + -t: false + -u: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + map: + name: custom/grass7/float_raster.tif + type: raster + results: + rawoutput: + name: expected/grass7/r.info.txt + type: regex + rules: + - 'N: 6693700 S: 6682800 Res: 100' + - 'E: 358400 W: 344500 Res: 100' + + - algorithm: grass7:r.li.cwed + name: GRASS7 r.li.cwed + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + input: + name: custom/grass7/raster_6class.tif + type: raster + path: + name: custom/grass7/weighted.csv + type: file + results: + output: + hash: ec76f5b372d859548d580023dabc210dd8c76987eada6cde7c0b3e5a + type: rasterhash + + - algorithm: grass7:r.li.dominance + name: GRASS7 r.li.dominance + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 3df7cd453b8cebedc92a7d127e10b0eb1fdc6e1f2ff3c3b4ca578369 + type: rasterhash + + - algorithm: grass7:r.li.edgedensity + name: GRASS7 r.li.edgedensity + params: + -b: false + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + patch_type: '3' + results: + output: + hash: f7ff986b10f23376e788ca1544d15d9296bfe6c0317e3aad89a7446e + type: rasterhash + + - algorithm: grass7:r.li.mpa + name: GRASS7 r.li.mpa + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: d03a0795dc1a441cf6016dae791791f255b35e9c4b656c4956793041 + type: rasterhash + + - algorithm: grass7:r.li.mps + name: GRASS7 r.li.mps + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: f6ab86cd0b6148c4298921f80845cb573915e32d66af8bf7b4695250 + type: rasterhash + + - algorithm: grass7:r.li.padcv + name: GRASS7 r.li.padcv + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 1f351e437934e8655905fe42ee55d6918ec25f1ca737abd6d78b5246 + type: rasterhash + + - algorithm: grass7:r.li.padrange + name: GRASS7 r.li.padrange + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 83a3fdb3eaf47fcdf878a0c66a6727553b58ab3d1f4736b485399cff + type: rasterhash + + - algorithm: grass7:r.li.padsd + name: GRASS7 r.li.padsd + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 48f8a52703f6e9b168b15fca180bb774580c557484598d165ef697c0 + type: rasterhash + + - algorithm: grass7:r.li.patchdensity + name: GRASS7 r.li.patchdensity + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: d32d9875ff52e1ed69df306602c74ae4f0d5c40e16f620482d7341d6 + type: rasterhash + + - algorithm: grass7:r.li.patchnum + name: GRASS7 r.li.patchnum + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 234771688886677233dc56a3d7f1d6cafbc1f736cbb48e1251719b72 + type: rasterhash + + - algorithm: grass7:r.li.pielou + name: GRASS7 r.li.pielou + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: b10a953914ed37ee7e4c1e14f796621d7656f55f7b7185d2e6ae0184 + type: rasterhash + + - algorithm: grass7:r.li.renyi + name: GRASS7 r.li.renyi + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + alpha: '3' + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 83f86ca9d7c029ef9e62e0c8804ae60059fccb2bbf5c96bd4c2704e1 + type: rasterhash + + - algorithm: grass7:r.li.richness + name: GRASS7 r.li.richness + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 010f0d0a68fb14a4cb064b9890b5bf7e0921f3faa91276419cb037c5 + type: rasterhash + + - algorithm: grass7:r.li.shannon + name: GRASS7 r.li.shannon + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 144094fba63106b776cb78fd9fac418988044b55f7d19db1b45876cd + type: rasterhash + + - algorithm: grass7:r.li.shape + name: GRASS7 r.li.shape + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: b703521aff3a9ea75612b174912061173a761f1ebef58a3523d2eaa9 + type: rasterhash + + - algorithm: grass7:r.li.simpson + name: GRASS7 r.li.simpson + params: + GRASS_REGION_CELLSIZE_PARAMETER: 0.0 + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfigmoving + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + hash: 6f1f3af79c1baaebdd795f569bcb1dcf43b8c025896c5425d539422e + type: rasterhash + + - algorithm: grass7:r.li.cwed.ascii + name: GRASS7 r.li.cwed.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + input: + name: custom/grass7/raster_6class.tif + type: raster + path: + name: custom/grass7/weighted.csv + type: file + results: + output: + name: expected/grass7/r.li.cwed.ascii.txt + type: file + + - algorithm: grass7:r.li.dominance.ascii + name: GRASS7 r.li.dominance.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.dominance.ascii.txt + type: file + + - algorithm: grass7:r.li.edgedensity.ascii + name: GRASS7 r.li.edgedensity.ascii + params: + -b: false + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + patch_type: '3' + results: + output: + name: expected/grass7/r.li.edgedensity.ascii.txt + type: file + + - algorithm: grass7:r.li.mpa.ascii + name: GRASS7 r.li.mpa.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.mpa.ascii.txt + type: file + + - algorithm: grass7:r.li.mps.ascii + name: GRASS7 r.li.mps.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.mps.ascii.txt + type: file + + - algorithm: grass7:r.li.padcv.ascii + name: GRASS7 r.li.padcv.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.padcv.ascii.txt + type: file + + - algorithm: grass7:r.li.padrange.ascii + name: GRASS7 r.li.padrange.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.padrange.ascii.txt + type: file + + - algorithm: grass7:r.li.padsd.ascii + name: GRASS7 r.li.padsd.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.padsd.ascii.txt + type: file + + - algorithm: grass7:r.li.patchdensity.ascii + name: GRASS7 r.li.patchdensity.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.patchdensity.ascii.txt + type: file + + - algorithm: grass7:r.li.patchnum.ascii + name: GRASS7 r.li.patchnum.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.patchnum.ascii.txt + type: file + + - algorithm: grass7:r.li.pielou.ascii + name: GRASS7 r.li.pielou.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.pielou.ascii.txt + type: file + + - algorithm: grass7:r.li.renyi.ascii + name: GRASS7 r.li.renyi.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + alpha: '3' + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.renyi.ascii.txt + type: file + + - algorithm: grass7:r.li.richness.ascii + name: GRASS7 r.li.richness.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.richness.ascii.txt + type: file + + - algorithm: grass7:r.li.shannon.ascii + name: GRASS7 r.li.shannon.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.shannon.ascii.txt + type: file + + - algorithm: grass7:r.li.shape.ascii + name: GRASS7 r.li.shape.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.shape.ascii.txt + type: file + + - algorithm: grass7:r.li.simpson.ascii + name: GRASS7 r.li.simpson.ascii + params: + GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 + config: + name: custom/grass7/rliconfig + type: file + config_txt: '' + input: + name: custom/grass7/raster_6class.tif + type: raster + results: + output: + name: expected/grass7/r.li.simpson.ascii.txt + type: file From 4140655f204fc328da6a625c519b411d6401e1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 26 Jun 2016 17:29:53 +0200 Subject: [PATCH 14/15] Remove 3 unit tests that don't perform well in osgeo4travis --- .../custom/grass7/float_raster.tif.aux.xml | 20 --- .../custom/grass7/raster_1class.tif.aux.xml | 23 --- .../custom/grass7/raster_4class.tif.aux.xml | 27 --- .../custom/grass7/raster_5class.tif.aux.xml | 27 --- .../custom/grass7/raster_6class.tif.aux.xml | 27 --- .../grass7_algorithms_raster_tests.yaml | 156 +++++++++--------- 6 files changed, 80 insertions(+), 200 deletions(-) delete mode 100644 python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml delete mode 100644 python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml delete mode 100644 python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml delete mode 100644 python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml delete mode 100644 python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml diff --git a/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml deleted file mode 100644 index 1bc16ac0895..00000000000 --- a/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -310.575 - 14854.575 - 1000 - 0 - 0 - 8|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|8 - - - - 14847 - 7272 - -303 - 4373.7169547194 - - - diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml deleted file mode 100644 index 9dc5622602e..00000000000 --- a/python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif.aux.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 1 - 1 - 1 - 0 - 0 - 0 - - - - 1 - 1.000000e+00 1.000000e+00 255 0 127 255 0 127 - GRASS GIS 7.0.4 - 1 - 1 - 1 - 0 - - - diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml deleted file mode 100644 index 9ada6028f3f..00000000000 --- a/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - 0.625 - 4.375 - 4 - 0 - 0 - 300|1700|6000|7000 - - - - 5 - 1.000000e+00 1.600000e+00 255 255 0 0 255 0 - 1.600000e+00 2.200000e+00 0 255 0 0 255 255 - 2.200000e+00 2.800000e+00 0 255 255 0 0 255 - 2.800000e+00 3.400000e+00 0 0 255 255 0 255 - 3.400000e+00 4.000000e+00 255 0 255 255 0 0 - GRASS GIS 7.0.3 - 4 - 3.3133333333333 - 1 - 0.74954801195268 - - - diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml deleted file mode 100644 index a5b37b9a743..00000000000 --- a/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - 0.6 - 5.4 - 5 - 0 - 0 - 2999|921|2110|4010|5000 - - - - 5 - 1.000000e+00 1.800000e+00 255 255 0 0 255 0 - 1.800000e+00 2.600000e+00 0 255 0 0 255 255 - 2.600000e+00 3.400000e+00 0 255 255 0 0 255 - 3.400000e+00 4.200000e+00 0 0 255 255 0 255 - 4.200000e+00 5.000000e+00 255 0 255 255 0 0 - GRASS GIS 7.0.3 - 5 - 3.4714760638298 - 1 - 1.4943102023375 - - - diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml deleted file mode 100644 index 40cd7dd73d7..00000000000 --- a/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - 0.5833333333333333 - 6.416666666666667 - 6 - 0 - 0 - 1999|920|2110|3010|1960|5001 - - - - 5 - 1.000000e+00 2.000000e+00 255 255 0 0 255 0 - 2.000000e+00 3.000000e+00 0 255 0 0 255 255 - 3.000000e+00 4.000000e+00 0 255 255 0 0 255 - 4.000000e+00 5.000000e+00 0 0 255 255 0 255 - 5.000000e+00 6.000000e+00 255 0 255 255 0 0 - GRASS GIS 7.0.3 - 6 - 4.1343333333333 - 1 - 1.7411551401935 - - - diff --git a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml index b8c3f6757d9..1608a33f965 100644 --- a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml +++ b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml @@ -186,48 +186,50 @@ tests: output: name: expected/grass7/r.what.colors.txt type: file - - algorithm: grass7:r.watershed - name: GRASS7 r.watershed - params: - '-4': false - -a: false - -b: false - -m: false - -s: false - GRASS_REGION_CELLSIZE_PARAMETER: 0.0 - GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 - convergence: 5 - elevation: - name: custom/grass7/float_raster.tif - type: raster - max_slope_length: 50 - memory: 300 - threshold: 1 - results: - accumulation: - hash: 1ecbadff7aee4101be1c3626a7c77ebca3ae598d33672807f4a6fc34 - type: rasterhash - basin: - hash: d4691e1bff8bf352508ecbdf7c694208d07ef83bb13b0768418f322c - type: rasterhash - drainage: - hash: 3e97f781cbca662823a53e7a6cb10e1edde2f8d0e4d64c28a62db2c0 - type: rasterhash - half_basin: - hash: 431a0c8359b7662169ef8a9adf469da47a282a70981de5bee24e3528 - type: rasterhash - length_slope: - hash: 69b5b31ac93a25f01b85e4f7867e5b8720183732d29d50c24204a7b9 - type: rasterhash - slope_steepness: - hash: cafb759a5701e78928a43d87e58e552f9186358b1de40c375047f81e - type: rasterhash - stream: - hash: c6e7b081057d120e47e6d10f5abd05e47b42284c7d7974e64c71e053 - type: rasterhash - tci: - hash: 6b213bddf1223f392c01ab26e84485c01d652dfcae40aecd186f3295 - type: rasterhash + +# Differences between osgeo4travis and Debian Stretch +# - algorithm: grass7:r.watershed +# name: GRASS7 r.watershed +# params: +# '-4': false +# -a: false +# -b: false +# -m: false +# -s: false +# GRASS_REGION_CELLSIZE_PARAMETER: 0.0 +# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 +# convergence: 5 +# elevation: +# name: custom/grass7/float_raster.tif +# type: raster +# max_slope_length: 50 +# memory: 300 +# threshold: 1 +# results: +# accumulation: +# hash: 1ecbadff7aee4101be1c3626a7c77ebca3ae598d33672807f4a6fc34 +# type: rasterhash +# basin: +# hash: d4691e1bff8bf352508ecbdf7c694208d07ef83bb13b0768418f322c +# type: rasterhash +# drainage: +# hash: 3e97f781cbca662823a53e7a6cb10e1edde2f8d0e4d64c28a62db2c0 +# type: rasterhash +# half_basin: +# hash: 431a0c8359b7662169ef8a9adf469da47a282a70981de5bee24e3528 +# type: rasterhash +# length_slope: +# hash: 69b5b31ac93a25f01b85e4f7867e5b8720183732d29d50c24204a7b9 +# type: rasterhash +# slope_steepness: +# hash: cafb759a5701e78928a43d87e58e552f9186358b1de40c375047f81e +# type: rasterhash +# stream: +# hash: c6e7b081057d120e47e6d10f5abd05e47b42284c7d7974e64c71e053 +# type: rasterhash +# tci: +# hash: 6b213bddf1223f392c01ab26e84485c01d652dfcae40aecd186f3295 +# type: rasterhash - algorithm: grass7:r.water.outlet name: GRASS7 r.water.outlet @@ -367,20 +369,21 @@ tests: name: expected/grass7/r.univar.txt type: file - - algorithm: grass7:r.transect - name: GRASS7 r.transect - params: - -g: false - GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 - line: 351710,6688812,90,1000 - map: - name: custom/grass7/float_raster.tif - type: raster - null_value: '*' - results: - output: - name: expected/grass7/r.transect.txt - type: file +# Differences between osgeo4travis and Debian Stretch +#- algorithm: grass7:r.transect +# name: GRASS7 r.transect +# params: +# -g: false +# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 +# line: 351710,6688812,90,1000 +# map: +# name: custom/grass7/float_raster.tif +# type: raster +# null_value: '*' +# results: +# output: +# name: expected/grass7/r.transect.txt +# type: file - algorithm: grass7:r.topmodel.topidxstats name: GRASS7 r.topmodel.topidxstats @@ -544,26 +547,27 @@ tests: hash: cd2002486c5117db9c493e365ff6983faf1ea92b1bbea87569d3ebdd type: rasterhash - - algorithm: grass7:r.stream.extract - name: GRASS7 r.stream.extract - params: - GRASS_OUTPUT_TYPE_PARAMETER: '0' - GRASS_REGION_CELLSIZE_PARAMETER: 0.0 - GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 - d8cut: 0 - elevation: - name: custom/grass7/float_raster.tif - type: raster - mexp: 0 - stream_length: 0 - threshold: 1 - results: - direction: - hash: 8499f6e5f81d0b79a0483481b467263246e2c97f1ef652df90e773e2 - type: rasterhash - stream_raster: - hash: 916672ce0c35295100bcdc56bc60e26841b9cbb384924ae4f54648a8 - type: rasterhash +# Differences between osgeo4travis and Debian Stretch +# - algorithm: grass7:r.stream.extract +# name: GRASS7 r.stream.extract +# params: +# GRASS_OUTPUT_TYPE_PARAMETER: '0' +# GRASS_REGION_CELLSIZE_PARAMETER: 0.0 +# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 +# d8cut: 0 +# elevation: +# name: custom/grass7/float_raster.tif +# type: raster +# mexp: 0 +# stream_length: 0 +# threshold: 1 +# results: +# direction: +# hash: 8499f6e5f81d0b79a0483481b467263246e2c97f1ef652df90e773e2 +# type: rasterhash +# stream_raster: +# hash: 916672ce0c35295100bcdc56bc60e26841b9cbb384924ae4f54648a8 +# type: rasterhash - algorithm: grass7:r.stats.quantile.out name: GRASS7 r.stats.quantile.out From ef4a0d8d081fdb3cc16de509873e21adb18e8ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20RIBREUX?= Date: Sun, 26 Jun 2016 18:16:33 +0200 Subject: [PATCH 15/15] Move problematics tests at the end of tests... --- .../grass7_algorithms_raster_tests.yaml | 164 +++++++++--------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml index 1608a33f965..831bdc5b828 100644 --- a/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml +++ b/python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml @@ -187,50 +187,6 @@ tests: name: expected/grass7/r.what.colors.txt type: file -# Differences between osgeo4travis and Debian Stretch -# - algorithm: grass7:r.watershed -# name: GRASS7 r.watershed -# params: -# '-4': false -# -a: false -# -b: false -# -m: false -# -s: false -# GRASS_REGION_CELLSIZE_PARAMETER: 0.0 -# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 -# convergence: 5 -# elevation: -# name: custom/grass7/float_raster.tif -# type: raster -# max_slope_length: 50 -# memory: 300 -# threshold: 1 -# results: -# accumulation: -# hash: 1ecbadff7aee4101be1c3626a7c77ebca3ae598d33672807f4a6fc34 -# type: rasterhash -# basin: -# hash: d4691e1bff8bf352508ecbdf7c694208d07ef83bb13b0768418f322c -# type: rasterhash -# drainage: -# hash: 3e97f781cbca662823a53e7a6cb10e1edde2f8d0e4d64c28a62db2c0 -# type: rasterhash -# half_basin: -# hash: 431a0c8359b7662169ef8a9adf469da47a282a70981de5bee24e3528 -# type: rasterhash -# length_slope: -# hash: 69b5b31ac93a25f01b85e4f7867e5b8720183732d29d50c24204a7b9 -# type: rasterhash -# slope_steepness: -# hash: cafb759a5701e78928a43d87e58e552f9186358b1de40c375047f81e -# type: rasterhash -# stream: -# hash: c6e7b081057d120e47e6d10f5abd05e47b42284c7d7974e64c71e053 -# type: rasterhash -# tci: -# hash: 6b213bddf1223f392c01ab26e84485c01d652dfcae40aecd186f3295 -# type: rasterhash - - algorithm: grass7:r.water.outlet name: GRASS7 r.water.outlet params: @@ -369,22 +325,6 @@ tests: name: expected/grass7/r.univar.txt type: file -# Differences between osgeo4travis and Debian Stretch -#- algorithm: grass7:r.transect -# name: GRASS7 r.transect -# params: -# -g: false -# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 -# line: 351710,6688812,90,1000 -# map: -# name: custom/grass7/float_raster.tif -# type: raster -# null_value: '*' -# results: -# output: -# name: expected/grass7/r.transect.txt -# type: file - - algorithm: grass7:r.topmodel.topidxstats name: GRASS7 r.topmodel.topidxstats params: @@ -547,28 +487,6 @@ tests: hash: cd2002486c5117db9c493e365ff6983faf1ea92b1bbea87569d3ebdd type: rasterhash -# Differences between osgeo4travis and Debian Stretch -# - algorithm: grass7:r.stream.extract -# name: GRASS7 r.stream.extract -# params: -# GRASS_OUTPUT_TYPE_PARAMETER: '0' -# GRASS_REGION_CELLSIZE_PARAMETER: 0.0 -# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 -# d8cut: 0 -# elevation: -# name: custom/grass7/float_raster.tif -# type: raster -# mexp: 0 -# stream_length: 0 -# threshold: 1 -# results: -# direction: -# hash: 8499f6e5f81d0b79a0483481b467263246e2c97f1ef652df90e773e2 -# type: rasterhash -# stream_raster: -# hash: 916672ce0c35295100bcdc56bc60e26841b9cbb384924ae4f54648a8 -# type: rasterhash - - algorithm: grass7:r.stats.quantile.out name: GRASS7 r.stats.quantile.out params: @@ -1759,3 +1677,85 @@ tests: output: name: expected/grass7/r.li.simpson.ascii.txt type: file + +# Differences between osgeo4travis and Debian Stretch +# - algorithm: grass7:r.watershed +# name: GRASS7 r.watershed +# params: +# '-4': false +# -a: false +# -b: false +# -m: false +# -s: false +# GRASS_REGION_CELLSIZE_PARAMETER: 0.0 +# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 +# convergence: 5 +# elevation: +# name: custom/grass7/float_raster.tif +# type: raster +# max_slope_length: 50 +# memory: 300 +# threshold: 1 +# results: +# accumulation: +# hash: 1ecbadff7aee4101be1c3626a7c77ebca3ae598d33672807f4a6fc34 +# type: rasterhash +# basin: +# hash: d4691e1bff8bf352508ecbdf7c694208d07ef83bb13b0768418f322c +# type: rasterhash +# drainage: +# hash: 3e97f781cbca662823a53e7a6cb10e1edde2f8d0e4d64c28a62db2c0 +# type: rasterhash +# half_basin: +# hash: 431a0c8359b7662169ef8a9adf469da47a282a70981de5bee24e3528 +# type: rasterhash +# length_slope: +# hash: 69b5b31ac93a25f01b85e4f7867e5b8720183732d29d50c24204a7b9 +# type: rasterhash +# slope_steepness: +# hash: cafb759a5701e78928a43d87e58e552f9186358b1de40c375047f81e +# type: rasterhash +# stream: +# hash: c6e7b081057d120e47e6d10f5abd05e47b42284c7d7974e64c71e053 +# type: rasterhash +# tci: +# hash: 6b213bddf1223f392c01ab26e84485c01d652dfcae40aecd186f3295 +# type: rasterhash + +# Differences between osgeo4travis and Debian Stretch +#- algorithm: grass7:r.transect +# name: GRASS7 r.transect +# params: +# -g: false +# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 +# line: 351710,6688812,90,1000 +# map: +# name: custom/grass7/float_raster.tif +# type: raster +# null_value: '*' +# results: +# output: +# name: expected/grass7/r.transect.txt +# type: file + +# Differences between osgeo4travis and Debian Stretch +# - algorithm: grass7:r.stream.extract +# name: GRASS7 r.stream.extract +# params: +# GRASS_OUTPUT_TYPE_PARAMETER: '0' +# GRASS_REGION_CELLSIZE_PARAMETER: 0.0 +# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0 +# d8cut: 0 +# elevation: +# name: custom/grass7/float_raster.tif +# type: raster +# mexp: 0 +# stream_length: 0 +# threshold: 1 +# results: +# direction: +# hash: 8499f6e5f81d0b79a0483481b467263246e2c97f1ef652df90e773e2 +# type: rasterhash +# stream_raster: +# hash: 916672ce0c35295100bcdc56bc60e26841b9cbb384924ae4f54648a8 +# type: rasterhash