Skip to content

Commit

Permalink
Move dask_client to orangecontrib.spectroscopy.__init__
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Oct 12, 2023
1 parent 6a3315f commit ac4a467
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 10 additions & 0 deletions orangecontrib/spectroscopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions orangecontrib/spectroscopy/widgets/owspectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit ac4a467

Please sign in to comment.