[GRASS-SVN] r71823 - grass-addons/grass7/raster/r.fidimo
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Nov 25 06:48:13 PST 2017
Author: wenzeslaus
Date: 2017-11-25 06:48:13 -0800 (Sat, 25 Nov 2017)
New Revision: 71823
Modified:
grass-addons/grass7/raster/r.fidimo/r.fidimo.py
Log:
r.fidimo: lazy import numpy and scipy (scipy is not a build/core dependency)
Modified: grass-addons/grass7/raster/r.fidimo/r.fidimo.py
===================================================================
--- grass-addons/grass7/raster/r.fidimo/r.fidimo.py 2017-11-25 13:11:08 UTC (rev 71822)
+++ grass-addons/grass7/raster/r.fidimo/r.fidimo.py 2017-11-25 14:48:13 UTC (rev 71823)
@@ -202,14 +202,9 @@
import grass.script.setup as gsetup
import grass.script.array as garray
+# lazy imports: numpy and scipy
-# import required numpy/scipy modules
-import numpy
-from scipy import stats
-from scipy import optimize
-
-
tmp_map_rast = None
tmp_map_vect = None
@@ -230,7 +225,12 @@
def main():
-
+
+ # lazy import required numpy and scipy modules
+ import numpy
+ from scipy import stats
+ from scipy import optimize
+
############ DEFINITION CLEANUP TEMPORARY FILES ##############
#global variables for cleanup
global tmp_map_rast
More information about the grass-commit
mailing list