Forráskód Böngészése

update g.list/g.remove calls to use new element names (https://trac.osgeo.org/grass/ticket/2409)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63652 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 éve
szülő
commit
5237f1c8c0

+ 4 - 4
general/g.list/testsuite/test_g_list.py

@@ -20,7 +20,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_pt_flags(self):
         """Test that -p and -t flags are exclusive"""
-        module = SimpleModule('g.list', flags='pt', type='rast')
+        module = SimpleModule('g.list', flags='pt', type='raster')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-p', stderr)
@@ -28,7 +28,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_ft_flags(self):
         """Test that -f and -t flags are exclusive"""
-        module = SimpleModule('g.list', flags='ft', type='rast')
+        module = SimpleModule('g.list', flags='ft', type='raster')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-f', stderr)
@@ -36,7 +36,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_pf_flags(self):
         """Test that -p and -f flags are exclusive"""
-        module = SimpleModule('g.list', flags='pf', type='rast')
+        module = SimpleModule('g.list', flags='pf', type='raster')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-p', stderr)
@@ -44,7 +44,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_re_flags(self):
         """Test that -r and -e flags are exclusive"""
-        module = SimpleModule('g.list', flags='re', type='rast')
+        module = SimpleModule('g.list', flags='re', type='raster')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-r', stderr)

+ 1 - 1
lib/python/pygrass/modules/shortcuts.py

@@ -20,7 +20,7 @@ class MetaModule(object):
        'g.list'
        >>> g_list.required
        ['type']
-       >>> g_list.inputs.type = 'rast'
+       >>> g_list.inputs.type = 'raster'
        >>> g_list.stdout_ = -1
        >>> g_list.run()
        Module('g.list')

+ 1 - 1
lib/python/pygrass/raster/testsuite/test_raster.py

@@ -21,7 +21,7 @@ class RasterRowTestCate(TestCase):
     def tearDownClass(cls):
         """Remove the generated vector map, if exist"""
         from grass.pygrass.modules.shortcuts import general as g
-        g.remove(type='rast', name=cls.tmp, flags='f')
+        g.remove(type='raster', name=cls.tmp, flags='f')
 
     def test_type(self):
         r = RasterRow(self.name)

+ 1 - 1
lib/python/pygrass/vector/testsuite/test_vector3d.py

@@ -61,7 +61,7 @@ class VectorTopo3DTestCase(TestCase):
         """Remove the generated vector map, if exist"""
         mset = get_mapset_vector(cls.tmpname, mapset='')
         if mset:
-            run_command("g.remove", flags='f', type='vect', name=cls.tmpname)
+            run_command("g.remove", flags='f', type='vector', name=cls.tmpname)
 
 
 if __name__ == '__main__':

+ 1 - 1
lib/python/script/raster.py

@@ -122,7 +122,7 @@ def mapcalc_start(exp, quiet=False, verbose=False, overwrite=False,
     0
     >>> p2.wait()
     1
-    >>> run_command('g.remove', flags='f', type='rast', name=output)
+    >>> run_command('g.remove', flags='f', type='raster', name=output)
 
     :param str exp: expression
     :param bool quiet: True to run quietly (<tt>--q</tt>)

+ 3 - 3
raster/r.category/test_rcategory_doctest.txt

@@ -231,9 +231,9 @@ This is useful when test is runned in location which is not deleted
 when test finishes. It could test if everything which was expected
 to be created was created if it would check all outputs properly.
 
->>> run_command('g.remove', flags='f', type='rast', name='test')
+>>> run_command('g.remove', flags='f', type='raster', name='test')
 0
->>> run_command('g.remove', flags='f', type='rast', name='test_14')
+>>> run_command('g.remove', flags='f', type='raster', name='test_14')
 0
->>> run_command('g.remove', flags='f', type='rast', name='test_d')
+>>> run_command('g.remove', flags='f', type='raster', name='test_d')
 0

+ 2 - 2
raster/r.gwflow/testsuite/validation_7x7_grid.py

@@ -40,13 +40,13 @@ class Validation7x7Grid(TestCase):
         #First compute the groundwater flow after 500 seconds to have initial conditions
         self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="phead",\
          status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",\
-         recharge="recharge", output="gwresult_conf", dt=500, type="confined", budget="water_budget",  overwrite=True)
+         recharge="recharge", output="gwresult_conf", dtime=500, type="confined", budget="water_budget",  overwrite=True)
 
         # loop over the timesteps each 500 seconds
         for i in range(20):
             self.assertModule("r.gwflow",  flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="gwresult_conf",\
              status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",\
-             recharge="recharge", output="gwresult_conf", dt=500, type="confined", budget="water_budget",  overwrite=True)
+             recharge="recharge", output="gwresult_conf", dtime=500, type="confined", budget="water_budget",  overwrite=True)
 
         # Output of r.univar
         univar_string="""n=49

+ 1 - 1
raster/r.gwflow/testsuite/validation_excavation.py

@@ -45,7 +45,7 @@ class ValidationExcavation(TestCase):
         #compute a steady state groundwater flow
         self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top", bottom="bottom", phead="phead", \
             status="status", hc_x="hydcond", hc_y="hydcond", s="poros", \
-            recharge="recharge", output="gwresult", dt=864000000000, type="unconfined", budget="water_budget")
+            recharge="recharge", output="gwresult", dtime=864000000000, type="unconfined", budget="water_budget")
         
         # Output of r.univar -g
         univar_string="""n=760

+ 1 - 1
raster/r.in.poly/testsuite/test_rinpoly.py

@@ -42,7 +42,7 @@ class TestRInPoly(grass.gunittest.TestCase):
 
     def tearDown(self):
         """Remove rinpoly map after each test method"""
-        self.runModule('g.remove', flags='f', type='rast',
+        self.runModule('g.remove', flags='f', type='raster',
                        name=self.rinpoly)
         os.unlink(self.tmpFile.name)
 

+ 1 - 1
raster/r.mapcalc/testsuite/test_r3_mapcalc.py

@@ -21,7 +21,7 @@ class TestBasicOperations(grass.gunittest.TestCase):
     def tearDownClass(cls):
         cls.del_temp_region()
         if cls.to_remove:
-            cls.runModule('g.remove', flags='f', type='rast3d',
+            cls.runModule('g.remove', flags='f', type='raster_3d',
                 name=','.join(cls.to_remove), verbose=True)
 
     def test_difference_of_the_same_map_double(self):

+ 2 - 2
raster/r.mapcalc/testsuite/test_r_mapcalc.py

@@ -73,7 +73,7 @@ class TestRandFunction(grass.gunittest.TestCase):
     def tearDownClass(cls):
         cls.del_temp_region()
         if cls.to_remove:
-            cls.runModule('g.remove', flags='f', type='rast',
+            cls.runModule('g.remove', flags='f', type='raster',
                 name=','.join(cls.to_remove))
 
     def rinfo_contains_number(self, raster, number):
@@ -178,7 +178,7 @@ class TestBasicOperations(grass.gunittest.TestCase):
     def tearDownClass(cls):
         cls.del_temp_region()
         if cls.to_remove:
-            cls.runModule('g.remove', flags='f', type='rast',
+            cls.runModule('g.remove', flags='f', type='raster',
                 name=','.join(cls.to_remove), verbose=True)
 
     def test_difference_of_the_same_map_double(self):

+ 1 - 1
raster/r.recode/testsuite/test_rrecode_ncspm.py

@@ -45,7 +45,7 @@ class TestNCMaps(TestCase):
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()
-        cls.runModule('g.remove', type='rast', name=['random01', 'recoded'], flags='f')
+        cls.runModule('g.remove', type='raster', name=['random01', 'recoded'], flags='f')
 
     def test_formats_elevation(self):
         recode = SimpleModule('r.recode', input='elevation@PERMANENT', output='recoded',

+ 1 - 1
raster/r.slope.aspect/testsuite/test_r_slope_aspect.py

@@ -68,7 +68,7 @@ class TestSlopeAspectAgainstReference(grass.gunittest.TestCase):
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()
-        cls.runModule('g.remove', flags='f', type='rast', name=cls.elevation)
+        cls.runModule('g.remove', flags='f', type='raster', name=cls.elevation)
 
     def test_slope(self):
         ref_slope = 'reference_slope'

+ 1 - 1
raster3d/r3.flow/testsuite/r3flow_test.py

@@ -86,7 +86,7 @@ class FlowlineTest(TestCase):
                           direction='down')
         self.runModule('v.out.ascii', input='test_flowline',
                        format='standard', output='./data/flowline_tmp.ascii',
-                       dp=6)
+                       precision=6)
         self.assertVectorAsciiEqualsVectorAscii(actual='./data/flowline_tmp.ascii',
                                                 reference='./data/flowline.ascii')
         self.assertRaster3dFitsUnivar('test_flowaccum', reference=flowaccum, precision=1e-6)

+ 2 - 2
raster3d/r3.gradient/testsuite/r3gradient_test.py

@@ -137,7 +137,7 @@ class GradientTest(TestCase):
 
     def test_gradient_block(self):
         self.runModule('g.region', res3=10, n=100, s=0, w=0, e=120, b=0, t=50)
-        self.assertModule('r3.gradient', input='test_map_1_ref', block_size=[200, 2, 50],
+        self.assertModule('r3.gradient', input='test_map_1_ref', blocksize=[200, 2, 50],
                           output=['test_grad_x', 'test_grad_y', 'test_grad_z'], overwrite=True)
         self.assertRaster3dFitsUnivar(raster='test_grad_x', reference=r3univar_test_grad_x, precision=1e-8)
         self.assertRaster3dFitsUnivar(raster='test_grad_y', reference=r3univar_test_grad_y, precision=1e-8)
@@ -145,7 +145,7 @@ class GradientTest(TestCase):
 
     def test_gradient_nulls(self):
         self.runModule('g.region', res3=1, n=5, s=0, w=0, e=5, b=0, t=5)
-        self.assertModule('r3.gradient', input='test_map_2_ref', block_size=[200, 2, 50],
+        self.assertModule('r3.gradient', input='test_map_2_ref', blocksize=[200, 2, 50],
                           output=['test_null_grad_x', 'test_null_grad_y', 'test_null_grad_z'])
         self.assertRaster3dFitsUnivar(raster='test_null_grad_x',
                                       reference=r3univar_test_nulls_grad_x, precision=1e-8)

+ 1 - 1
scripts/r3.in.xyz/r3.in.xyz.py

@@ -307,7 +307,7 @@ def main():
     grass.verbose(_("Assembling 3D cube ..."))
 
     #input order: lower most strata first
-    slices = grass.read_command('g.list', type='rast', sep=',',
+    slices = grass.read_command('g.list', type='raster', sep=',',
                                 pattern='tmp.r3xyz.%d.*' % os.getpid()).rstrip(os.linesep)
     grass.debug(slices)
 

+ 3 - 3
vector/v.what/testsuite/test_vwhat_layers.py

@@ -119,14 +119,14 @@ class TestMultiLayerMap(TestCase):
         cls.runModule('v.in.ascii', input='./data/testing.ascii', output='test_vector',
                       format='standard')
         cls.runModule('db.connect', flags='c')
-        cls.runModule('db.in.ogr', dsn='./data/table1.csv', output='t1')
-        cls.runModule('db.in.ogr', dsn='./data/table2.csv', output='t2')
+        cls.runModule('db.in.ogr', input='./data/table1.csv', output='t1')
+        cls.runModule('db.in.ogr', input='./data/table2.csv', output='t2')
         cls.runModule('v.db.connect', map='test_vector', table='t1', key='cat_', layer=1)
         cls.runModule('v.db.connect', map='test_vector', table='t2', key='cat_', layer=2)
 
     @classmethod
     def tearDownClass(cls):
-        cls.runModule('g.remove', type='vect', name='test_vector', flags='f')
+        cls.runModule('g.remove', type='vector', name='test_vector', flags='f')
 
     def setUp(self):
         self.vwhat = SimpleModule('v.what', map='test_vector',