Skip to content

Commit

Permalink
t.*: consistency changes for parameters and flags
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60608 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
neteler committed May 30, 2014
1 parent d647090 commit 5c2ccef
Show file tree
Hide file tree
Showing 32 changed files with 136 additions and 122 deletions.
2 changes: 2 additions & 0 deletions temporal/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ fi
LOG_FILE="/tmp/run.log"
echo "Logfile\n\n" > $LOG_FILE

export GRASS_MESSAGE_FORMAT=plain

# For each directory
for mydir in `ls -d t*` ; do
if [ -d "${mydir}" ] ; then
Expand Down
21 changes: 8 additions & 13 deletions temporal/t.list/t.list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: List space time datasets and maps registered in the temporal database
# COPYRIGHT: (C) 2011 by the GRASS Development Team
# COPYRIGHT: (C) 2011-2014, Soeren Gebbert and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
Expand Down Expand Up @@ -45,7 +45,7 @@
#% guisection: Formatting
#% required: no
#% multiple: yes
#% options: id, name, creator, mapset, number_of_maps, creation_time, start_time, end_time, interval, north, south, west, east, granularity
#% options: id,name,creator,mapset,number_of_maps,creation_time,start_time,end_time,interval,north,south,west,east,granularity
#% answer: id
#%end

Expand All @@ -57,24 +57,21 @@
#% guisection: Selection
#% required: no
#% multiple: yes
#% options: id, name, creator, mapset, number_of_maps, creation_time, start_time, end_time, north, south, west, east, granularity, all
#% options: id,name,creator,mapset,number_of_maps,creation_time,start_time,end_time,north,south,west,east,granularity,all
#% answer: id
#%end

#%option G_OPT_T_WHERE
#% guisection: Selection
#%end

#%option
#% key: separator
#% type: string
#% description: Separator character between the columns, default is tabular "\t"
#%option G_OPT_F_SEP
#% description: Field separator character between the output columns
#% guisection: Formatting
#% required: no
#%end

#%flag
#% key: c
#% key: h
#% description: Print the column names as first row
#% guisection: Formatting
#%end
Expand All @@ -85,6 +82,7 @@

############################################################################


def main():

# Get the options
Expand All @@ -94,7 +92,7 @@ def main():
order = options["order"]
where = options["where"]
separator = options["separator"]
colhead = flags['c']
colhead = flags['h']

# Make sure the temporal database exists
tgis.init()
Expand Down Expand Up @@ -129,9 +127,6 @@ def main():
sys.stderr.write(_("Space time %s datasets with %s available in mapset <%s>:\n")%\
(sp.get_new_map_instance(None).get_type(), time, key))

if separator is None or separator == "":
separator = "\t"

# Print the column names if requested
if colhead == True and first == True:
output = ""
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.accdetect/t.rast.accdetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.accumulate/t.rast.accumulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.aggregate/t.rast.aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.colors/t.rast.colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

#%flag
#% key: w
#% description: Only write new color table if one doesn't already exist
#% description: Only write new color table if it does not already exist
#%end

#%flag
Expand Down
3 changes: 2 additions & 1 deletion temporal/t.rast.export/t.rast.export.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
#%option
#% key: format
#% type: string
#% description: The export format of a single raster map. Supported are GTiff, AAIGrid via r.out.gdal and the GRASS package format of r.pack.
#% label: The export format of a single raster map
#% description: Supported are GTiff, AAIGrid via r.out.gdal and the GRASS package format of r.pack
#% required: no
#% multiple: no
#% options: GTiff,AAIGrid,pack
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.extract/t.rast.extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: no
#% multiple: no
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.gapfill/t.rast.gapfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.import/t.rast.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: no
#% multiple: no
Expand Down
20 changes: 11 additions & 9 deletions temporal/t.rast.list/t.rast.list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: List registered maps of a space time raster dataset
# COPYRIGHT: (C) 2011 by the GRASS Development Team
# COPYRIGHT: (C) 2011-2014, Soeren Gebbert and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
Expand All @@ -28,7 +28,8 @@
#%option
#% key: order
#% type: string
#% description: Order the space time dataset by category
#% description: Sort the space time dataset by category
#% guisection: Formatting
#% required: no
#% multiple: yes
#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max
Expand All @@ -38,14 +39,16 @@
#%option
#% key: columns
#% type: string
#% description: Select columns to be printed to stdout
#% description: Columns to be printed to stdout
#% guisection: Selection
#% required: no
#% multiple: yes
#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max
#% answer: name,mapset,start_time,end_time
#%end

#%option G_OPT_T_WHERE
#% guisection: Selection
#%end

#%option
Expand All @@ -66,16 +69,15 @@
#% multiple: no
#%end

