Jelajahi Sumber

temporal framework: Sphinx documentation fixes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62710 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 10 tahun lalu
induk
melakukan
6b15d9e990

+ 5 - 2
lib/python/docs/src/temporal_framework.rst

@@ -119,8 +119,11 @@ the SQL object serialization, all classes that represent table entries, datetime
 Spatio-temporal algebra classes for space time raster and vector datasets are defined in:
 Spatio-temporal algebra classes for space time raster and vector datasets are defined in:
 
 
 - :mod:`~temporal.temporal_algebra`
 - :mod:`~temporal.temporal_algebra`
-- :mod:`~temporal.temporal_vector_algebra`
-- :mod:`~temporal.temporal_vector_operator`
+- :mod:`~temporal_operator`
+- :mod:`~temporal_raster_base_algebra`
+- :mod:`~temporal_raster_algebra`
+- :mod:`~temporal_raster3d_algebra`
+- :mod:`~temporal_vector_algebra`
 
 
 High level API
 High level API
 ^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^

+ 17 - 12
lib/python/temporal/temporal_algebra.py

@@ -1053,6 +1053,7 @@ class TemporalAlgebraParser(object):
                                compop = None, aggregate = None):
                                compop = None, aggregate = None):
         """Build temporal topology for two space time data sets, copy map objects
         """Build temporal topology for two space time data sets, copy map objects
           for given relation into map list.
           for given relation into map list.
+
           :param maplistA: List of maps.
           :param maplistA: List of maps.
           :param maplistB: List of maps.
           :param maplistB: List of maps.
           :param topolist: List of strings of temporal relations.
           :param topolist: List of strings of temporal relations.
@@ -1253,6 +1254,7 @@ class TemporalAlgebraParser(object):
     def assign_bool_value(self,  map_i, tbrelations, topolist = ["EQUAL"]):
     def assign_bool_value(self,  map_i, tbrelations, topolist = ["EQUAL"]):
         """ Function to assign boolean map value based on the map_values from the 
         """ Function to assign boolean map value based on the map_values from the 
                 compared map list by topological relationships.
                 compared map list by topological relationships.
+                
           :param map_i: Map object with temporal extent.
           :param map_i: Map object with temporal extent.
           :param tbrelations: List of temporal relation to map_i.
           :param tbrelations: List of temporal relation to map_i.
           :param topolist: List of strings for given temporal relations.
           :param topolist: List of strings for given temporal relations.
@@ -1283,6 +1285,7 @@ class TemporalAlgebraParser(object):
     def compare_bool_value(self,  map_i, tbrelations, compop, aggregate,  topolist = ["EQUAL"]):
     def compare_bool_value(self,  map_i, tbrelations, compop, aggregate,  topolist = ["EQUAL"]):
         """ Function to evaluate two map lists with boolean values by boolean 
         """ Function to evaluate two map lists with boolean values by boolean 
             comparison operator. 
             comparison operator. 
+            
           :param map_i: Map object with temporal extent.
           :param map_i: Map object with temporal extent.
           :param tbrelations: List of temporal relation to map_i.
           :param tbrelations: List of temporal relation to map_i.
           :param topolist: List of strings for given temporal relations.
           :param topolist: List of strings for given temporal relations.
@@ -1744,14 +1747,14 @@ class TemporalAlgebraParser(object):
              For example: td(A) == 1 && start_day() > 5 --> [True || False]
              For example: td(A) == 1 && start_day() > 5 --> [True || False]
                           (for one map.condition_value in a then map list)
                           (for one map.condition_value in a then map list)
 
 
-             :param tvarexpr List of GlobalTemporalVar objects and map lists.
+             :param tvarexpr: List of GlobalTemporalVar objects and map lists.
                          The list is constructed by the TemporalAlgebraParser
                          The list is constructed by the TemporalAlgebraParser
                          in order of expression evaluation in the parser.
                          in order of expression evaluation in the parser.
 
 
-             :param thenlist Map list object of the conclusion statement.
+             :param thenlist: Map list object of the conclusion statement.
                          It will be compared and evaluated by the conditions.
                          It will be compared and evaluated by the conditions.
           
           
