Skip to content

Easy way to set the compression level for all dataarrays in a datatree? #9352

@keewis

Description

@keewis

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 xarray-contrib/datatree#58 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions