Skip to content

Commit d31b838

Browse files
committedFeb 18, 2013
disable SEXTANTE algorithms that require 3rd party Python modules
1 parent 9abb7c4 commit d31b838

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎python/plugins/sextante/algs/QGISAlgorithmProvider.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import os
3131
from PyQt4 import QtGui
3232
from sextante.algs.RasterLayerHistogram import RasterLayerHistogram
33-
#from sextante.algs.StatisticsByCategories import StatisticsByCategories
33+
from sextante.algs.StatisticsByCategories import StatisticsByCategories
3434
from sextante.algs.ftools.PointsInPolygon import PointsInPolygon
3535
from sextante.algs.ftools.PointsInPolygonUnique import PointsInPolygonUnique
3636
from sextante.algs.ftools.PointsInPolygonWeighted import PointsInPolygonWeighted
@@ -119,10 +119,11 @@ def __init__(self):
119119
mmqgisx_select_algorithm(),
120120
mmqgisx_text_to_float_algorithm(),
121121
#raster
122-
CreateConstantRaster(), RasterLayerStatistics(),
122+
CreateConstantRaster(), RasterLayerStatistics()
123123
#graphics
124-
VectorLayerHistogram(), VectorLayerScatterplot(), RasterLayerHistogram(),
125-
MeanAndStdDevPlot(), BarPlot(), PolarPlot()]
124+
#VectorLayerHistogram(), VectorLayerScatterplot(), RasterLayerHistogram(),
125+
#MeanAndStdDevPlot(), BarPlot(), PolarPlot()
126+
]
126127

127128
def initializeSettings(self):
128129
AlgorithmProvider.initializeSettings(self)

3 commit comments

Comments
 (3)

slarosa commented on Feb 18, 2013

@slarosa
Member

Hi Alexander,
for users who want use those algs this is too restrictive, Could we find a way to check if 3rd party modules are installed in system ?
it would be nice to warn the user that in sextante are available more algs but they requires the following 3rd party modules.....

Something like this:

try:
  import third_party_module
  third_party_module_loaded = True
except ImportError:
  third_party_module_loaded = False 

if third_party_module_loaded:
  load_algs

I would use those algs ! Thanks !

alexbruy commented on Feb 18, 2013

@alexbruy
ContributorAuthor

This is temporary solution, currently SEXTANTE won't load for many users without scipy and matplotlib installed. I agree that run-time check for dependencies is much better and will try to implement it.

amitkulz commented on Feb 19, 2013

@amitkulz
Contributor

aha... this was helpful in figuring out how to stop runtime sextante related errors during qgis startup (Fedora 18). now qgis is setup properly on this machine.

Please sign in to comment.