-             :param topolist List of temporal relations between the conditions and the 
+             :param topolist: List of temporal relations between the conditions and the 
                          conclusions.
                          conclusions.
                           
                           
              :return: Map list with conditional values for all temporal expressions.
              :return: Map list with conditional values for all temporal expressions.
@@ -1813,15 +1816,17 @@ class TemporalAlgebraParser(object):
              A recursive function is used to evaluate comparison statements
              A recursive function is used to evaluate comparison statements
              from left to right in the given conditional list.
              from left to right in the given conditional list.
 
 
-            For example: [True,  '||', False, '&&', True]  -> True
-                          [True,  '||', False, '&&', False] -> False
-                          [True,  '&&', False, '&&', True]  -> False
-                          [False, '||', True,  '||', False] -> True
-                          [False, '&&', True,  '&&', True]  -> False
-                          [True,  '&&', True,  '&&', True]  -> True
-                          [True,  '&&', True]               -> True
-                          [True,  '&&', False]              -> False
-                          [False, '||', True]               -> True
+             For example: 
+            
+                  - [True,  '||', False, '&&', True]  -> True
+                  - [True,  '||', False, '&&', False] -> False
+                  - [True,  '&&', False, '&&', True]  -> False
+                  - [False, '||', True,  '||', False] -> True
+                  - [False, '&&', True,  '&&', True]  -> False
+                  - [True,  '&&', True,  '&&', True]  -> True
+                  - [True,  '&&', True]               -> True
+                  - [True,  '&&', False]              -> False
+                  - [False, '||', True]               -> True
 
 
              :param tvarexpr: List of GlobalTemporalVar objects and map lists.
              :param tvarexpr: List of GlobalTemporalVar objects and map lists.
                           The list is constructed by the TemporalAlgebraParser
                           The list is constructed by the TemporalAlgebraParser

+ 6 - 6
lib/python/temporal/temporal_operator.py

@@ -1,4 +1,4 @@
-"""!@package grass.temporal
+"""@package grass.temporal
 
 
 Temporal operator evaluation with PLY
 Temporal operator evaluation with PLY
 
 
@@ -7,9 +7,10 @@ This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
 for details.
 
 
-@author Thomas Leppelt and Soeren Gebbert
+:authors: Thomas Leppelt and Soeren Gebbert
+
+.. code-block:: python
 
 
-@code
     >>> p = TemporalOperatorParser()
     >>> p = TemporalOperatorParser()
     >>> expression =  "{equal| during}"
     >>> expression =  "{equal| during}"
     >>> p.parse(expression, optype = 'relation')
     >>> p.parse(expression, optype = 'relation')
@@ -100,8 +101,7 @@ for details.
     >>> p.parse(expression, optype = 'overlay')
     >>> p.parse(expression, optype = 'overlay')
     >>> print(p.relations, p.temporal, p.function)
     >>> print(p.relations, p.temporal, p.function)
     (['overlaps', 'overlapped'], 'r', '^')
     (['overlaps', 'overlapped'], 'r', '^')
-    
-@endcode
+
 """
 """
 
 
 try:
 try:
@@ -111,7 +111,7 @@ except:
     pass
     pass
 
 
 class TemporalOperatorLexer(object):
 class TemporalOperatorLexer(object):
-    """!Lexical analyzer for the GRASS GIS temporal operator"""
+    """Lexical analyzer for the GRASS GIS temporal operator"""
 
 
     # Functions that defines topological relations.
     # Functions that defines topological relations.
     relations = {
     relations = {

+ 21 - 19
lib/python/temporal/temporal_vector_algebra.py

@@ -161,24 +161,25 @@ class TemporalVectorAlgebraParser(TemporalAlgebraParser):
                                new = False,  convert = False,  overlay_cmd = False):
                                new = False,  convert = False,  overlay_cmd = False):
         """Build temporal topology for two space time data sets, copy map objects
         """Build temporal topology for two space time data sets, copy map objects
           for given relation into map list.
           for given relation into map list.