#%option
#% key: separator
#% type: string
#% description: Separator character between the columns, default is tabular "\t"
#% required: no
#%option G_OPT_F_SEP
#% description: Field separator character between the output columns
#% guisection: Formatting
#%end

#%flag
#% key: h
#% description: Print column names
#% description: Print the column names as first row
#% guisection: Formatting
#%end

import grass.script as grass
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.mapcalc/t.rast.mapcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
23 changes: 11 additions & 12 deletions temporal/t.rast.mapcalc2/t.rast.mapcalc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,39 @@
# -*- coding: utf-8 -*-
############################################################################
#
# MODULE: t.rast.mapcal2c
# MODULE: t.rast.mapcalc2
# AUTHOR(S): Thomas Leppelt, Soeren Gebbert
#
# PURPOSE: Provide temporal raster algebra to perform spatial an temporal operations
# for space time datasets by topological relationships to other space time
# datasets.
# COPYRIGHT: (C) 2014 by the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
# for details.
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
# for details.
#
#############################################################################

#%module
#% description: Apply temporal and spatial oeprations on space time raster datasets using temporal raster algebra.
#% description: Apply temporal and spatial operations on space time raster datasets using temporal raster algebra.
#% keywords: temporal
#% keywords: mapalgebra
#% keywords: algebra
#%end

#%option
#% key: expression
#% type: string
#% description: The mapcalc expression for temporal and spatial analysis of space time raster datasets.
#% key_desc: expression
#% description: r.mapcalc expression for temporal and spatial analysis of space time raster datasets
#% required : yes
#%end

#%option
#% key: basename
#% type: string
#% description: The basename of raster maps that are stored within the result space time raster dataset.
#% key_desc: basename
#% required : yes
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#%end

#%option
Expand All @@ -49,7 +48,7 @@

#%flag
#% key: s
#% description: Activate spatial topology.
#% description: Activate spatial topology
#%end

#%flag
Expand Down
2 changes: 1 addition & 1 deletion temporal/t.rast.neighbors/t.rast.neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#%option
#% key: basename
#% type: string
#% label: Base name of the new generated output maps"
#% label: Basename of the new generated output maps
#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
Expand Down
13 changes: 8 additions & 5 deletions temporal/t.rast.univar/t.rast.univar.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: Calculates univariate statistics from the non-null cells for each registered raster map of a space time raster dataset
# COPYRIGHT: (C) 2011 by the GRASS Development Team
# COPYRIGHT: (C) 2011-2014, Soeren Gebbert and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
Expand All @@ -25,10 +25,12 @@
#%end

#%option G_OPT_T_WHERE
#% guisection: Selection
#%end

#%option G_OPT_F_SEP
#% description: Field separator character between the output columns
#% guisection: Formatting
#%end

#%flag
Expand All @@ -38,7 +40,8 @@

#%flag
#% key: h
#% description: Print column names
#% description: Print the column names as first row
#% guisection: Formatting
#%end

import grass.script as grass
Expand All @@ -53,14 +56,14 @@ def main():
input = options["input"]
where = options["where"]
extended = flags["e"]
header = flags["h"]
fs = options["separator"]
colhead = flags["h"]
separator = options["separator"]

# Make sure the temporal database exists
tgis.init()

tgis.print_gridded_dataset_univar_statistics(
"strds", input, where, extended, header, fs)
"strds", input, where, extended, colhead, separator)

if __name__ == "__main__":
options, flags = grass.parser()
Expand Down
15 changes: 8 additions & 7 deletions temporal/t.rast3d.list/t.rast3d.list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: List registered maps of a space time raster3d dataset
# COPYRIGHT: (C) 2011 by the GRASS Development Team
# COPYRIGHT: (C) 2011-2014, Soeren Gebbert and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
Expand Down Expand Up @@ -39,13 +39,15 @@
#% key: columns
#% type: string
#% description: Columns to be printed to stdout
#% guisection: Selection
#% required: no
#% multiple: yes
#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,tbres,ewres,cols,rows,depths,number_of_cells,min,max
#% answer: name,mapset,start_time,end_time
#%end

#%option G_OPT_T_WHERE
#% guisection: Selection
#%end

#%option
Expand All @@ -58,16 +60,15 @@
#% answer: cols
#%end

#%option
#% key: separator
#% type: string
#% description: Separator character between the output columns, default is tabular "\t"
#% required: no
#%option G_OPT_F_SEP
#% description: Field separator character between the output columns
#% guisection: Formatting
#%end

#%flag
#% key: h
#% description: Print column names
#% description: Print the column names as first row
#% guisection: Formatting
#%end

import grass.script as grass
Expand Down
Loading

0 comments on commit 5c2ccef

Please sign in to comment.