-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tools for converting between xray.Dataset and nested dictionaries/JSON #432
Comments
Is this still of interest? I was thinking it would look something like this:
|
Yes, I think this is still of interest, though of course the devil is in the details.
My inclinations:
|
I agree. .3. Couldn't this make the
|
Which use cases for this functionality would want the numpy/dask array? If you're planning on serializing to JSON or a similar format, then you'll need to add a custom decoder/encoder to handle arrays.
Yes, we should preserve the name is possible (serialization formats are much more useful if they are not lossy). Fortunately, |
Ok. That makes sense. I added a function to common and submitted a pull request: #917 |
Fixed by #917 |
This came up in discussion with @freeman-lab -- xray does not have direct support for converting datasets to or from nested dictionaries (i.e., as could be serialized in JSON).
This is quite straightforward to implement oneself, of course, but there's something to be said for making this more obvious. I'm thinking of a serialization format that looks something like this:
The solution here would be to either:
xray.Dataset.to_dict
/xray.read_dict
.The text was updated successfully, but these errors were encountered: