|
@@ -479,8 +479,6 @@ from .datetime_math import create_numeric_suffix
|
|
|
if sys.version_info[0] >= 3:
|
|
|
unicode = str
|
|
|
|
|
|
-##############################################################################
|
|
|
-
|
|
|
|
|
|
class TemporalAlgebraLexer(object):
|
|
|
"""Lexical analyzer for the GRASS GIS temporal algebra"""
|
|
@@ -706,9 +704,6 @@ class TemporalAlgebraLexer(object):
|
|
|
print(tok)
|
|
|
|
|
|
|
|
|
-###############################################################################
|
|
|
-
|
|
|
-
|
|
|
class GlobalTemporalVar(object):
|
|
|
"""This class handles global temporal variable conditional expressions,
|
|
|
like start_doy() == 3.
|
|
@@ -760,9 +755,6 @@ class GlobalTemporalVar(object):
|
|
|
return str(self.tfunc) + str(self.compop) + str(self.value)
|
|
|
|
|
|
|
|
|
-###############################################################################
|
|
|
-
|
|
|
-
|
|
|
class FatalError(Exception):
|
|
|
def __init__(self, msg):
|
|
|
self.value = msg
|
|
@@ -771,9 +763,6 @@ class FatalError(Exception):
|
|
|
return self.value
|
|
|
|
|
|
|
|
|
-###############################################################################
|
|
|
-
|
|
|
-
|
|
|
class TemporalAlgebraParser(object):
|
|
|
"""The temporal algebra class"""
|
|
|
|
|
@@ -1186,14 +1175,11 @@ class TemporalAlgebraParser(object):
|
|
|
# Append map to result map list.
|
|
|
# if returncode == 1:
|
|
|
# resultlist.append(map_new)
|
|
|
- # Get sorted map objects as values from result dictionoary.
|
|
|
+ # Get sorted map objects as values from result dictionary.
|
|
|
resultlist = resultdict.values()
|
|
|
resultlist = sorted(resultlist, key=AbstractDatasetComparisonKeyStartTime)
|
|
|
-
|
|
|
return resultlist
|
|
|
|
|
|
- ######################### Temporal functions ##############################
|
|
|
-
|
|
|
def remove_maps(self):
|
|
|
"""Removes empty or intermediate maps of different type."""
|
|
|
|
|
@@ -2331,8 +2317,6 @@ class TemporalAlgebraParser(object):
|
|
|
else:
|
|
|
return resultlist
|
|
|
|
|
|
- ###########################################################################
|
|
|
-
|
|
|
def p_statement_assign(self, t):
|
|
|
# The expression should always return a list of maps
|
|
|
# This function starts all the work and is the last one that is called from the parser
|
|
@@ -3352,8 +3336,6 @@ class TemporalAlgebraParser(object):
|
|
|
raise SyntaxError("Unexpected syntax error")
|
|
|
|
|
|
|
|
|
-###############################################################################
|
|
|
-
|
|
|
if __name__ == "__main__":
|
|
|
import doctest
|
|
|
|