Skip to content

Commit

Permalink
Rename Zarr::compression_params_ to Zarr::blosc_compression_params_.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Sep 21, 2023
1 parent bd64020 commit 2400daf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/zarr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ zarr::Zarr::reserve_image_shape(const ImageShape* shape)

zarr::Zarr::Zarr(BloscCompressionParams&& compression_params)
{
compression_params_ = std::move(compression_params);
blosc_compression_params_ = std::move(compression_params);
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/zarr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct Zarr : StorageInterface
StoragePropertyMetadata::storage_property_metadata_chunking_s;

/// static - set on construction
std::optional<BloscCompressionParams> compression_params_;
std::optional<BloscCompressionParams> blosc_compression_params_;

/// changes on set
fs::path dataset_root_;
Expand Down
8 changes: 4 additions & 4 deletions src/zarr.v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ zarr::ZarrV2::allocate_writers_()
const auto& tile_shape = image_tile_shapes_.at(i).second;
uint64_t bytes_per_tile =
common::bytes_per_tile(tile_shape, pixel_type_);
if (compression_params_.has_value()) {
if (blosc_compression_params_.has_value()) {
writers_.push_back(std::make_shared<ChunkWriter>(
image_shape,
tile_shape,
(uint32_t)(max_bytes_per_chunk_ / bytes_per_tile),
(get_data_directory_() / std::to_string(i)).string(),
this,
compression_params_.value()));
blosc_compression_params_.value()));
} else {
writers_.push_back(std::make_shared<ChunkWriter>(
image_shape,
Expand Down Expand Up @@ -120,8 +120,8 @@ zarr::ZarrV2::write_array_metadata_(size_t level) const
{ "dimension_separator", "/" },
};

if (compression_params_.has_value()) {
zarray_attrs["compressor"] = compression_params_.value();
if (blosc_compression_params_.has_value()) {
zarray_attrs["compressor"] = blosc_compression_params_.value();
} else {
zarray_attrs["compressor"] = nullptr;
}
Expand Down
8 changes: 4 additions & 4 deletions src/zarr.v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ zarr::ZarrV3::allocate_writers_()
uint64_t bytes_per_tile = common::bytes_per_tile(tile_dims, pixel_type_);

writers_.clear();
if (compression_params_.has_value()) {
if (blosc_compression_params_.has_value()) {
writers_.push_back(std::make_shared<ShardWriter>(
frame_dims,
shard_dims_,
tile_dims,
(uint32_t)(max_bytes_per_chunk_ / bytes_per_tile),
(get_data_directory_() / "0").string(),
this,
compression_params_.value()));
blosc_compression_params_.value()));
} else {
writers_.push_back(std::make_shared<ShardWriter>(
frame_dims,
Expand Down Expand Up @@ -184,8 +184,8 @@ zarr::ZarrV3::write_array_metadata_(size_t level) const
image_dims.cols, // x
});

if (compression_params_.has_value()) {
auto params = compression_params_.value();
if (blosc_compression_params_.has_value()) {
auto params = blosc_compression_params_.value();
metadata["compressor"] = json::object({
{ "codec", "https://purl.org/zarr/spec/codec/blosc/1.0" },
{ "configuration",
Expand Down

0 comments on commit 2400daf

Please sign in to comment.