diff --git a/orangecontrib/spectroscopy/__init__.py b/orangecontrib/spectroscopy/__init__.py index 33b873f8d..91e69353b 100644 --- a/orangecontrib/spectroscopy/__init__.py +++ b/orangecontrib/spectroscopy/__init__.py @@ -22,3 +22,13 @@ def get_sample_datasets_dir(): Orange.data.table.dataset_dirs.append(get_sample_datasets_dir()) + + +try: + import dask + import dask.distributed + dask_client = dask.distributed.Client(processes=False, n_workers=2, + dashboard_address=None) +except ImportError: + dask = None + dask_client = None \ No newline at end of file diff --git a/orangecontrib/spectroscopy/widgets/owspectra.py b/orangecontrib/spectroscopy/widgets/owspectra.py index 4558d0bc0..deaa05d43 100644 --- a/orangecontrib/spectroscopy/widgets/owspectra.py +++ b/orangecontrib/spectroscopy/widgets/owspectra.py @@ -9,9 +9,6 @@ try: import dask import dask.array as da - import dask.distributed - dask_client = dask.distributed.Client(processes=False, n_workers=2, - threads_per_worker=4, dashboard_address=None) except ImportError: dask = None @@ -46,6 +43,7 @@ from Orange.widgets.visualize.utils.plotutils import HelpEventDelegate, PlotWidget from Orange.widgets.visualize.utils.customizableplot import CommonParameterSetter +from orangecontrib.spectroscopy import dask_client from orangecontrib.spectroscopy.data import getx from orangecontrib.spectroscopy.utils import apply_columns_numpy from orangecontrib.spectroscopy.widgets.line_geometry import \