Преглед на файлове

temporal framework: replace '.' with '_'

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67939 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi преди 9 години
родител
ревизия
9252b19cc8

+ 2 - 2
lib/python/temporal/datetime_math.py

@@ -868,10 +868,10 @@ def create_time_suffix(mapp, end=False):
        :param end: True if you want add also end time to the suffix    
     """
     start = mapp.temporal_extent.get_start_time()
-    sstring = start.isoformat().replace(':', '.').replace('-', '_')
+    sstring = start.isoformat().replace(':', '_').replace('-', '_')
     if end:
         end = mapp.temporal_extent.get_end_time()
-        estring = end.isoformat().replace(':', '.').replace('-', '_')
+        estring = end.isoformat().replace(':', '_').replace('-', '_')
         return "{st}_{en}".format(st=sstring, en=estring)
     return sstring
 

+ 1 - 1
temporal/t.rast.accdetect/testsuite/test_simple.py

@@ -81,7 +81,7 @@ class TestRasterExtraction(TestCase):
                           start="2001-01-01", cycle="12 months", suffix='time',
                           basename='b_occu', range=(1,8))
         self.assertRasterDoesNotExist('b_occu_2001_01')
-        self.assertRasterExists('b_occu_2001_01_01T00.00.00')
+        self.assertRasterExists('b_occu_2001_01_01T00_00_00')
 
     def test_num_suffix(self):
         self.assertModule('t.rast.accdetect', input='A', occurrence='B',

+ 8 - 0
temporal/t.rast.accumulate/testsuite/test_accumulation.py

@@ -227,6 +227,14 @@ class TestAccumulate(TestCase):
         self.assertRasterExists('b_001')
         self.assertRasterDoesNotExist('b_2001_01_07')
 
+    def test_time_suffix(self):
+        self.assertModule("t.rast.accumulate",  input="A", output="B",
+                          limits=[0,40], method="gdd",
+                          start="2001-01-01", cycle="7 days",
+                          basename="b", stop="2001-01-05", suffix="time",
+                          overwrite=True,  verbose=True)
+        self.assertRasterExists('b_2001_01_01T00_00_00')
+
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()

+ 14 - 2
temporal/t.rast.contour/testsuite/test_convert.py

@@ -175,7 +175,7 @@ class TestRasterContour(TestCase):
         self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=")
 
 
-    def test_time_num(self):
+    def test_suffix_num(self):
         """Test the -s flag"""
         self.assertModule("t.rast.contour", input="A", output="result",
                           step=1, minlevel=1, maxlevel=8,
@@ -183,7 +183,19 @@ class TestRasterContour(TestCase):
                           where="start_time > '2001-02-01'",
                           nprocs=1, overwrite=True, verbose=True)
 
-        self.assertVectorExists('time_004')
+        self.assertVectorExists('time_001')
+        self.assertVectorDoesNotExist('time_00005')
+        self.assertVectorDoesNotExist('time_2001_07')
+
+    def test_suffix_time(self):
+        """Test the -s flag"""
+        self.assertModule("t.rast.contour", input="A", output="result",
+                          step=1, minlevel=1, maxlevel=8,
+                          basename="time", suffix='time',
+                          where="start_time > '2001-02-01'",
+                          nprocs=1, overwrite=True, verbose=True)
+
+        self.assertVectorExists('time_2001_07_01T00_00_00')
         self.assertVectorDoesNotExist('time_00005')
         self.assertVectorDoesNotExist('time_2001_07')