Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dask not importing sharedict automatically in dask 1.1+ #589

Merged
merged 1 commit into from Jan 23, 2019

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Jan 23, 2019

Sharedict will be deprecated in dask in the future. As part of those changes the sharedict module is no longer automatically included as part of import dask with use dask.sharedict. See dask/dask#4417 for migration changes needed in the future.

@djhoese djhoese added the bug label Jan 23, 2019
@djhoese djhoese self-assigned this Jan 23, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 77.446% when pulling 8847911 on djhoese:bugfix-dask-sharedict into 630cc37 on pytroll:master.

@codecov
Copy link

codecov bot commented Jan 23, 2019

Codecov Report

Merging #589 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #589      +/-   ##
==========================================
+ Coverage   77.44%   77.44%   +<.01%     
==========================================
  Files         136      136              
  Lines       19153    19154       +1     
==========================================
+ Hits        14833    14834       +1     
  Misses       4320     4320
Impacted Files Coverage Δ
satpy/multiscene.py 79.12% <100%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 630cc37...8847911. Read the comment docs.

@djhoese djhoese merged commit d011adf into pytroll:master Jan 23, 2019
@djhoese djhoese deleted the bugfix-dask-sharedict branch January 23, 2019 15:04
@Soumyajaganathan
Copy link

Here, I am just trying to fit the large dataset with Incremental in DASK. But I am getting error like this,

from dask_ml.datasets
import make_classification
from dask_ml.wrappers import Incremental
from sklearn.linear_model import SGDClassifier
from dask.distributed import client
import dask
X, y = make_classification(chunks=25)
estimator = SGDClassifier(random_state=10)
clf = Incremental(estimator,shuffle_blocks=True,random_state=0)
clf.fit(X, y)
Error:
--> 197 new_dsk = dask.sharedict.merge((name, dsk), x.dask, getattr(y, "dask", {}))
198 value = Delayed((name, nblocks - 1), new_dsk)
199

AttributeError: module 'dask' has no attribute 'sharedict'

Then I imported sharedict from DASK to fix this,
from dask_ml.datasets
import make_classification
from dask_ml.wrappers import Incremental
from sklearn.linear_model import SGDClassifier
from dask.distributed
import client import dask.sharedict
import dask import dask.delayed
from toolz import merge
from toolz import partial
rom dask.delayed import Delayed
X, y = make_classification(chunks=25)
estimator = SGDClassifier(random_state=10)
clf = Incremental(estimator,shuffle_blocks=True,random_state=0)
clf.fit(X, y)
Error:
~/.local/lib/python3.6/site-packages/dask/base.py in _extract_graph_and_keys(vals)
210 graph = HighLevelGraph.merge(*graphs)
211 else:
--> 212 graph = merge(*graphs)
213
214 return graph, keys

~/.local/lib/python3.6/site-packages/toolz/dicttoolz.py in merge(*dicts, **kwargs)
37 rv = factory()
38 for d in dicts:
---> 39 rv.update(d)
40 return rv
41

ValueError: dictionary update sequence element #0 has length 36; 2 is required

Help me to fix this,

@djhoese
Copy link
Member Author

djhoese commented Feb 7, 2019

@Soumyajaganathan What version of satpy are you using? Wait, is this not a satpy error?

@Soumyajaganathan
Copy link

Thanks for the response. The problem is I didn't update my DASK. Now, its working good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants