-
-
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
Unify netCDF4 and scipy backends in the public API #333
Conversation
Fixes GH273 To serialize a dataset to a string/bytes, simply use `ds.to_netcdf()`. This behavior copies `DataFrame.to_csv()` from pandas. This change also adds support for writing datasets to a particular NETCDF4 group. The legacy `dump` and `dumps` methods are deprecated.
d4c1b09
to
e5f8a0e
Compare
d4d22f1
to
fc5d2e9
Compare
@@ -54,7 +54,7 @@ def _nc4_values_and_dtype(var): | |||
return var, dtype | |||
|
|||
|
|||
def _nc4_group(ds, group): | |||
def _nc4_group(ds, group, mode): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to have a way to list groups in a netCDF, to facilitate opening ... but that's probably future work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, it could be nice to have a full API for loading a set of datasets from groups. But not in this PR.
Unify netCDF4 and scipy backends in the public API
Fixes #273
and half of #272
To serialize a dataset to a string/bytes, simply use
ds.to_netcdf()
. This behavior copiesDataFrame.to_csv()
from pandas. The legacydump
anddumps
methods are deprecated.My main concern is that the default "format" option is depends on what dependencies the user has installed or if they are saving a file. That seems non-ideal, but may perhaps be the most pragmatic choice given the limitations of the netCDF4 format.
This change also adds:
CC @akleeman