[GRASS-SVN] r62710 - in grass/trunk/lib/python: docs/src temporal
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Nov 11 12:55:58 PST 2014
Author: huhabla
Date: 2014-11-11 12:55:57 -0800 (Tue, 11 Nov 2014)
New Revision: 62710
Modified:
grass/trunk/lib/python/docs/src/temporal_framework.rst
grass/trunk/lib/python/temporal/temporal_algebra.py
grass/trunk/lib/python/temporal/temporal_operator.py
grass/trunk/lib/python/temporal/temporal_vector_algebra.py
grass/trunk/lib/python/temporal/univar_statistics.py
Log:
temporal framework: Sphinx documentation fixes
Modified: grass/trunk/lib/python/docs/src/temporal_framework.rst
===================================================================
--- grass/trunk/lib/python/docs/src/temporal_framework.rst 2014-11-11 20:09:58 UTC (rev 62709)
+++ grass/trunk/lib/python/docs/src/temporal_framework.rst 2014-11-11 20:55:57 UTC (rev 62710)
@@ -119,8 +119,11 @@
Spatio-temporal algebra classes for space time raster and vector datasets are defined in:
- :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
^^^^^^^^^^^^^^
Modified: grass/trunk/lib/python/temporal/temporal_algebra.py
===================================================================
--- grass/trunk/lib/python/temporal/temporal_algebra.py 2014-11-11 20:09:58 UTC (rev 62709)
+++ grass/trunk/lib/python/temporal/temporal_algebra.py 2014-11-11 20:55:57 UTC (rev 62710)
@@ -1053,6 +1053,7 @@
compop = None, aggregate = None):
"""Build temporal topology for two space time data sets, copy map objects
for given relation into map list.
+
:param maplistA: List of maps.
:param maplistB: List of maps.
:param topolist: List of strings of temporal relations.
@@ -1253,6 +1254,7 @@
def assign_bool_value(self, map_i, tbrelations, topolist = ["EQUAL"]):
""" Function to assign boolean map value based on the map_values from the
compared map list by topological relationships.
+
: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.
@@ -1283,6 +1285,7 @@
def compare_bool_value(self, map_i, tbrelations, compop, aggregate, topolist = ["EQUAL"]):
""" Function to evaluate two map lists with boolean values by boolean
comparison 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.
@@ -1744,14 +1747,14 @@
For example: td(A) == 1 && start_day() > 5 --> [True || False]
(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
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.
- :param topolist List of temporal relations between the conditions and the
+ :param topolist: List of temporal relations between the conditions and the
conclusions.
:return: Map list with conditional values for all temporal expressions.
@@ -1813,15 +1816,17 @@
A recursive function is used to evaluate comparison statements
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.
The list is constructed by the TemporalAlgebraParser
Modified: grass/trunk/lib/python/temporal/temporal_operator.py
===================================================================
--- grass/trunk/lib/python/temporal/temporal_operator.py 2014-11-11 20:09:58 UTC (rev 62709)
+++ grass/trunk/lib/python/temporal/temporal_operator.py 2014-11-11 20:55:57 UTC (rev 62710)
@@ -1,4 +1,4 @@
-"""!@package grass.temporal
+"""@package grass.temporal
Temporal operator evaluation with PLY
@@ -7,9 +7,10 @@
License (>=v2). Read the file COPYING that comes with GRASS
for details.
- at author Thomas Leppelt and Soeren Gebbert
+:authors: Thomas Leppelt and Soeren Gebbert
- at code
+.. code-block:: python
+
>>> p = TemporalOperatorParser()
>>> expression = "{equal| during}"
>>> p.parse(expression, optype = 'relation')
@@ -100,8 +101,7 @@
>>> p.parse(expression, optype = 'overlay')
>>> print(p.relations, p.temporal, p.function)
(['overlaps', 'overlapped'], 'r', '^')
-
- at endcode
+
"""
try:
@@ -111,7 +111,7 @@
pass
class TemporalOperatorLexer(object):
- """!Lexical analyzer for the GRASS GIS temporal operator"""
+ """Lexical analyzer for the GRASS GIS temporal operator"""
# Functions that defines topological relations.
relations = {
Modified: grass/trunk/lib/python/temporal/temporal_vector_algebra.py
===================================================================
--- grass/trunk/lib/python/temporal/temporal_vector_algebra.py 2014-11-11 20:09:58 UTC (rev 62709)
+++ grass/trunk/lib/python/temporal/temporal_vector_algebra.py 2014-11-11 20:55:57 UTC (rev 62710)
@@ -161,24 +161,25 @@
new = False, convert = False, overlay_cmd = False):
"""Build temporal topology for two space time data sets, copy map objects
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
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.
- :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.
- :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.
- :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.
- :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.
:return: List of maps from maplistA that fulfil the topological relationships
@@ -243,10 +244,11 @@
def overlay_cmd_value(self, map_i, tbrelations, function, topolist = ["EQUAL"]):
""" 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
evaluated by implicit aggregration.
@@ -302,10 +304,10 @@
""" Change temporal extent of map list based on temporal relations to
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.
- :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
union, right reference, left reference).
Modified: grass/trunk/lib/python/temporal/univar_statistics.py
===================================================================
--- grass/trunk/lib/python/temporal/univar_statistics.py 2014-11-11 20:09:58 UTC (rev 62709)
+++ grass/trunk/lib/python/temporal/univar_statistics.py 2014-11-11 20:55:57 UTC (rev 62710)
@@ -5,10 +5,9 @@
.. 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
More information about the grass-commit
mailing list