diff --git a/qstack/__init__.py b/qstack/__init__.py index 71bb664..71127b6 100644 --- a/qstack/__init__.py +++ b/qstack/__init__.py @@ -9,6 +9,7 @@ from qstack import mathutils from qstack import orcaio +# qstack.regression needs sklearn to work try: import sklearn except ImportError: @@ -16,3 +17,21 @@ else: from qstack import regression del sklearn + +# qstack.qml is in a different python package +# but prefer "the local version of it" if we are in a development environment, and both sources are there. +import os +_qstack_qml_path = os.path.join(os.path.dirname(__file__), 'qstack-qml') +if os.path.isfile(os.path.join(_qstack_qml_path, 'qstack_qml', '__init__.py')): + import sys + sys.path.insert(0,_qstack_qml_path) + import qstack_qml as qml + sys.path.pop(0) + del sys +else: + try: + import qstack_qml as qml + except ImportError: + pass +del os, _qstack_qml_path + \ No newline at end of file