浏览代码

libtemporal: simplify percent() calls in dataset_mapcalculator() (merge https://trac.osgeo.org/grass/changeset/69998 from trunk)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@70000 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 年之前
父节点
当前提交
451f00bba5
共有 1 个文件被更改,包括 2 次插入6 次删除
  1. 2 6
      lib/python/temporal/mapcalc.py

+ 2 - 6
lib/python/temporal/mapcalc.py

@@ -196,8 +196,7 @@ def dataset_mapcalculator(inputs, output, type, expression, base, method,
         for i in range(num):
 
             count += 1
-            if count % 10 == 0:
-                msgr.percent(count, num, 1)
+            msgr.percent(count, num, 10)
 
             # Create the r.mapcalc statement for the current time step
             map_name = "{base}_{suffix}".format(base=base,
@@ -294,8 +293,7 @@ def dataset_mapcalculator(inputs, output, type, expression, base, method,
         for new_map in map_list:
 
             count += 1
-            if count % 10 == 0:
-                msgr.percent(count, num, 1)
+            msgr.percent(count, num, 10)
 
             # Read the map data
             new_map.load()
@@ -315,8 +313,6 @@ def dataset_mapcalculator(inputs, output, type, expression, base, method,
         # Update the spatio-temporal extent and the metadata table entries
         new_sp.update_from_registered_maps(dbif)
 
-        msgr.percent(1, 1, 1)
-
         # Remove empty maps
         if len(empty_maps) > 0:
             names = ""