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

DOC: zarr note on encoding #5427

Merged
merged 2 commits into from
Jun 21, 2021
Merged

DOC: zarr note on encoding #5427

merged 2 commits into from
Jun 21, 2021

Conversation

raybellwaves
Copy link
Contributor

@raybellwaves raybellwaves commented Jun 2, 2021

It took me a while to realize this so I wanted to make a note in the docs for myself in the future and others uses.

I was playing with pint-xarray and I couldn't work out why I couldn't round trip a file (xarray-contrib/pint-xarray#109). It turns out the DataArray had an enconding attribute which was being used (and overriding my unit conversion). In addition, I was also scratching my head for a while as to where my zarr store was getting chunks from which didn't correspomd to my numpy array (#5407).

This PR just makes a note of the importance of encoding attribute of DataArray(s) when writing to a zarr store.

docs page change is here: https://xray--5427.org.readthedocs.build/en/5427/generated/xarray.Dataset.to_zarr.html?highlight=zarr#xarray.Dataset.to_zarr

@max-sixty
Copy link
Collaborator

There's some confusion over this, so the docs are welcome, as ever, @raybellwaves . There are also some plans to make the functionality less confusing.

I'll let someone take a glance who's an expert, though.

xarray/core/dataset.py Outdated Show resolved Hide resolved
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
@raybellwaves
Copy link
Contributor Author

FYI larger issue is open at #5082

@dcherian
Copy link
Contributor

Thanks @raybellwaves

@dcherian dcherian merged commit 6a101a9 into pydata:master Jun 21, 2021
@github-actions
Copy link
Contributor

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 6a101a9. ± Comparison against base commit 6a101a9.

dcherian added a commit to dcherian/xarray that referenced this pull request Jun 23, 2021
* main:
  Improve error message for guess engine (pydata#5455)
  Refactor dataset groupby tests (pydata#5506)
  DOC: zarr note on encoding (pydata#5427)
  Allow plotting categorical data (pydata#5464)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants