Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

## [0.17.3] - 2025-11-27

### Features

- Compress zarr traces with zstd (Adrian Seyboldt)


## [0.17.2] - 2025-11-27

### Bug Fixes
Expand All @@ -13,6 +20,8 @@ All notable changes to this project will be documented in this file.

- Update pulp dependency (Adrian Seyboldt)

- Prepare release (Adrian Seyboldt)


## [0.17.1] - 2025-11-13

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nuts-rs"
version = "0.17.2"
version = "0.17.3"
authors = [
"Adrian Seyboldt <adrian.seyboldt@gmail.com>",
"PyMC Developers <pymc.devs@gmail.com>",
Expand Down
24 changes: 24 additions & 0 deletions src/storage/zarr/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::{collections::HashMap, num::NonZero};

use anyhow::Result;
use nuts_storable::{ItemType, Value};
use zarrs::array::codec::{BloscCodec, BloscCodecConfiguration, BloscCodecConfigurationV1};
use zarrs::array::{Array, ArrayBuilder, DataType, FillValue};
use zarrs::metadata_ext::data_type::NumpyTimeUnit;

Expand Down Expand Up @@ -232,7 +233,30 @@ pub fn create_arrays<TStorage: ?Sized>(
.chain(std::iter::once(draw_chunk_size))
.chain(extra_shape)
.collect();

let codec = {
if let Some(typesize) = zarr_type.fixed_size() {
let config = BloscCodecConfiguration::V1(BloscCodecConfigurationV1 {
cname: zarrs::array::codec::BloscCompressor::Zstd,
clevel: 3u8.try_into().unwrap(),
shuffle: zarrs::array::codec::BloscShuffleMode::Shuffle,
blocksize: 0,
typesize: Some(typesize),
});
BloscCodec::new_with_configuration(&config)?
} else {
let config = BloscCodecConfiguration::V1(BloscCodecConfigurationV1 {
cname: zarrs::array::codec::BloscCompressor::Zstd,
clevel: 3u8.try_into().unwrap(),
shuffle: zarrs::array::codec::BloscShuffleMode::NoShuffle,
blocksize: 0,
typesize: None,
});
BloscCodec::new_with_configuration(&config)?
}
};
let array = ArrayBuilder::new(shape, grid, zarr_type, fill_value)
.bytes_to_bytes_codecs(vec![Arc::new(codec)])
.dimension_names(Some(dims))
.build(store.clone(), &format!("{}/{}", group_path, name))?;
arrays.insert(name.to_string(), array);
Expand Down
Loading