Skip to content

Conversation

TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented Nov 30, 2022

@dcherian

@TomNicholas TomNicholas requested a review from dcherian November 30, 2022 18:03
Comment on lines +173 to +182
.. ipython::
:verbatim:

In [1]: ds1 = xr.Dataset({"a": 0})

In [2]: ds2 = xr.Dataset({"b": 1})

In [3]: ds1.to_netcdf("file.nc", group="A")

In [4]: ds2.to_netcdf("file.nc", group="B", mode="a")
Copy link
Member Author

Choose a reason for hiding this comment

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

I could actually execute this, but then the docs build will be writing and reading files, which might not be a good idea?

Comment on lines +233 to +235
For native handling of multiple groups with xarray, including I/O, you might be interested in the experimental
`xarray-datatree <https://github.com/xarray-contrib/datatree>`_ package.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this fine / appropriate / developed enough to mention here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think so!

Copy link
Contributor

@dcherian dcherian left a comment

Choose a reason for hiding this comment

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

Thanks! Looks great.

We could add a similar section under Zarr too in the future.

Comment on lines +233 to +235
For native handling of multiple groups with xarray, including I/O, you might be interested in the experimental
`xarray-datatree <https://github.com/xarray-contrib/datatree>`_ package.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think so!

@dcherian dcherian changed the title Example of writing and reading groups to netcdf Docs: add example of writing and reading groups to netcdf Dec 1, 2022
@TomNicholas TomNicholas added topic-documentation topic-DataTree Related to the implementation of a DataTree class labels Dec 1, 2022
@TomNicholas TomNicholas merged commit 43ec7a9 into pydata:main Dec 1, 2022
@TomNicholas TomNicholas deleted the groups_io_docs branch December 1, 2022 16:24
dcherian added a commit to dcherian/xarray that referenced this pull request Dec 2, 2022
* upstream/main: (39 commits)
  Support the new compression argument in netCDF4 > 1.6.0 (pydata#6981)
  Remove setuptools-scm-git-archive, require setuptools-scm>=7 (pydata#7253)
  Fix mypy failures (pydata#7343)
  Docs: add example of writing and reading groups to netcdf (pydata#7338)
  Reset file pointer to 0 when reading file stream (pydata#7304)
  Enable mypy warn unused ignores (pydata#7335)
  Optimize some copying (pydata#7209)
  Add parse_dims func (pydata#7051)
  Fix coordinate attr handling in `xr.where(..., keep_attrs=True)` (pydata#7229)
  Remove code used to support h5py<2.10.0 (pydata#7334)
  [pre-commit.ci] pre-commit autoupdate (pydata#7330)
  Fix PR number in what’s new (pydata#7331)
  Enable `origin` and `offset` arguments in `resample` (pydata#7284)
  fix doctests: supress urllib3 warning (pydata#7326)
  fix flake8 config (pydata#7321)
  implement Zarr v3 spec support (pydata#6475)
  Fix polyval overloads (pydata#7315)
  deprecate pynio backend (pydata#7301)
  mypy - Remove some ignored packages and modules (pydata#7319)
  Switch to T_DataArray in .coords (pydata#7285)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-DataTree Related to the implementation of a DataTree class topic-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants