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

Add HDF5 Section to read/write docs page #8012

Merged
merged 7 commits into from
Jul 24, 2023
Merged

Add HDF5 Section to read/write docs page #8012

merged 7 commits into from
Jul 24, 2023

Conversation

rwegener2
Copy link
Contributor

Overview

This PR adds an HDF5 section to the "Reading and Writing Files" section of the documentation. It discusses the features and limitations of opening HDF5 data in xarray.

PR spun out of discussion #6299.

  • Adds documentation

Discussion

To keep in line with other sections it would make sense to speak to xarray's ability to write HDF5 data. The .to_netcdf() function does write files that can be read with HDF5 cli tools, which makes sense given that (as I understand it) a netCDF4 file is a slightly stricter implementation of the HDF5 data model. The netCDF4 docs even say:

The HDF5 Files produced by netCDF-4 are perfectly respectable HDF5 files, and can be read by any HDF5 application

Still, it seems odd to recommend users write HDF5 files with a function called .to_netcdf(). What do others think the proper tone is to take for writing files? Encourage .to_netcdf()? Mention it cautiously? Ignore it all together?

@welcome
Copy link

welcome bot commented Jul 21, 2023

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our contributing guidelines.

@rwegener2 rwegener2 changed the title Read hdf docs Add HDF5 Section to read/write docs page Jul 21, 2023
@dcherian
Copy link
Contributor

Thanks @rwegener2 This is a great first PR! Welcome.

it seems odd to recommend users write HDF5 files with a function called .to_netcdf(). What do others think the proper tone is to take for writing files? Encourage .to_netcdf()?

I think its OK to encourage to_netcdf. Xarray is built around the netCDF4 model.

@rwegener2
Copy link
Contributor Author

I think its OK to encourage to_netcdf. Xarray is built around the netCDF4 model.

Sounds good @dcherian! I added a sentence for writing HDF5 data.

Let me know if there is anything else that should change, otherwise I think it's done.

@dcherian
Copy link
Contributor

I think this is great. Thanks @rwegener2! This is a great first contribution, and it address one of the top 3 questions new users ask about Xarray (in my experience).

Welcome to Xarray

@dcherian dcherian enabled auto-merge (squash) July 24, 2023 21:12
@dcherian dcherian merged commit 88315fd into pydata:main Jul 24, 2023
27 checks passed
@welcome
Copy link

welcome bot commented Jul 24, 2023

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

@rwegener2
Copy link
Contributor Author

Thanks @dcherian! Happy to be here and so happy my first PR could be a useful one!

dcherian added a commit to dcherian/xarray that referenced this pull request Jul 24, 2023
…lazy-array

* upstream/main: (153 commits)
  Add HDF5 Section to read/write docs page (pydata#8012)
  [pre-commit.ci] pre-commit autoupdate (pydata#8014)
  Update interpolate_na in dataset.py (pydata#7974)
  improved docstring of to_netcdf (issue pydata#7127) (pydata#7947)
  Expose "Coordinates" as part of Xarray's public API (pydata#7368)
  Core team member guide (pydata#7999)
  join together duplicate entries in the text `repr` (pydata#7225)
  Update copyright year in README (pydata#8007)
  Allow opening datasets with nD dimenson coordinate variables. (pydata#7989)
  Move whats-new entry
  [pre-commit.ci] pre-commit autoupdate (pydata#7997)
  Add documentation on custom indexes (pydata#6975)
  Use variable name in all exceptions raised in `as_variable` (pydata#7995)
  Bump pypa/gh-action-pypi-publish from 1.8.7 to 1.8.8 (pydata#7994)
  New whatsnew section
  Remove future release notes before this release
  Update whats-new.rst for new release (pydata#7993)
  Remove hue_style from plot1d docstring (pydata#7925)
  Add new what's new section (pydata#7986)
  Release summary for v2023.07.0 (pydata#7979)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants