Bläddra i källkod

Small fixes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51794 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 13 år sedan
förälder
incheckning
38732df84e

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

@@ -25,6 +25,9 @@ import grass.script.core as core
 import copy
 from dateutil import parser
 
+DAY_IN_SECONDS = 86400
+SECOND_AS_DAY  = 1.1574074074074073e-05
+
 ###############################################################################
 
 def relative_time_to_time_delta(value):
@@ -34,7 +37,7 @@ def relative_time_to_time_delta(value):
 
     days = int(value)
     seconds = value % 1
-    seconds = round(seconds * 86400)
+    seconds = round(seconds * DAY_IN_SECONDS)
 
     return timedelta(days, seconds)
 
@@ -45,7 +48,7 @@ def time_delta_to_relative_time(delta):
        double value, representing days.
     """
 
-    return float(delta.days) + float(delta.seconds/86400.0)
+    return float(delta.days) + float(delta.seconds * SECOND_AS_DAY)
 
 ###############################################################################
 

+ 5 - 0
temporal/run_all_tests.sh

@@ -2,6 +2,11 @@
 # This scripts runs all tests available in the temporal module directory
 # Logs a written to "run.log" 
 
+if [ -z "$GISBASE" ] ; then
+    echo "You must be in GRASS GIS to run this program." 1>&2
+    exit 1
+fi
+
 LOG_FILE="/tmp/run.log"
 echo "Logfile\n\n" > $LOG_FILE
 

+ 2 - 2
temporal/t.register/test.t.register.raster.sh

@@ -1,8 +1,8 @@
 #!/bin/sh
 # This is a test to register and unregister raster maps in
-# space time raster input.
+# space time raster datasets.
 # The raster maps will be registered in different space time raster
-# inputs
+# datasets.
 
 # We need to set a specific region in the
 # @preprocess step of this test. We generate