Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
disable SEXTANTE algorithms that require 3rd party Python modules
  • Loading branch information
alexbruy committed Feb 18, 2013
1 parent 9abb7c4 commit d31b838
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/plugins/sextante/algs/QGISAlgorithmProvider.py
Expand Up @@ -30,7 +30,7 @@
import os
from PyQt4 import QtGui
from sextante.algs.RasterLayerHistogram import RasterLayerHistogram
#from sextante.algs.StatisticsByCategories import StatisticsByCategories
from sextante.algs.StatisticsByCategories import StatisticsByCategories
from sextante.algs.ftools.PointsInPolygon import PointsInPolygon
from sextante.algs.ftools.PointsInPolygonUnique import PointsInPolygonUnique
from sextante.algs.ftools.PointsInPolygonWeighted import PointsInPolygonWeighted
Expand Down Expand Up @@ -119,10 +119,11 @@ def __init__(self):
mmqgisx_select_algorithm(),
mmqgisx_text_to_float_algorithm(),
#raster
CreateConstantRaster(), RasterLayerStatistics(),
CreateConstantRaster(), RasterLayerStatistics()
#graphics
VectorLayerHistogram(), VectorLayerScatterplot(), RasterLayerHistogram(),
MeanAndStdDevPlot(), BarPlot(), PolarPlot()]
#VectorLayerHistogram(), VectorLayerScatterplot(), RasterLayerHistogram(),
#MeanAndStdDevPlot(), BarPlot(), PolarPlot()
]

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
Expand Down

3 comments on commit d31b838

@slarosa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.