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

Initial hack to get dask distributed working #1083

Closed
wants to merge 2 commits into from

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Nov 6, 2016

WIP WIP WIP

CC
@mrocklin
@pwolfram

xref #798

if type_ is not None:
header['type'] = type_
array = distributed.protocol.deserialize(header, frames)
return CharToStringArray(array)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any objection if I change this (and the other similar functions) to use the sub-types list solution?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be fine, but these classes (other than LazilyIndexedArray) are not going to be layered multiple times. So I wouldn't worry too much about that until we settle on a general solution.

@mrocklin
Copy link
Contributor

mrocklin commented Nov 7, 2016

It occurs to me after reading your DataStore API issue that we could also just implement getstate/setstate methods on all of the wrapping classes (like LazilyIndexedArray) that thought about how to serialize their contained arrays. You wouldn't have to use dask's mechanism.

You would still have to figure out how to effectively serialize and deserialize any contained object, which is the same problem we're solving at dask/distributed#620 , but could stick to the pickle protocol if you wanted to stay with more general and established protocols. You are reaching down a little bit in the object tree further than was intended, but that might be a more palatable long term solution for xarray?

@mrocklin
Copy link
Contributor

mrocklin commented Nov 7, 2016

Not that I'm recommending this, just that it is another option.

@shoyer
Copy link
Member Author

shoyer commented Nov 7, 2016

It occurs to me after reading your DataStore API issue that we could also just implement getstate/setstate methods on all of the wrapping classes (like LazilyIndexedArray) that thought about how to serialize their contained arrays. You wouldn't have to use dask's mechanism.

If I understand correctly, I could even just go to the bottom level, and make NetCDF4ArrayWrapper pickle-able, using a similar strategy to the one in the dask-distributed PR.

This does seem a little more palatable in the long term, especially if we build some more general machinery that DataStores can plug into (added into #1087)

@shoyer
Copy link
Member Author

shoyer commented Nov 9, 2016

Closing in favor of #1095

@shoyer shoyer closed this Nov 9, 2016
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 this pull request may close these issues.

2 participants