[GRASS-SVN] r63297 - in grass/trunk/lib: gpde/test python/gunittest python/gunittest/testsuite python/pygrass/gis python/script python/temporal python/temporal/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 30 01:28:42 PST 2014


Author: neteler
Date: 2014-11-30 01:28:41 -0800 (Sun, 30 Nov 2014)
New Revision: 63297

Modified:
   grass/trunk/lib/gpde/test/test_arrays.c
   grass/trunk/lib/python/gunittest/case.py
   grass/trunk/lib/python/gunittest/testsuite/test_assertions_rast3d.py
   grass/trunk/lib/python/pygrass/gis/__init__.py
   grass/trunk/lib/python/script/core.py
   grass/trunk/lib/python/script/raster3d.py
   grass/trunk/lib/python/temporal/abstract_map_dataset.py
   grass/trunk/lib/python/temporal/extract.py
   grass/trunk/lib/python/temporal/factory.py
   grass/trunk/lib/python/temporal/list_stds.py
   grass/trunk/lib/python/temporal/mapcalc.py
   grass/trunk/lib/python/temporal/open_stds.py
   grass/trunk/lib/python/temporal/register.py
   grass/trunk/lib/python/temporal/space_time_datasets.py
   grass/trunk/lib/python/temporal/temporal_algebra.py
   grass/trunk/lib/python/temporal/temporal_raster3d_algebra.py
   grass/trunk/lib/python/temporal/testsuite/unittests_temporal_raster3d_algebra.py
Log:
fix rast3d -> 3draster

Modified: grass/trunk/lib/gpde/test/test_arrays.c
===================================================================
--- grass/trunk/lib/gpde/test/test_arrays.c	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/gpde/test/test_arrays.c	2014-11-30 09:28:41 UTC (rev 63297)
@@ -857,7 +857,7 @@
     N_free_array_3d(tmp);
 
     sprintf(buff,
-	    "g.remove -f type=rast3d name=gpde_lib_test_volume_1,gpde_lib_test_volume_2");
+	    "g.remove -f type=3draster name=gpde_lib_test_volume_1,gpde_lib_test_volume_2");
     system(buff);
 
     N_free_array_3d(data1);

Modified: grass/trunk/lib/python/gunittest/case.py
===================================================================
--- grass/trunk/lib/python/gunittest/case.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/gunittest/case.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -672,7 +672,7 @@
                                           sep='=', precision=precision,
                                           reference=statistics, msg=msg)
             finally:
-                call_module('g.remove', flags='f', type='rast3d', name=diff)
+                call_module('g.remove', flags='f', type='3draster', name=diff)
         else:
             # general case
             # TODO: we are using r.info min max and r.univar min max interchangably
@@ -698,7 +698,7 @@
             self.assertRaster3dFitsUnivar(raster=diff, reference=statistics,
                                           precision=precision, msg=msg)
         finally:
-            call_module('g.remove', flags='f', type='rast3d', name=diff)
+            call_module('g.remove', flags='f', type='3draster', name=diff)
 
     # TODO: this works only in 2D
     # TODO: write tests

Modified: grass/trunk/lib/python/gunittest/testsuite/test_assertions_rast3d.py
===================================================================
--- grass/trunk/lib/python/gunittest/testsuite/test_assertions_rast3d.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/gunittest/testsuite/test_assertions_rast3d.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -29,7 +29,7 @@
     def tearDownClass(cls):
         cls.del_temp_region()
         # TODO: input as list does not work, why?