-          :param maplistA List of maps.
-          :param maplistB List of maps.
-          :param topolist List of strings of temporal relations.
-          :param assign_val Boolean for assigning a boolean map value based on
+          
+          :param maplistA: List of maps.
+          :param maplistB: List of maps.
+          :param topolist: List of strings of temporal relations.
+          :param assign_val: Boolean for assigning a boolean map value based on
                             the map_values from the compared map list by
                             the map_values from the compared map list by
                             topological relationships.
                             topological relationships.
-          :param count_map Boolean if the number of topological related maps
+          :param count_map: Boolean if the number of topological related maps
                            should be returned.
                            should be returned.
-          :param compare_bool Boolean for comparing boolean map values based on
+          :param compare_bool: Boolean for comparing boolean map values based on
                             related map list and compariosn operator.
                             related map list and compariosn operator.
-          :param compare_cmd Boolean for comparing command list values based on
+          :param compare_cmd: Boolean for comparing command list values based on
                             related map list and compariosn operator.
                             related map list and compariosn operator.
-          :param compop Comparison operator, && or ||.
-          :param aggregate Aggregation operator for relation map list, & or |.
-          :param new Boolean if new temporary maps should be created.
-          :param convert Boolean if conditional values should be converted to 
+          :param compop: Comparison operator, && or ||.
+          :param aggregate: Aggregation operator for relation map list, & or |.
+          :param new: Boolean if new temporary maps should be created.
+          :param convert: Boolean if conditional values should be converted to 
                         r.mapcalc command strings.
                         r.mapcalc command strings.
-          :param overlay_cmd Boolean for aggregate overlay operators implicitly 
+          :param overlay_cmd: Boolean for aggregate overlay operators implicitly 
                         in command list values based on related map lists.
                         in command list values based on related map lists.
                     
                     
           :return: List of maps from maplistA that fulfil the topological relationships
           :return: List of maps from maplistA that fulfil the topological relationships
@@ -243,10 +244,11 @@ class TemporalVectorAlgebraParser(TemporalAlgebraParser):
 
 
     def overlay_cmd_value(self,  map_i, tbrelations, function, topolist = ["EQUAL"]):
     def overlay_cmd_value(self,  map_i, tbrelations, function, topolist = ["EQUAL"]):
         """ Function to evaluate two map lists by given overlay operator.
         """ Function to evaluate two map lists by given overlay operator.
-          :param map_i Map object with temporal extent.
-          :param tbrelations List of temporal relation to map_i.
-          :param topolist List of strings for given temporal relations.
-          :param function Overlay operator, &|+^~.
+        
+          :param map_i: Map object with temporal extent.
+          :param tbrelations: List of temporal relation to map_i.
+          :param topolist: List of strings for given temporal relations.
+          :param function: Overlay operator, &|+^~.
           
           
           :return: Map object with command list with  operators that has been 
           :return: Map object with command list with  operators that has been 
                         evaluated by implicit aggregration.
                         evaluated by implicit aggregration.
@@ -302,10 +304,10 @@ class TemporalVectorAlgebraParser(TemporalAlgebraParser):
         """ Change temporal extent of map list based on temporal relations to 
         """ Change temporal extent of map list based on temporal relations to 
                 other map list and given temporal operator.
                 other map list and given temporal operator.
 
 
-            :param maplist List of map objects for which relations has been build 
+            :param maplist: List of map objects for which relations has been build 
                                         correctely.
                                         correctely.
-            :param topolist List of strings of temporal relations.
-            :param temporal The temporal operator specifying the temporal
+            :param topolist: List of strings of temporal relations.
+            :param temporal: The temporal operator specifying the temporal
                                             extent operation (intersection, union, disjoint 
                                             extent operation (intersection, union, disjoint 
                                             union, right reference, left reference).
                                             union, right reference, left reference).
 
 

+ 2 - 3
lib/python/temporal/univar_statistics.py

@@ -5,10 +5,9 @@ Usage:
 
 
 .. code-block:: python
 .. code-block:: python
 
 
-import grass.temporal as tgis
+    import grass.temporal as tgis
 
 
-    tgis.print_gridded_dataset_univar_statistics(
-        type, input, where, extended, no_header, fs)
+    tgis.print_gridded_dataset_univar_statistics(type, input, where, extended, no_header, fs)
 
 
 
 
 (C) 2012-2013 by the GRASS Development Team
 (C) 2012-2013 by the GRASS Development Team