Easy way to set the compression level for all dataarrays in a datatree?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
What is your issue?
Question Is there an easy/convenient way to set the compression level for all DataArrays in a datatree? I've been using the solution here when saving xarray.Datasets, but this solution doesn't seem to map conveniently to datatree. Maybe I'm missing something?
Background I often deal with multiple datasets, each on the order of 10 GBs, and this fills up harddrives fast. Typically when I write xarray.Datasets to file, I like to use gzip compression with level around 5, and this tends to reduce the file size by around 50%.
Thanks!
Edit: Or is recommended practice to update the compression info for each DataArray? (The second answer to the above link)
Originally posted by @jwbrooks0 in https://github.com/xarray-contrib/datatree/issues/58#issue-1103938449
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin by examining how datatree writes xarray.Datasets and how DataArray encoding is passed through; compare that with the linked per-variable encoding approach. Done means documenting or providing a convenient, consistent way to set gzip compression around level 5 across all DataArrays, or clearly stating the recommended per-DataArray practice.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100