Skip to content
Permalink
Browse files
disable SEXTANTE algorithms that require 3rd party Python modules
  • Loading branch information
alexbruy committed Feb 18, 2013
1 parent 9abb7c4 commit d31b83803a89f938c4b38f1d08d647ab143ac26b
Showing with 5 additions and 4 deletions.
  1. +5 −4 python/plugins/sextante/algs/QGISAlgorithmProvider.py
@@ -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
@@ -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)

3 comments on commit d31b838

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Feb 18, 2013

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

This comment has been minimized.

Copy link
Contributor Author

@alexbruy alexbruy replied Feb 18, 2013

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

This comment has been minimized.

Copy link
Contributor

@amitkulz amitkulz replied Feb 19, 2013

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.