aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 84 forks source link

How can I enable writing to hdf5 with compression through hdf5-rust? #283

Closed CiaranWelsh closed 5 months ago

CiaranWelsh commented 5 months ago

Hello, I'm exploring the use hdf5-rust for storing my data, but it is rather large. I've noted that hdf5 has compression filters and that there is a zlib feature flag for hdf5. Could you give me a recommendation for how to use the compression features in hd5-rust?

(Or perhaps point me to appropriate documentation =] )

With thanks Ciaran

mulimoen commented 5 months ago

Compression must be enabled at variable creation time. Have a look at DatasetCreateBuilder::deflate. You might want to set chunk sizes as appropriate for your data access pattern.