-        cls.runModule('g.remove', flags='f', type='rast3d',
+        cls.runModule('g.remove', flags='f', type='3draster',
                       name=','.join([cls.constant_map, cls.rcd_increasing_map]))
 
     def test_assertRaster3dFitsUnivar(self):

Modified: grass/trunk/lib/python/pygrass/gis/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/__init__.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/pygrass/gis/__init__.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -16,7 +16,7 @@
 
 
 ETYPE = {'rast': libgis.G_ELEMENT_RASTER,
-         'rast3d': libgis.G_ELEMENT_RASTER3D,
+         '3draster': libgis.G_ELEMENT_RASTER3D,
          'vect': libgis.G_ELEMENT_VECTOR,
          'oldvect': libgis.G_ELEMENT_OLDVECTOR,
          'asciivect': libgis.G_ELEMENT_ASCIIVECTOR,
@@ -315,7 +315,7 @@
             * 'labels',
             * 'oldvect',
             * 'rast',
-            * 'rast3d',
+            * '3draster',
             * 'region',
             * 'region3d',
             * 'sites',

Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/script/core.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -1086,7 +1086,7 @@
     Returns the output from running g.list, as a list of qualified
     names.
 
-    :param str type: element type (rast, vect, rast3d, region, ...)
+    :param str type: element type (rast, vect, 3draster, region, ...)
     :param str pattern: pattern string
     :param str mapset: mapset name (if not given use search path)
     :param str exclude: pattern string to exclude maps from the research
@@ -1117,7 +1117,7 @@
     Returns the output from running g.list, as a list of
     (name, mapset) pairs
 
-    :param str type: element type (rast, vect, rast3d, region, ...)
+    :param str type: element type (rast, vect, 3draster, region, ...)
     :param str pattern: pattern string
     :param str mapset: mapset name (if not given use search path)
     :param str exclude: pattern string to exclude maps from the research
@@ -1142,7 +1142,7 @@
     >>> list_grouped('vect', pattern='*roads*')['PERMANENT']
     ['railroads', 'roadsmajor']
 
-    :param str type: element type (rast, vect, rast3d, region, ...) or list of elements
+    :param str type: element type (rast, vect, 3draster, region, ...) or list of elements
     :param str pattern: pattern string
     :param str check_search_path: True to add mapsets for the search path
                                   with no found elements

Modified: grass/trunk/lib/python/script/raster3d.py
===================================================================
--- grass/trunk/lib/python/script/raster3d.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/script/raster3d.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -33,7 +33,7 @@
     >>> mapcalc3d('volume = row() + col() + depth()')
     >>> raster3d_info('volume') # doctest: +ELLIPSIS
     {'vertical_units': '"units"', 'tbres': 1.0, ... 'south': 185000.0}
-    >>> run_command('g.remove', flags='f', type='rast3d', name='volume')
+    >>> run_command('g.remove', flags='f', type='3draster', name='volume')
     0
 
     :param str map: map name

Modified: grass/trunk/lib/python/temporal/abstract_map_dataset.py
===================================================================
--- grass/trunk/lib/python/temporal/abstract_map_dataset.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/abstract_map_dataset.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -46,7 +46,7 @@
     @abstractmethod
     def get_new_stds_instance(self, ident):
         """Return a new space time dataset instance that store maps with the
-           type of this map object (rast, rast3d or vect)
+           type of this map object (rast, 3draster or vect)
 
            :param ident The identifier of the space time dataset
            :return: The new space time dataset instance

Modified: grass/trunk/lib/python/temporal/extract.py
===================================================================
--- grass/trunk/lib/python/temporal/extract.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/extract.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -237,7 +237,7 @@
                 gscript.run_command("g.remove", flags='f', type='rast',
                                     name=names, quiet=True)
             elif type == "raster3d":
-                gscript.run_command("g.remove", flags='f', type='rast3d',
+                gscript.run_command("g.remove", flags='f', type='3draster',
                                     name=names, quiet=True)
             elif type == "vector":
                 gscript.run_command("g.remove", flags='f', type='vect',

Modified: grass/trunk/lib/python/temporal/factory.py
===================================================================
--- grass/trunk/lib/python/temporal/factory.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/factory.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -26,7 +26,7 @@
 def dataset_factory(type, id):
     """A factory functions to create space time or map datasets
 
-       :param type: the dataset type: rast or raster, rast3d,
+       :param type: the dataset type: rast or raster, 3draster,
                     vect or vector, strds, str3ds, stvds
        :param id: The id of the dataset ("name at mapset")
     """
@@ -38,7 +38,7 @@
         sp = SpaceTimeVectorDataset(id)
     elif type == "rast" or type == "raster":
         sp = RasterDataset(id)
-    elif type == "rast3d":
+    elif type == "3draster":
         sp = Raster3DDataset(id)
     elif type == "vect" or type == "vector":
         sp = VectorDataset(id)

Modified: grass/trunk/lib/python/temporal/list_stds.py
===================================================================
--- grass/trunk/lib/python/temporal/list_stds.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/list_stds.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -34,7 +34,7 @@
         the values are the rows from the SQL database query.
 
         :param type: The type of the datasets (strds, str3ds, stvds, rast,
-                     rast3d, vect)
+                     3draster, vect)
         :param temporal_type: The temporal type of the datasets (absolute,
                               relative)
         :param columns: A comma separated list of columns that will be selected

Modified: grass/trunk/lib/python/temporal/mapcalc.py
===================================================================
--- grass/trunk/lib/python/temporal/mapcalc.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/mapcalc.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -331,7 +331,7 @@
                 gscript.run_command("g.remove", flags='f', type='rast',
                                     name=names, quiet=True)
             elif type == "raster3d":
-                gscript.run_command("g.remove", flags='f', type='rast3d',
+                gscript.run_command("g.remove", flags='f', type='3draster',
                                     name=names, quiet=True)
 
     dbif.close()

Modified: grass/trunk/lib/python/temporal/open_stds.py
===================================================================
--- grass/trunk/lib/python/temporal/open_stds.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/open_stds.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -52,7 +52,7 @@
 
     if type == "strds" or type == "rast" or type == "raster":
         sp = dataset_factory("strds", id)
-    elif type == "str3ds" or type == "rast3d" or type == "3draster":
+    elif type == "str3ds" or type == "3draster" or type == "3draster":
         sp = dataset_factory("str3ds", id)
     elif type == "stvds" or type == "vect" or type == "vector":
         sp = dataset_factory("stvds", id)
@@ -108,7 +108,7 @@
 
     if type == "strds" or type == "rast" or type == "raster":
         sp = dataset_factory("strds", id)
-    elif type == "str3ds" or type == "rast3d" or type == "3draster":
+    elif type == "str3ds" or type == "3draster" or type == "3draster":
         sp = dataset_factory("str3ds", id)
     elif type == "stvds" or type == "vect" or type == "vector":
         sp = dataset_factory("stvds", id)

Modified: grass/trunk/lib/python/temporal/register.py
===================================================================
--- grass/trunk/lib/python/temporal/register.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/register.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -35,7 +35,7 @@
        It takes care of the correct update of the space time datasets from all
        registered maps.
 
-       :param type: The type of the maps rast, rast3d or vect
+       :param type: The type of the maps rast, 3draster or vect
        :param name: The name of the space time dataset. Maps will be
                     registered in the temporal database if the name was set
                     to None
@@ -327,7 +327,7 @@
         for dataset in datatsets_to_modify:
             if type == "rast" or type == "raster":
                 ds = dataset_factory("strds", dataset)
-            elif type == "rast3d":
+            elif type == "3draster":
                 ds = dataset_factory("str3ds", dataset)
             elif type == "vect" or type == "vector":
                 ds = dataset_factory("stvds", dataset)
@@ -434,7 +434,7 @@
     """Register a list of AbstractMapDataset objects in the temporal database
        and optional in a space time dataset.
 
-       :param type: The type of the map layer (rast, rast3d, vect)
+       :param type: The type of the map layer (rast, 3draster, vect)
        :param map_list: List of AbstractMapDataset objects
        :param output_stds: The output stds
        :param delete_empty: Set True to delete empty map layer found in the map_list

Modified: grass/trunk/lib/python/temporal/space_time_datasets.py
===================================================================
--- grass/trunk/lib/python/temporal/space_time_datasets.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/space_time_datasets.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -418,7 +418,7 @@
             True
             >>> r3map.is_time_relative()
             False
-            >>> grass.run_command("g.remove", flags="f", type="rast3d", name=name, quiet=True)
+            >>> grass.run_command("g.remove", flags="f", type="3draster", name=name, quiet=True)
             0
             >>> grass.del_temp_region()
 

Modified: grass/trunk/lib/python/temporal/temporal_algebra.py
===================================================================
--- grass/trunk/lib/python/temporal/temporal_algebra.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/temporal_algebra.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -1063,7 +1063,7 @@
         """Remove maps of specific type
         
             :param namelist: List of map names to be removed
-            :param map_type: The type of the maps  (rast, rast3d or vect)
+            :param map_type: The type of the maps  (rast, 3draster or vect)
         """
         max = 100
         chunklist = [namelist[i:i + max] for i in range(0, len(namelist), max)]
@@ -1074,7 +1074,7 @@
             if map_type == "raster":
                 map_type = "rast"
             if map_type == "raster3d":
-                map_type = "rast3d"
+                map_type = "3draster"
             if map_type == "vector":
                 map_type = "vect"
 
@@ -2073,7 +2073,7 @@
                                 process_queue.put(m)
                             elif map_i.get_type() == 'raster3d':
                                 m = copy.deepcopy(self.m_copy)
-                                m.inputs["rast3d"].value = map_i.get_id(),  newident
+                                m.inputs["3draster"].value = map_i.get_id(),  newident
                                 m.flags["overwrite"].value = self.overwrite
                                 process_queue.put(m)
                             elif map_i.get_type() == 'vector':

Modified: grass/trunk/lib/python/temporal/temporal_raster3d_algebra.py
===================================================================
--- grass/trunk/lib/python/temporal/temporal_raster3d_algebra.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/temporal_raster3d_algebra.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -45,7 +45,7 @@
         self.overwrite = overwrite
         self.count = 0
         self.stdstype = "str3ds"
-        self.maptype = "rast3d"
+        self.maptype = "3draster"
         self.mapclass = Raster3DDataset
         self.basename = basename
         self.expression = expression

Modified: grass/trunk/lib/python/temporal/testsuite/unittests_temporal_raster3d_algebra.py
===================================================================
--- grass/trunk/lib/python/temporal/testsuite/unittests_temporal_raster3d_algebra.py	2014-11-30 05:05:19 UTC (rev 63296)
+++ grass/trunk/lib/python/temporal/testsuite/unittests_temporal_raster3d_algebra.py	2014-11-30 09:28:41 UTC (rev 63297)
@@ -33,7 +33,7 @@
         tgis.open_new_stds(name="A", type="str3ds", temporaltype="absolute",
                                          title="A", descr="A", semantic="field", overwrite=True)
 
-        tgis.register_maps_in_space_time_dataset(type="rast3d", name="A", maps="a1,a2,a3,a4",
+        tgis.register_maps_in_space_time_dataset(type="3draster", name="A", maps="a1,a2,a3,a4",
                                                  start="2001-01-01", increment="1 day", interval=True)
 
     def tearDown(self):



More information about the grass-commit mailing list