[GRASS-SVN] r71020 - grass-addons/grass7/raster/r.object.activelearning

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 4 01:40:45 PDT 2017


Author: mlennert
Date: 2017-05-04 01:40:45 -0700 (Thu, 04 May 2017)
New Revision: 71020

Modified:
   grass-addons/grass7/raster/r.object.activelearning/r.object.activelearning.py
Log:
r.object.activelearning: Import grass libraries before calling them

Modified: grass-addons/grass7/raster/r.object.activelearning/r.object.activelearning.py
===================================================================
--- grass-addons/grass7/raster/r.object.activelearning/r.object.activelearning.py	2017-05-04 07:29:38 UTC (rev 71019)
+++ grass-addons/grass7/raster/r.object.activelearning/r.object.activelearning.py	2017-05-04 08:40:45 UTC (rev 71020)
@@ -95,6 +95,11 @@
 #%end
 
 
+try : # You can run the tests outside of grass where those imports are not available
+	import grass as grass
+	import grass.script as gcore
+except ImportError :
+	pass
 
 try :
 	from sklearn import svm
@@ -106,12 +111,6 @@
 except ImportError :
 	gcore.fatal("This module requires the scikit-learn python package. Please install it.")
 
-try : # You can run the tests outside of grass where those imports are not available
-	import grass as grass
-	import grass.script as gcore
-except ImportError :
-	pass
-
 import numpy as np 
 import scipy 
 import os.path



More information about the grass-commit mailing list