[GRASS-SVN] r38347 - grass-addons/vector/v.krige

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 10 08:51:46 EDT 2009


Author: aghisla
Date: 2009-07-10 08:51:45 -0400 (Fri, 10 Jul 2009)
New Revision: 38347

Modified:
   grass-addons/vector/v.krige/v.krige.py
Log:
removed gstat hooks and the trycatch around gstat::vgm(), won't crash there but at initial dependency checks.


Modified: grass-addons/vector/v.krige/v.krige.py
===================================================================
--- grass-addons/vector/v.krige/v.krige.py	2009-07-10 12:38:56 UTC (rev 38346)
+++ grass-addons/vector/v.krige/v.krige.py	2009-07-10 12:51:45 UTC (rev 38347)
@@ -46,7 +46,7 @@
 #%option
 #% key: package
 #% type: string
-#% options: gstat, geor
+#% options: gstat
 #% answer: gstat
 #% description: R package to use
 #% required: no
@@ -109,7 +109,7 @@
 
 # R packages gstat or geoR
 try:
-    robjects.r.require("gstat") or robjects.r.require("geoR")
+    robjects.r.require("gstat") # or robjects.r.require("geoR") #@TODO: enable it one day.
 except:
     sys.exit(_("No gstat neither geoR package installed. Install one of them (gstat preferably) via R installer."))
 ###########
@@ -260,7 +260,7 @@
                                         FN.FNB_NO_NAV_BUTTONS |
                                         FN.FNB_FANCY_TABS | FN.FNB_NO_X_BUTTON)
         
-        for Rpackage in ["gstat", "geoR"]:
+        for Rpackage in ["gstat"]: # , "geoR"]: #@TODO: enable it when it'll be implemented.
             self.CreatePage(package = Rpackage)
         
         #@TODO(anne): check this dependency at the beginning.
@@ -418,14 +418,10 @@
             getattr(self, n+"Ctrl").Enable(False)
         self.VariogramSizer.Insert(2, self.VariogramCheckBox , proportion=0, flag=wx.EXPAND | wx.ALL, border=3)
         self.VariogramCheckBox.Bind(wx.EVT_CHECKBOX, self.HideOptions)
+
+        ModelFactor = robjects.r.vgm().r['long']
+        ModelList = robjects.r.levels(ModelFactor[0]) # no other way to let the Python pick it up..
         
-        try:
-            ModelFactor = robjects.r.vgm().r['long']
-            ModelList = robjects.r.levels(ModelFactor[0]) # no other way to let the Python pick it up..
-        except AttributeError, e:
-            print >> sys.stderr, 'Error: ' + str(e)
-            ModelList = []
-        
         self.ParametersSizer.Insert(before=0, item=wx.StaticText(self, id= wx.ID_ANY, label = _("Variogram model")))
         self.ModelChoicebox = wx.Choice(self, id=wx.ID_ANY, choices=ModelList)
         self.ModelChoicebox.Enable(False) # by default 



More information about the grass-commit mailing list