-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
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:
{
'variables': {
'temperature': {
'dimensions': ['x'],
'data': [1, 2, 3],
'attributes': {}
}
...
}
'attributes': {
'title': 'My example dataset',
...
}
}
The solution here would be to either:
- add a few examples to the IO documentation of how to roll this one-self, or
- create a few helper methods/functions to make this even easier:
xray.Dataset.to_dict
/xray.read_dict
.