[GRASS-SVN] r66696 - in grass-addons/grass7/raster/r.green/r.green.hydro: r.green.hydro.discharge r.green.hydro.financial r.green.hydro.optimal r.green.hydro.recommended r.green.hydro.structure r.green.hydro.technical r.green.hydro.theoretical
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Nov 1 22:18:49 PST 2015
Author: zarch
Date: 2015-11-01 22:18:49 -0800 (Sun, 01 Nov 2015)
New Revision: 66696
Modified:
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.discharge/r.green.hydro.discharge.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.structure/r.green.hydro.structure.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py
Log:
r.green: Fix undefine warning function introduced in r66681
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.discharge/r.green.hydro.discharge.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.discharge/r.green.hydro.discharge.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.discharge/r.green.hydro.discharge.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -182,7 +182,7 @@
from libgreen.utils import cleanup
from libhydro.basin import dtm_corr
except ImportError:
- warning('libgreen and libhydro not in the python path!')
+ gcore.warning('libgreen and libhydro not in the python path!')
if "GISBASE" not in os.environ:
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -513,8 +513,9 @@
try:
import numexpr as ne
except ImportError:
+ ne = None
warning('You should install numexpr to use this module: '
- 'pip install numexpr')
+ 'pip install numexpr')
try:
# set python path to the shared r.green libraries
@@ -595,8 +596,9 @@
def get_cnames(expr,
- _names_cache=ne.utils.CacheDict(256),
- _numexpr_cache=ne.utils.CacheDict(256), **kwargs):
+ _names_cache=ne.utils.CacheDict(256) if ne else ne,
+ _numexpr_cache=ne.utils.CacheDict(256) if ne else ne,
+ **kwargs):
if not isinstance(expr, (str, unicode)):
raise ValueError("must specify expression as a string")
# Get the names for this expression
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -118,7 +118,7 @@
from libhydro.optimal import write_plants
from libhydro.optimal import write_points
except ImportError:
- warning('libgreen and libhydro not in the python path!')
+ gcore.warning('libgreen and libhydro not in the python path!')
##################################################
# optimization problem
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -205,7 +205,7 @@
# finally import the module in the library
from libgreen.utils import cleanup
except ImportError:
- warning('libgreen and libhydro not in the python path!')
+ gcore.warning('libgreen and libhydro not in the python path!')
if "GISBASE" not in os.environ:
print("You must be in GRASS GIS to run this program.")
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.structure/r.green.hydro.structure.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.structure/r.green.hydro.structure.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.structure/r.green.hydro.structure.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -133,7 +133,7 @@
import atexit
from grass.exceptions import ParameterError
-from grass.script.core import parser, overwrite
+from grass.script.core import parser, overwrite, warning
from grass.pygrass.utils import set_path
from grass.pygrass.raster import RasterRow
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -234,7 +234,7 @@
from libgreen.utils import cleanup
from libhydro.optimal import conv_segpoints
except ImportError:
- warning('libgreen and libhydro not in the python path!')
+ gcore.warning('libgreen and libhydro not in the python path!')
DEBUG = False
TMPRAST = []
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py 2015-11-01 22:44:41 UTC (rev 66695)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py 2015-11-02 06:18:49 UTC (rev 66696)
@@ -114,7 +114,7 @@
from libgreen.utils import raster2numpy
from libgreen.utils import remove_pixel_from_raster
except ImportError:
- warning('libgreen and libhydro not in the python path!')
+ gcore.warning('libgreen and libhydro not in the python path!')
if "GISBASE" not in os.environ:
More information about the grass-commit
mailing list