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

Quantity wrapped Dask Arrays need deterministic hashing #1135

Closed
rpmanser opened this issue Jul 23, 2020 · 2 comments · Fixed by #1151
Closed

Quantity wrapped Dask Arrays need deterministic hashing #1135

rpmanser opened this issue Jul 23, 2020 · 2 comments · Fixed by #1151

Comments

@rpmanser
Copy link
Contributor

Based on xarray/#4208 (comment), Pint should implement deterministic hashing for Quantity wrapped Dask Arrays. This is a recommended step in implementing the Dask collection interface that I skipped in #1129.

This can be done in one of two ways: either implementing __dask_tokenize__ in the Quantity class, or registering a function with dask.base.normalize_token. The return value is the same. I'm wondering if there is a preference, since it seems that Pint tokenizes unit operations and I don't know if this would interfere with that. If there is no interference, I think __dask_tokenize__ would be better since it is cleaner.

I can follow up with a PR following any discussion.

@jthielen
Copy link
Contributor

Given no other feedback, I'd say go ahead and try it with __dask_tokenize__. I agree with you that it is cleaner.

@rpmanser
Copy link
Contributor Author

I'll put in a PR early next week

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

Successfully merging a pull request may close this issue.

2 participants