[GRASS-SVN] r62460 - in grass-addons/grass7/raster: r.bioclim r.convert r.droka r.edm.eval r.fidimo r.gdd r.hants r.hazard.flood r.in.srtm.region r.los/testsuite r.mcda.input r.mcda.roughset r.mess r.popgrowth r.random.weight r.regression.series r.rock.stability r.roughness.vector r.soillossbare r.sun.daily r.sun.hourly r.vol.dem
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 28 16:11:08 PDT 2014
Author: hcho
Date: 2014-10-28 16:11:08 -0700 (Tue, 28 Oct 2014)
New Revision: 62460
Modified:
grass-addons/grass7/raster/r.bioclim/r.bioclim.html
grass-addons/grass7/raster/r.bioclim/r.bioclim.py
grass-addons/grass7/raster/r.convert/r.convert.all
grass-addons/grass7/raster/r.droka/r.droka.py
grass-addons/grass7/raster/r.edm.eval/r.edm.eval
grass-addons/grass7/raster/r.fidimo/r.fidimo.py
grass-addons/grass7/raster/r.gdd/r.gdd.html
grass-addons/grass7/raster/r.hants/r.hants.html
grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py
grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py
grass-addons/grass7/raster/r.los/testsuite/test_using_rviewshed.sh
grass-addons/grass7/raster/r.mcda.input/r.mcda.input.py
grass-addons/grass7/raster/r.mcda.roughset/r.mcda.roughset.py
grass-addons/grass7/raster/r.mess/r.mess
grass-addons/grass7/raster/r.popgrowth/r.popgrowth.py
grass-addons/grass7/raster/r.random.weight/r.random.weight.py
grass-addons/grass7/raster/r.random.weight/r.random.weight_legacy.py
grass-addons/grass7/raster/r.regression.series/r.regression.series.html
grass-addons/grass7/raster/r.rock.stability/r.rock.stability.py
grass-addons/grass7/raster/r.roughness.vector/r.roughness.vector.py
grass-addons/grass7/raster/r.soillossbare/r.soillossbare.py
grass-addons/grass7/raster/r.sun.daily/r.sun.daily.py
grass-addons/grass7/raster/r.sun.daily/test.r.sun.daily.sh
grass-addons/grass7/raster/r.sun.hourly/r.sun.hourly.py
grass-addons/grass7/raster/r.sun.hourly/test.r.sun.hourly.sh
grass-addons/grass7/raster/r.vol.dem/main.c
Log:
Update to new g.list/remove API
Modified: grass-addons/grass7/raster/r.bioclim/r.bioclim.html
===================================================================
--- grass-addons/grass7/raster/r.bioclim/r.bioclim.html 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.bioclim/r.bioclim.html 2014-10-28 23:11:08 UTC (rev 62460)
@@ -55,9 +55,9 @@
Bioclimatic indices from worldclim data with 4 parallel processes:
<div class="code"><pre>
-r.bioclim tmin=`g.mlist type=rast pat=tmin_* map=. sep=,` \
- tmax=`g.mlist type=rast pat=tmax_* map=. sep=,` \
- prec=`g.mlist type=rast pat=prec_* map=. sep=,` \
+r.bioclim tmin=`g.list type=rast pat=tmin_* map=. sep=,` \
+ tmax=`g.list type=rast pat=tmax_* map=. sep=,` \
+ prec=`g.list type=rast pat=prec_* map=. sep=,` \
out=worldclim workers=4
</pre></div>
Modified: grass-addons/grass7/raster/r.bioclim/r.bioclim.py
===================================================================
--- grass-addons/grass7/raster/r.bioclim/r.bioclim.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.bioclim/r.bioclim.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -142,7 +142,7 @@
ta = "%s.tavg%02d.%d" % (outpre, (i + 1), pid)
grass.mapcalc(e, ta = ta, tmax = tmaxl[i], tmin = tminl[i])
- tavg = grass.read_command("g.mlist",
+ tavg = grass.read_command("g.list",
quiet = True,
type = 'rast',
pattern = '%s.tavg??.%d' % (outpre, pid),
@@ -185,7 +185,7 @@
tr = "%s.tr%02d.%d" % (outpre, (i + 1), pid)
grass.mapcalc(e, tr = tr, tmax = tmaxl[i], tmin = tminl[i])
- tr = grass.read_command("g.mlist",
+ tr = grass.read_command("g.list",
quiet = True,
type = 'rast',
pattern = '%s.tr??.%d' % (outpre, pid),
@@ -283,7 +283,7 @@
grass.message(_("BIO10 = Mean Temperature of Warmest Quarter,"))
grass.message(_("BIO11 = Mean Temperature of Coldest Quarter ..."))
- tavgq = grass.read_command("g.mlist",
+ tavgq = grass.read_command("g.list",
quiet = True,
type = 'rast',
pattern = '%s.tavgq.?.%d' % (outpre, pid),
@@ -332,7 +332,7 @@
input = "%s,%s,%s" % (precl[j], precl[j + 1], precl[j + 2]),
output = precq, method = 'sum')
- precq = grass.read_command("g.mlist",
+ precq = grass.read_command("g.list",
quiet = True,
type = 'rast',
pattern = '%s.precq.?.%d' % (outpre, pid),
Modified: grass-addons/grass7/raster/r.convert/r.convert.all
===================================================================
--- grass-addons/grass7/raster/r.convert/r.convert.all 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.convert/r.convert.all 2014-10-28 23:11:08 UTC (rev 62460)
@@ -47,7 +47,7 @@
fi
-for MAP in `g.mlist type=rast mapset=.` ; do
+for MAP in `g.list type=rast mapset=.` ; do
r.convert map="$MAP" $MV_FLAG $REV_FLAG
if [ $? -ne 0 ] ; then
echo "Error converting <$MAP>" 1>&2
Modified: grass-addons/grass7/raster/r.droka/r.droka.py
===================================================================
--- grass-addons/grass7/raster/r.droka/r.droka.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.droka/r.droka.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -271,20 +271,26 @@
#grass.run_command('d.rast' ,
# map=eMean)
if int(num) == 1:
- grass.run_command('g.remove' ,
- vect=( 'start_points_' ),
+ grass.run_command('g.remove' ,
+ flags = 'f',
+ type = 'vect',
+ name = ( 'start_points_' ),
quiet = True )
else:
grass.run_command('g.rename' ,
vect= 'start_points_,' + prefix + '_starting' ,
quiet = True )
grass.run_command('g.remove' ,
- vect=(
+ flags = 'f',
+ type = 'vect',
+ name = (
'start_buffer_',
'start_random_') ,
quiet = True )
grass.run_command('g.remove' ,
- rast=(
+ flags = 'f',
+ type = 'rast',
+ name = (
'uno',
'costo',
'costo_m',
Modified: grass-addons/grass7/raster/r.edm.eval/r.edm.eval
===================================================================
--- grass-addons/grass7/raster/r.edm.eval/r.edm.eval 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.edm.eval/r.edm.eval 2014-10-28 23:11:08 UTC (rev 62460)
@@ -232,7 +232,7 @@
if(fft==0){
rname <- rand.name()
execGRASS("g.copy", rast=paste(rast, rname, sep=","))
- if(remove.orig){execGRASS("g.remove", flags="f", type="rast", pattern=rast)}
+ if(remove.orig){execGRASS("g.remove", flags="f", type="rast", name=rast)}
return(rname)
}else{
print("the selected file does not exist")
@@ -265,7 +265,7 @@
sink("reclass.rules"); cat("1:1:1:1"); cat("\n"); cat("2:2:0:0"); cat("\n"); sink()
execGRASS("r.recode", flags="overwrite", input=tmp.b, output=tmp.a, rules="reclass.rules")
obsmap <- tmp.a
- execGRASS("g.remove", flags="f", type="rast", pattern=tmp.b); unlink("reclass.rules")
+ execGRASS("g.remove", flags="f", type="rast", name=tmp.b); unlink("reclass.rules")
}
if(bufpres>0){
@@ -275,7 +275,7 @@
execGRASS("r.buffer", flags=c("z","overwrite"), input=tmp.b, output=tmp.c, distances=bufpres, units="kilometers")
execGRASS("r.mapcalc", flags="overwrite", expression=paste(tmp.b, " = if(", tmp.c, "==2,1,", obsmap, ")", sep=""))
obsmap <- tmp.b
- execGRASS("g.remove", flags="f", type="rast", pattern=tmp.c)
+ execGRASS("g.remove", flags="f", type="rast", name=tmp.c)
}
# Prevalence
@@ -303,7 +303,7 @@
execGRASS("r.random", input=tmp.g, n=as.character(abs.req), raster_output=tmp.h, Sys_wait=TRUE)
execGRASS("r.patch", input=paste(tmp.f, tmp.h, sep=","), output=tmp.i, flags="overwrite", Sys_wait=TRUE)
obsmap <- tmp.i
- execGRASS("g.remove", flags="f", type="rast", pattern=paste(tmp.f, tmp.g, tmp.h, tmp.e, sep=","), Sys_wait=TRUE)
+ execGRASS("g.remove", flags="f", type="rast", name=paste(tmp.f, tmp.g, tmp.h, tmp.e, sep=","), Sys_wait=TRUE)
}else{
# Set number of presence and absence points
if(num.pres > 0 | num.abs > 0){
@@ -340,7 +340,7 @@
tmp.j <- "tmp_r_model_evaluation_0987654321j"
execGRASS("r.patch", input=paste(tmp.f, tmp.h, sep=","), output=tmp.j, flags="overwrite", Sys_wait=TRUE)
obsmap <- tmp.j
- execGRASS("g.remove", flags="f", type="rast", pattern=paste(tmp.f, tmp.g, tmp.h, tmp.e, sep=","), Sys_wait=TRUE)
+ execGRASS("g.remove", flags="f", type="rast", name=paste(tmp.f, tmp.g, tmp.h, tmp.e, sep=","), Sys_wait=TRUE)
}
}
@@ -365,7 +365,7 @@
# Based on presence / absence
a <- execGRASS("r.stats", flags=c("c","n"), input=paste(obsmap, tmp.d, sep=","), intern=TRUE)
a <- get_output.GRASS(a, separator=" ")
- execGRASS("g.remove", flags="f", type="rast", pattern=tmp.d)
+ execGRASS("g.remove", flags="f", type="rast", name=tmp.d)
}else{
# Based on presence / background
tmp.k <- "tmp_r_model_evaluation_0987654321k"
@@ -384,15 +384,15 @@
a <- rbind(a1, a3)
# Clean up
- execGRASS("g.remove", flags="f", type="rast", pattern=paste(tmp.k, tmp.m, sep=","))
+ execGRASS("g.remove", flags="f", type="rast", name=paste(tmp.k, tmp.m, sep=","))
}
# Clean up
-execGRASS("g.remove", flags="f", type="rast", pattern=tmp.d)
-if(bufabs>0){execGRASS("g.remove", flags="f", type="rast", pattern=tmp.a)}
-if(bufabs>0){execGRASS("g.remove", flags="f", type="rast", pattern=tmp.b)}
-if(preval>0){execGRASS("g.remove", flags="f", type="rast", pattern=tmp.i)}
-if(num.abs > 0 | num.pres > 0){execGRASS("g.remove", flags="f", type="rast", pattern=tmp.j)}
+execGRASS("g.remove", flags="f", type="rast", name=tmp.d)
+if(bufabs>0){execGRASS("g.remove", flags="f", type="rast", name=tmp.a)}
+if(bufabs>0){execGRASS("g.remove", flags="f", type="rast", name=tmp.b)}
+if(preval>0){execGRASS("g.remove", flags="f", type="rast", name=tmp.i)}
+if(num.abs > 0 | num.pres > 0){execGRASS("g.remove", flags="f", type="rast", name=tmp.j)}
# the temporary files do not always get cleaned up, need to check why
# this is a temporary fix!
Modified: grass-addons/grass7/raster/r.fidimo/r.fidimo.py
===================================================================
--- grass-addons/grass7/raster/r.fidimo/r.fidimo.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.fidimo/r.fidimo.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -207,10 +207,16 @@
def cleanup():
if (tmp_map_rast or tmp_map_vect) and not flags['a']:
- grass.run_command("g.remove",
- rast = [f + str(os.getpid()) for f in tmp_map_rast],
- vect = [f + str(os.getpid()) for f in tmp_map_vect],
+ grass.run_command("g.remove",
+ flags = 'f',
+ type = 'rast',
+ name = [f + str(os.getpid()) for f in tmp_map_rast],
quiet = True)
+ grass.run_command("g.remove",
+ flags = 'f',
+ type = 'vect',
+ name = [f + str(os.getpid()) for f in tmp_map_vect],
+ quiet = True)
@@ -761,7 +767,7 @@
#Calculation Kernel Density from Distance Raster
#only for m=0 because of cdf-function
if grass.find_file(name = "density_from_point_unmasked_tmp_%d" % os.getpid(), element = 'cell')['file']:
- grass.run_command("g.remove", flags="f", type="rast", name= "density_from_point_unmasked_tmp_%d" % os.getpid())
+ grass.run_command("g.remove", flags = 'f', type = 'rast', name = "density_from_point_unmasked_tmp_%d" % os.getpid())
x1 = garray.array()
x1.read("lower_distance_tmp_%d" % os.getpid())
@@ -993,7 +999,7 @@
density_segment = "density_segment_"+segment_cat,
mapcalc_string_Aa_aggregate = mapcalc_string_Aa_aggregate,
overwrite = True)
- grass.run_command("g.remove", flags="f", type="rast", name=mapcalc_string_Aa_removal)
+ grass.run_command("g.remove", flags = 'bf', type = 'rast', name = mapcalc_string_Aa_removal)
grass.run_command("r.null", map="density_segment_"+segment_cat, null="0") # Final density map per segment, set 0 for aggregation with r.mapcalc
@@ -1006,7 +1012,7 @@
realised_density_segment = "realised_density_segment_"+segment_cat,
mapcalc_string_Ab_aggregate = mapcalc_string_Ab_aggregate,
overwrite = True)
- grass.run_command("g.remove", flags="f", type="rast", name=mapcalc_string_Ab_removal)
+ grass.run_command("g.remove", flags = 'bf', type = 'rast', name = mapcalc_string_Ab_removal)
grass.run_command("r.null", map="realised_density_segment_"+segment_cat, null="0") # Final density map per segment, set 0 for aggregation with r.mapcalc
mapcalc_list_Bb.append("realised_density_segment_"+segment_cat)
@@ -1037,7 +1043,7 @@
# Set all 0-values to NULL, Backgroundvalues
grass.run_command("r.null", map="realised_"+output_fidimo+"_"+i, setnull="0")
- grass.run_command("g.remove", flags="f", type="rast", name=mapcalc_string_Bb_removal)
+ grass.run_command("g.remove", flags = 'bf', type = 'rast', name = mapcalc_string_Bb_removal)
# backtransformation (divide by scalar which was defined before)
grass.mapcalc("$density_final_corrected = $density_final/$scalar",
@@ -1053,14 +1059,14 @@
grass.run_command("r.null", map=output_fidimo+"_"+i, setnull="0")
- grass.run_command("g.remove", flags="f", type="rast", name=mapcalc_string_Ba_removal)
+ grass.run_command("g.remove", flags = 'bf', type = 'rast', name = mapcalc_string_Ba_removal)
# Delete basic maps if flag "b" is set
if flags['b']:
- grass.run_command("g.remove", vect = output_fidimo + "_source_points", flags ="f")
+ grass.run_command("g.remove", flags = 'bf', type = 'vect', name = output_fidimo + "_source_points")
if options['barriers']:
- grass.run_command("g.remove", vect = output_fidimo + "_barriers", flags ="f")
+ grass.run_command("g.remove", flags = 'bf', type = 'vect', name = output_fidimo + "_barriers")
return 0
Modified: grass-addons/grass7/raster/r.gdd/r.gdd.html
===================================================================
--- grass-addons/grass7/raster/r.gdd/r.gdd.html 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.gdd/r.gdd.html 2014-10-28 23:11:08 UTC (rev 62460)
@@ -112,7 +112,7 @@
<h2>SEE ALSO</h2>
<em><a href="r.series.html">r.series</a>,
-<a href="g.mlist.html">g.mlist</a>,
+<a href="g.list.html">g.list</a>,
<a href="g.region.html">g.region</a>
</em>
Modified: grass-addons/grass7/raster/r.hants/r.hants.html
===================================================================
--- grass-addons/grass7/raster/r.hants/r.hants.html 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.hants/r.hants.html 2014-10-28 23:11:08 UTC (rev 62460)
@@ -94,7 +94,7 @@
Visualize the time series as animation:
<div class="code"><pre>
# note: color table is different from standard "celsius"
-g.gui.animation rast=`g.mlist rast pattern="*tempmean" sep=comma`
+g.gui.animation rast=`g.list rast pattern="*tempmean" sep=comma`
</pre></div>
<p>
@@ -106,13 +106,13 @@
# just wildly guessing the parameters for a test run:
# generate and check list of input maps (the order matters!)
-g.mlist rast pattern="20??_??_tempmean" output=tempmean.csv
+g.list rast pattern="20??_??_tempmean" output=tempmean.csv
r.hants file=tempmean.csv \
nf=6 fet=0.1 dod=5 delta=0.1 base_period=12
# assign reasonable color tables for temperature
-for map in `g.mlist rast pattern="*tempmean_hants"` ; do
+for map in `g.list rast pattern="*tempmean_hants"` ; do
r.colors $map color=celsius
done
@@ -139,18 +139,18 @@
...
# see HANTS time series as animation
-g.gui.animation rast=`g.mlist rast pattern="*tempmean_hants" sep=comma`
+g.gui.animation rast=`g.list rast pattern="*tempmean_hants" sep=comma`
# Check HANTS behaviour in a given point
east=740830
north=168832
-for map in `g.mlist rast pat="20??_??_tempmean"` ; do
+for map in `g.list rast pat="20??_??_tempmean"` ; do
r.what map=$map coordinates=$east,$north >> time_series_orig.csv
done
-for map in `g.mlist rast pat="*tempmean_hants"` ; do
+for map in `g.list rast pat="*tempmean_hants"` ; do
r.what map=$map coordinates=$east,$north >> time_series_hants.csv
done
Modified: grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py
===================================================================
--- grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -107,8 +107,10 @@
# Cleaning up
grass.message("Cleaning up.. ")
- grass.run_command('g.remove', quiet = True, rast = 'r_accumulation')
- grass.run_command('g.remove', quiet = True, rast = 'r_slope')
+ grass.run_command('g.remove', quiet = True, flags = 'f',
+ type = 'rast', name = 'r_accumulation')
+ grass.run_command('g.remove', quiet = True, flags = 'f',
+ type = 'rast', name = 'r_slope')
# flood map
grass.message("Calculating flood raster map.. ")
@@ -134,9 +136,9 @@
# Cleaning up
grass.message("Cleaning up.. ")
- grass.run_command('g.remove', flags='f', type='rast', name= 'r_clump')
- grass.run_command('g.remove', flags='f', type='rast', name= 'r_flood_th')
- grass.run_command('g.remove', flags='f', type='rast', name= 'r_flood')
+ grass.run_command('g.remove', flags='f', type='rast', name='r_clump')
+ grass.run_command('g.remove', flags='f', type='rast', name='r_flood_th')
+ grass.run_command('g.remove', flags='f', type='rast', name='r_flood')
grass.message(_('Done.'))
Modified: grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py
===================================================================
--- grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -161,7 +161,7 @@
return
os.chdir(currdir)
grass.run_command('g.region', region = tmpregionname)
- grass.run_command('g.remove', type = 'region', pattern = tmpregionname, flags = 'f', quiet = True)
+ grass.run_command('g.remove', type = 'region', name = tmpregionname, flags = 'f', quiet = True)
grass.try_rmdir(tmpdir)
def main():
@@ -319,10 +319,10 @@
grass.run_command('g.region', region = tmpregionname)
- # g.mlist with sep = comma does not work ???
+ # g.list with sep = comma does not work ???
pattern = '*.r.in.srtm.tmp.%d' % pid
srtmtiles = grass.read_command('g.list',
- type = 'rast',
+ type = 'rast',
pattern = pattern,
sep = 'newline',
quiet = True)
@@ -331,7 +331,7 @@
srtmtiles = ','.join(srtmtiles)
if valid_tiles == 0:
- grass.run_command('g.remove', type = 'rast', pattern = str(srtmtiles), flags = 'f', quiet = True)
+ grass.run_command('g.remove', type = 'rast', name = str(srtmtiles), flags = 'f', quiet = True)
grass.warning(_("No tiles imported"))
if local != tmpdir:
grass.fatal(_("Please check if local folder <%s> is correct.") % local)
@@ -365,7 +365,8 @@
flags = 'z')
grass.run_command('r.mapcalc', expression = '%s = round(%s)' % (output, output + '.float'))
grass.run_command('g.remove', type = 'rast',
- pattern = '%s,%s,%s' % (output + '.holes', output + '.interp', output + '.float'),
+ name = '%s,%s,%s' % (output + '.holes', output + '.interp', output + '.float'),
+ flags = 'f',
quiet = True)
grass.run_command('g.remove', type = 'rast', pattern = pattern, flags = 'f', quiet = True)
Modified: grass-addons/grass7/raster/r.los/testsuite/test_using_rviewshed.sh
===================================================================
--- grass-addons/grass7/raster/r.los/testsuite/test_using_rviewshed.sh 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.los/testsuite/test_using_rviewshed.sh 2014-10-28 23:11:08 UTC (rev 62460)
@@ -12,7 +12,7 @@
g.region n=500 s=0 w=0 e=500 -p res=1
r.mapcalc 'disk.14947=if(sqrt((col() - 500)^2 + (500 - row())^2)<500,sqrt((col() - 500)^2 + (500 - row())^2),null())'
r.mapcalc 'hemisphere2=500 * sin(acos (disk.14947/500))'
-g.remove --q rast=disk.14947,disk.15031
+g.remove --q -f type=rast name=disk.14947,disk.15031
# merge both
r.mapcalc "hemisphere=hemisphere1 + hemisphere2"
Modified: grass-addons/grass7/raster/r.mcda.input/r.mcda.input.py
===================================================================
--- grass-addons/grass7/raster/r.mcda.input/r.mcda.input.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.mcda.input/r.mcda.input.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -163,8 +163,8 @@
patch_georules(maps,outputMap)
if not flags['l']:
- grass.run_command("g.remove",flags="quiet", rast=maplist)
- grass.run_command("g.remove",flags="quiet", vect=maplist)
+ grass.run_command("g.remove", flags="f", quiet=True, type='rast', name=maplist)
+ grass.run_command("g.remove", flags="f", quiet=True, type='vect', name=maplist)
input_rules.close()
return 0
Modified: grass-addons/grass7/raster/r.mcda.roughset/r.mcda.roughset.py
===================================================================
--- grass-addons/grass7/raster/r.mcda.roughset/r.mcda.roughset.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.mcda.roughset/r.mcda.roughset.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -557,8 +557,8 @@
grass.run_command("g.copy",vect=(mapslabels,outputMap))
if not flags['l']:
- grass.run_command("g.remove", rast=mapstring)
- grass.run_command("g.remove", vect=mapstring)
+ grass.run_command("g.remove", flags='f', type='rast', name=mapstring)
+ grass.run_command("g.remove", flags='f', type='vect', name=mapstring)
return 0
Modified: grass-addons/grass7/raster/r.mess/r.mess
===================================================================
--- grass-addons/grass7/raster/r.mess/r.mess 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.mess/r.mess 2014-10-28 23:11:08 UTC (rev 62460)
@@ -368,7 +368,7 @@
if(citiam==0){
rname <- paste("MASK",paste(sample(c(0:9, letters, LETTERS), 12, replace=TRUE), collapse=""), sep="_")
execGRASS("g.copy", rast=paste("MASK", rname, sep=","))
- system("g.remove -f rast=MASK")
+ system("g.remove -bf type=rast name=MASK")
}
# Create mask based on combined MASK/input layer
@@ -409,7 +409,7 @@
# Restore mask
if(citiam==0){
execGRASS("r.mask", flags="overwrite", raster=rname)
- execGRASS("g.remove", rast=rname)
+ execGRASS("g.remove", flags="f", type="rast", name=rname)
}else{
execGRASS("r.mask", flags="r")
}
@@ -429,7 +429,7 @@
calcc <- paste(z1, z2, z3, z4, sep="")
execGRASS("r.mapcalc", expression=paste(opi[i], " = ", calcc, sep=""), flags="overwrite")
execGRASS("r.mapcalc", expression=paste(opi[i], " = ", opi[i], "/", digits2, ".0", sep=""), flags="overwrite")
- execGRASS("g.remove", flags="f", rast=paste(tmpf0, tmpf1, tmpf2, tmpf3, sep=","))
+ execGRASS("g.remove", flags="bf", type="rast", name=paste(tmpf0, tmpf1, tmpf2, tmpf3, sep=","))
unlink(tmp.rule)
}
}else{
@@ -462,7 +462,7 @@
if(length(clpf)>1){print(paste("Please note that the points", paste(clpf, collapse=" and "), "have no values. This is probably because they lie outside the current region"))}
close(con)
- system("g.remove vect=tmpMESS976543210")
+ system("g.remove -f type=vect name=tmpMESS976543210")
for(i in 1:length(ipl)){
@@ -492,7 +492,7 @@
z4 <- paste(", (", envmax, ".0- double(", ipl2[i], "))/(", envmax, ".0-", envmin, ".0) * 100.0)))", sep="")
calcc <- paste(z1, z2, z3, z4, sep="")
execGRASS("r.mapcalc", expression=paste(opi[i], "=", calcc), flags="overwrite")
- execGRASS("g.remove", rast=tmpv1)
+ execGRASS("g.remove", flags="f", type="rast", name=tmpv1)
unlink(tmp.rule)
}
}
Modified: grass-addons/grass7/raster/r.popgrowth/r.popgrowth.py
===================================================================
--- grass-addons/grass7/raster/r.popgrowth/r.popgrowth.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.popgrowth/r.popgrowth.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -140,9 +140,15 @@
def cleanup():
grass.debug(_("This is the cleanup part"))
if (tmp_map_rast or tmp_map_vect):
+# grass.run_command("g.remove",
+# flags = 'f',
+# type = 'rast',
+# name = [f + str(os.getpid()) for f in tmp_map_rast],
+# quiet = True)
grass.run_command("g.remove",
- #rast = [f + str(os.getpid()) for f in tmp_map_rast],
- vect = [f + str(os.getpid()) for f in tmp_map_vect],
+ flags = 'f',
+ type = 'vect',
+ name = [f + str(os.getpid()) for f in tmp_map_vect],
quiet = True)
Modified: grass-addons/grass7/raster/r.random.weight/r.random.weight.py
===================================================================
--- grass-addons/grass7/raster/r.random.weight/r.random.weight.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.random.weight/r.random.weight.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -84,8 +84,8 @@
def cleanup():
grass.run_command('g.remove',
type = 'rast',
- pattern = 'tmp_map',
- flags='f',
+ name = 'tmp_map',
+ flags = 'f',
quiet = True)
# main function
Modified: grass-addons/grass7/raster/r.random.weight/r.random.weight_legacy.py
===================================================================
--- grass-addons/grass7/raster/r.random.weight/r.random.weight_legacy.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.random.weight/r.random.weight_legacy.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -86,8 +86,8 @@
# os.environ['GRASS_VERBOSE']='-1'
def cleanup():
- grass.run_command('g.remove',
- rast = tmp_map, quiet = True)
+ grass.run_command('g.remove', flags = 'f',
+ type = 'rast', name = tmp_map, quiet = True)
# main function
def main():
Modified: grass-addons/grass7/raster/r.regression.series/r.regression.series.html
===================================================================
--- grass-addons/grass7/raster/r.regression.series/r.regression.series.html 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.regression.series/r.regression.series.html 2014-10-28 23:11:08 UTC (rev 62460)
@@ -83,12 +83,12 @@
Using <em>r.regression.series</em> with wildcards:
<br>
<div class="code"><pre>
-r.regression.series xseries="`g.mlist pattern='insitu_data.*' sep=,`" \
- yseries="`g.mlist pattern='invivo_data.*' sep=,`" \
+r.regression.series xseries="`g.list pattern='insitu_data.*' sep=,`" \
+ yseries="`g.list pattern='invivo_data.*' sep=,`" \
output=insitu_data.rsquared method=rsq
</pre></div>
<p>
-Note the <em>g.mlist</em> module also supports regular expressions for
+Note the <em>g.list</em> module also supports regular expressions for
selecting map names.
<p>
@@ -103,7 +103,7 @@
<em><a href="r.series.html">r.series</a></em>,
<em><a href="r.regression.line.html">r.regression.line</a></em>,
-<em><a href="g.mlist.html">g.mlist</a></em>,
+<em><a href="g.list.html">g.list</a></em>,
<em><a href="g.region.html">g.region</a></em>
<h2>AUTHOR</h2>
Modified: grass-addons/grass7/raster/r.rock.stability/r.rock.stability.py
===================================================================
--- grass-addons/grass7/raster/r.rock.stability/r.rock.stability.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.rock.stability/r.rock.stability.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -231,7 +231,9 @@
F4 = f4 ,
quiet = True)
grass.run_command('g.remove' ,
- rast=(
+ flags='f',
+ type='rast',
+ name=(
'Asci' ,
'Arib' ,
'F1sci_' ,
@@ -321,7 +323,9 @@
quiet = True)
#elimino mappe
grass.run_command('g.remove' ,
- rast=(
+ flags='f',
+ type='rast',
+ name=(
'slopes_' ,
'aspects_' ,
'aspects_1' ,
@@ -356,7 +360,9 @@
quiet = True)
else:
grass.run_command('g.remove' ,
- rast=(
+ flags='f',
+ type='rast',
+ name=(
'slopes_' ,
'aspects_' ,
'aspects_1' ,
Modified: grass-addons/grass7/raster/r.roughness.vector/r.roughness.vector.py
===================================================================
--- grass-addons/grass7/raster/r.roughness.vector/r.roughness.vector.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.roughness.vector/r.roughness.vector.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -127,7 +127,7 @@
# cleaning up temp files
def cleanup():
rasts = ['aspect_compass','colat_angle','cosine_x','cosine_y','cosine_z','sum_Xcosine','sum_Ycosine','sum_Zcosine']
- grass.run_command('g.remove', flags = 'f', rast = rasts, quiet = True)
+ grass.run_command('g.remove', flags = 'bf', type = 'rast', name = rasts, quiet = True)
def main():
Modified: grass-addons/grass7/raster/r.soillossbare/r.soillossbare.py
===================================================================
--- grass-addons/grass7/raster/r.soillossbare/r.soillossbare.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.soillossbare/r.soillossbare.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -214,7 +214,9 @@
for tmprast in self.tmp_rast:
g.message('Removing "%s"' %tmprast)
remove = g.run_command('g.remove',
- rast = tmprast,
+ flags = 'f',
+ type = 'rast',
+ name = tmprast,
quiet = True)
return remove
Modified: grass-addons/grass7/raster/r.sun.daily/r.sun.daily.py
===================================================================
--- grass-addons/grass7/raster/r.sun.daily/r.sun.daily.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.sun.daily/r.sun.daily.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -152,7 +152,7 @@
if REMOVE or MREMOVE:
core.info(_("Cleaning temporary maps..."))
for rast in REMOVE:
- grass.run_command('g.remove', type='rast', pattern=rast, flags='f',
+ grass.run_command('g.remove', type='rast', name=rast, flags='f',
quiet=True)
for pattern in MREMOVE:
grass.run_command('g.remove', type='rast', pattern='%s*' % pattern,
Modified: grass-addons/grass7/raster/r.sun.daily/test.r.sun.daily.sh
===================================================================
--- grass-addons/grass7/raster/r.sun.daily/test.r.sun.daily.sh 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.sun.daily/test.r.sun.daily.sh 2014-10-28 23:11:08 UTC (rev 62460)
@@ -59,7 +59,7 @@
NAME="Map creation test"
r.sun.daily elev_in=terrain start_day=26 end_day=37 day_step=3 reflrad_basename=${map_basename}
-g.mlist -e type=rast pattern=${map_basename}_[0-9]{3} sep=newline > ${created_map_names_file}
+g.list -e type=rast pattern=${map_basename}_[0-9]{3} sep=newline > ${created_map_names_file}
diff ${map_names_file} ${created_map_names_file}
echo "$NAME: Diff returned $? (expecting 0)"
@@ -74,5 +74,5 @@
# clean
rm ${map_names_file} ${created_map_names_file}
-g.remove rast=`g.mlist -e type=rast pattern=${map_basename}_[0-9]{3} sep=,`
+g.remove -ef type=rast pattern=${map_basename}_[0-9]{3}
Modified: grass-addons/grass7/raster/r.sun.hourly/r.sun.hourly.py
===================================================================
--- grass-addons/grass7/raster/r.sun.hourly/r.sun.hourly.py 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.sun.hourly/r.sun.hourly.py 2014-10-28 23:11:08 UTC (rev 62460)
@@ -146,7 +146,7 @@
if len(TMP):
core.info(_("Cleaning %d temporary maps...") % len(TMP))
for rast in TMP:
- grass.run_command('g.remove', type='rast', pattern=rast, flags='f',
+ grass.run_command('g.remove', type='rast', name=rast, flags='f',
quiet=True)
Modified: grass-addons/grass7/raster/r.sun.hourly/test.r.sun.hourly.sh
===================================================================
--- grass-addons/grass7/raster/r.sun.hourly/test.r.sun.hourly.sh 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.sun.hourly/test.r.sun.hourly.sh 2014-10-28 23:11:08 UTC (rev 62460)
@@ -83,7 +83,7 @@
NAME="Map creation test"
r.sun.hourly elev_in=terrain start_time=11.50 end_time=20.00 time_step=3 day=80 reflrad_basename=${map_basename}
-g.mlist -e type=rast pattern=${map_basename}${map_number_separator}${map_number_pattern} sep=newline > ${created_map_names_file}
+g.list -e type=rast pattern=${map_basename}${map_number_separator}${map_number_pattern} sep=newline > ${created_map_names_file}
diff ${map_names_file} ${created_map_names_file}
echo "$NAME: Diff returned $? (expecting 0)"
@@ -91,7 +91,7 @@
NAME="Map creation test with too much decimal places"
r.sun.hourly elev_in=terrain start_time=7.0000 end_time=11.0000 time_step=1.3333 day=80 reflrad_basename=${decimal_map_basename}
-g.mlist -e type=rast pattern=${decimal_map_basename}${map_number_separator}${map_number_pattern} sep=newline > ${decimal_created_map_names_file}
+g.list -e type=rast pattern=${decimal_map_basename}${map_number_separator}${map_number_pattern} sep=newline > ${decimal_created_map_names_file}
diff ${decimal_map_names_file} ${decimal_created_map_names_file}
echo "$NAME: Diff returned $? (expecting 0)"
@@ -115,10 +115,10 @@
# clean
rm ${map_names_file} ${created_map_names_file}
-g.remove rast=`g.mlist -e type=rast pattern=${map_basename}${map_number_separator}${map_number_pattern} sep=,`
+g.remove -ef type=rast pattern=${map_basename}${map_number_separator}${map_number_pattern}
rm ${decimal_map_names_file} ${decimal_created_map_names_file}
-g.remove rast=`g.mlist -e type=rast pattern=${decimal_map_basename}${map_number_separator}${map_number_pattern} sep=,`
+g.remove -ef type=rast pattern=${decimal_map_basename}${map_number_separator}${map_number_pattern}
rm ${temporal_map_names_file} ${temporal_dataset_file} ${temporal_created_dataset_file} ${temporal_created_map_names_file}
t.remove -rf inputs=${temporal_map_basename}
Modified: grass-addons/grass7/raster/r.vol.dem/main.c
===================================================================
--- grass-addons/grass7/raster/r.vol.dem/main.c 2014-10-28 23:06:26 UTC (rev 62459)
+++ grass-addons/grass7/raster/r.vol.dem/main.c 2014-10-28 23:11:08 UTC (rev 62460)
@@ -897,7 +897,7 @@
/* TODO: KILL THIS AND REPLACE WITH NEAT --o OPTION CHECK */
/* remove output map, if exists */
- sprintf(tmp, "g.remove vect=%s", parm.output->answer);
+ sprintf(tmp, "g.remove -f type=vect name=%s", parm.output->answer);
error = system(tmp);
if (error != EXIT_SUCCESS) {
G_fatal_error("Error running command: %s", tmp);
More information about the grass-commit
mailing list