From 7851ce6cc0de20c06d654eafdbba6129d952c0ff Mon Sep 17 00:00:00 2001 From: Lachlan Deakin Date: Wed, 1 Jan 2025 13:17:54 +1100 Subject: [PATCH] refactor!: make `VLenV2Codec` private, add `VLen{Array,Bytes,Utf8}Codec` (#119) --- CHANGELOG.md | 2 + zarrs/doc/status/codecs_experimental.md | 24 ++- zarrs/src/array/codec/array_to_bytes.rs | 6 +- .../array/codec/array_to_bytes/vlen_array.rs | 5 + .../vlen_array/vlen_array_codec.rs | 3 + .../array/codec/array_to_bytes/vlen_bytes.rs | 5 + .../vlen_bytes/vlen_bytes_codec.rs | 3 + .../array/codec/array_to_bytes/vlen_utf8.rs | 5 + .../vlen_utf8/vlen_utf8_codec.rs | 3 + .../src/array/codec/array_to_bytes/vlen_v2.rs | 36 ++-- .../array_to_bytes/vlen_v2/vlen_v2_codec.rs | 22 +-- .../array_to_bytes/vlen_v2/vlen_v2_macros.rs | 176 ++++++++++++++++++ zarrs/src/config.rs | 1 - zarrs/tests/cities.rs | 12 +- zarrs_metadata/CHANGELOG.md | 3 + .../src/v2/array/codec/vlen_array.rs | 2 +- .../src/v2/array/codec/vlen_bytes.rs | 2 +- .../src/v2/array/codec/vlen_utf8.rs | 2 +- zarrs_metadata/src/v2_to_v3.rs | 7 +- zarrs_metadata/src/v3/array.rs | 4 +- 20 files changed, 256 insertions(+), 67 deletions(-) create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_array.rs create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_array/vlen_array_codec.rs create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_bytes.rs create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_bytes/vlen_bytes_codec.rs create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_utf8.rs create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_utf8/vlen_utf8_codec.rs create mode 100644 zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_macros.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 08437eca..d11bae77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `ArrayShardedReadableExt::inner_chunk_byte_range` - Add `ArrayShardedExt::is_exclusively_sharded` - Add `ArrayShardedReadableExtCache::array_is_exclusively_sharded` +- Add `Vlen{Array,Bytes,Utf8}Codec`, replacing `VlenV2Codec` ### Changed - **Breaking**: Seal `Array` extension traits: `ArraySharded[Readable]Ext` and `ArrayChunkCacheExt` @@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Breaking**: Add `ArrayError::UnsupportedMethod` - **Breaking**: Rename `DataType::Binary` to `Bytes` for compatibility with `zarr-python` - **Breaking**: Make `array::codec::array_to_bytes::bytes::reverse_endianness` private +- **Breaking**: Make `VlenV2Codec` private ### Fixed - Cleanup unnecessary lifetime constraints in partial decoders diff --git a/zarrs/doc/status/codecs_experimental.md b/zarrs/doc/status/codecs_experimental.md index 8ba443ca..f1ec44f1 100644 --- a/zarrs/doc/status/codecs_experimental.md +++ b/zarrs/doc/status/codecs_experimental.md @@ -2,20 +2,24 @@ Experimental codecs are recommended for evaluation only. By default, the `"name"` of of experimental codecs in array metadata links the codec documentation in this crate. This is configurable with [`Config::experimental_codec_names_mut`](config::Config::experimental_codec_names_mut). -| Codec Type | Codec | ZEP or URI | V3 | V2 | Feature Flag | -| -------------- | ------------------------ | -------------------------------------------------- | ------- | ------- | ------------ | -| Array to Array | [bitround] | | ✓ | ✓ | bitround | -| Array to Bytes | [zfp]
zfpy (V2) | | ✓ | ✓ | zfp | -| | [pcodec] | | ✓ | ✓ | pcodec | -| | [vlen] | | ✓ | | | -| | [vlen_v2]
vlen-* (V2) | | ✓ | ✓ | | -| Bytes to Bytes | [bz2] | | ✓ | ✓ | bz2 | -| | [gdeflate] | | ✓ | | gdeflate | +| Codec Type | Codec | ZEP or URI | V3 | V2 | Feature Flag | +| -------------- | ------------------------ | --------------------------------------------------- | ------- | ------- | ------------ | +| Array to Array | [bitround] | | ✓ | ✓ | bitround | +| Array to Bytes | [zfp]
zfpy (V2) | | ✓ | ✓ | zfp | +| | [pcodec] | | ✓ | ✓ | pcodec | +| | [vlen] | | ✓ | | | +| | [vlen-array] | | ✓ | ✓ | | +| | [vlen-bytes] | | ✓ | ✓ | | +| | [vlen-utf8] | | ✓ | ✓ | | +| Bytes to Bytes | [bz2] | | ✓ | ✓ | bz2 | +| | [gdeflate] | | ✓ | | gdeflate | [bitround]: (crate::array::codec::array_to_array::bitround) [zfp]: crate::array::codec::array_to_bytes::zfp [pcodec]: crate::array::codec::array_to_bytes::pcodec [vlen]: crate::array::codec::array_to_bytes::vlen -[vlen_v2]: crate::array::codec::array_to_bytes::vlen_v2 +[vlen-array]: crate::array::codec::array_to_bytes::vlen_array +[vlen-bytes]: crate::array::codec::array_to_bytes::vlen_bytes +[vlen-utf8]: crate::array::codec::array_to_bytes::vlen_utf8 [bz2]: crate::array::codec::bytes_to_bytes::bz2 [gdeflate]: crate::array::codec::bytes_to_bytes::gdeflate diff --git a/zarrs/src/array/codec/array_to_bytes.rs b/zarrs/src/array/codec/array_to_bytes.rs index 1d1b75f3..67f25b6d 100644 --- a/zarrs/src/array/codec/array_to_bytes.rs +++ b/zarrs/src/array/codec/array_to_bytes.rs @@ -3,7 +3,11 @@ pub mod bytes; pub mod codec_chain; pub mod vlen; -pub mod vlen_v2; +pub mod vlen_array; +pub mod vlen_bytes; +pub mod vlen_utf8; + +pub(crate) mod vlen_v2; #[cfg(feature = "pcodec")] pub mod pcodec; diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_array.rs b/zarrs/src/array/codec/array_to_bytes/vlen_array.rs new file mode 100644 index 00000000..5e1867c0 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_array.rs @@ -0,0 +1,5 @@ +//! The `vlen-array` array to bytes codec. + +use crate::array::codec::array_to_bytes::vlen_v2::vlen_v2_macros; + +vlen_v2_macros::vlen_v2_module!(vlen_array, vlen_array_codec, VlenArrayCodec); diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_array/vlen_array_codec.rs b/zarrs/src/array/codec/array_to_bytes/vlen_array/vlen_array_codec.rs new file mode 100644 index 00000000..740169f4 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_array/vlen_array_codec.rs @@ -0,0 +1,3 @@ +use crate::array::codec::array_to_bytes::vlen_v2::vlen_v2_macros; + +vlen_v2_macros::vlen_v2_codec!(VlenArrayCodec, "vlen-array"); diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_bytes.rs b/zarrs/src/array/codec/array_to_bytes/vlen_bytes.rs new file mode 100644 index 00000000..f6103826 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_bytes.rs @@ -0,0 +1,5 @@ +//! The `vlen-bytes` array to bytes codec. + +use crate::array::codec::array_to_bytes::vlen_v2::vlen_v2_macros; + +vlen_v2_macros::vlen_v2_module!(vlen_bytes, vlen_bytes_codec, VlenBytesCodec); diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_bytes/vlen_bytes_codec.rs b/zarrs/src/array/codec/array_to_bytes/vlen_bytes/vlen_bytes_codec.rs new file mode 100644 index 00000000..e6dedb51 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_bytes/vlen_bytes_codec.rs @@ -0,0 +1,3 @@ +use crate::array::codec::array_to_bytes::vlen_v2::vlen_v2_macros; + +vlen_v2_macros::vlen_v2_codec!(VlenBytesCodec, "vlen-bytes"); diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_utf8.rs b/zarrs/src/array/codec/array_to_bytes/vlen_utf8.rs new file mode 100644 index 00000000..0a72d9e8 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_utf8.rs @@ -0,0 +1,5 @@ +//! The `vlen-utf8` array to bytes codec. + +use crate::array::codec::array_to_bytes::vlen_v2::vlen_v2_macros; + +vlen_v2_macros::vlen_v2_module!(vlen_utf8, vlen_utf8_codec, VlenUtf8Codec); diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_utf8/vlen_utf8_codec.rs b/zarrs/src/array/codec/array_to_bytes/vlen_utf8/vlen_utf8_codec.rs new file mode 100644 index 00000000..02f65023 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_utf8/vlen_utf8_codec.rs @@ -0,0 +1,3 @@ +use crate::array::codec::array_to_bytes::vlen_v2::vlen_v2_macros; + +vlen_v2_macros::vlen_v2_codec!(VlenUtf8Codec, "vlen-utf8"); diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_v2.rs b/zarrs/src/array/codec/array_to_bytes/vlen_v2.rs index c37bbdb1..5a36eb96 100644 --- a/zarrs/src/array/codec/array_to_bytes/vlen_v2.rs +++ b/zarrs/src/array/codec/array_to_bytes/vlen_v2.rs @@ -3,20 +3,17 @@ mod vlen_v2_codec; mod vlen_v2_partial_decoder; +pub(crate) mod vlen_v2_macros; + use std::{mem::size_of, sync::Arc}; -pub use vlen_v2::IDENTIFIER; +/// The identifier for the `vlen_v2` codec. +pub(crate) const IDENTIFIER: &str = "vlen_v2"; +// pub use vlen_v2::IDENTIFIER; -pub use crate::metadata::v3::array::codec::vlen_v2::{ - VlenV2CodecConfiguration, VlenV2CodecConfigurationV1, -}; -use crate::{ - array::{codec::CodecError, RawBytes}, - config::global_config, - metadata::v3::array::codec::vlen_v2, -}; +use crate::array::{codec::CodecError, RawBytes}; -pub use vlen_v2_codec::VlenV2Codec; +pub(crate) use vlen_v2_codec::VlenV2Codec; use crate::{ array::codec::{Codec, CodecPlugin}, @@ -40,11 +37,6 @@ inventory::submit! { fn is_name_vlen_v2(name: &str) -> bool { name.eq(IDENTIFIER) - || name - == global_config() - .experimental_codec_names() - .get(IDENTIFIER) - .expect("experimental codec identifier in global map") } fn is_name_vlen_array(name: &str) -> bool { @@ -60,14 +52,12 @@ fn is_name_vlen_utf8(name: &str) -> bool { } pub(crate) fn create_codec_vlen_v2(metadata: &MetadataV3) -> Result { - let configuration: VlenV2CodecConfiguration = metadata - .to_configuration() - .map_err(|_| PluginMetadataInvalidError::new(IDENTIFIER, "codec", metadata.clone()))?; - let codec = Arc::new(VlenV2Codec::new_with_name_configuration( - metadata.name().to_string(), - &configuration, - )); - Ok(Codec::ArrayToBytes(codec)) + if metadata.configuration_is_none_or_empty() { + let codec = Arc::new(VlenV2Codec::new(metadata.name().to_string())); + Ok(Codec::ArrayToBytes(codec)) + } else { + Err(PluginMetadataInvalidError::new(IDENTIFIER, "codec", metadata.clone()).into()) + } } fn get_interleaved_bytes_and_offsets( diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_codec.rs b/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_codec.rs index 6654afa1..dd781f67 100644 --- a/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_codec.rs +++ b/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_codec.rs @@ -20,28 +20,16 @@ use crate::{ #[cfg(feature = "async")] use crate::array::codec::{AsyncArrayPartialDecoderTraits, AsyncBytesPartialDecoderTraits}; -use super::{VlenV2CodecConfiguration, VlenV2CodecConfigurationV1}; - /// The `vlen_v2` codec implementation. #[derive(Debug, Clone)] -pub struct VlenV2Codec { +pub(crate) struct VlenV2Codec { name: String, } impl VlenV2Codec { /// Create a new `vlen_v2` codec. #[must_use] - pub fn new(name: String) -> Self { - Self { name } - } - - /// Create a new `vlen_v2` codec from configuration. - #[must_use] - pub fn new_with_name_configuration( - name: String, - _configuration: &VlenV2CodecConfiguration, - ) -> Self { - // let VlenV2CodecConfiguration::V1(configuration) = configuration; + pub(crate) fn new(name: String) -> Self { Self { name } } } @@ -53,8 +41,10 @@ impl CodecTraits for VlenV2Codec { .experimental_codec_names() .get(&self.name) .unwrap_or(&self.name); - let configuration = VlenV2CodecConfigurationV1 {}; - Some(MetadataV3::new_with_serializable_configuration(name, &configuration).unwrap()) + Some(MetadataV3::new_with_configuration( + name, + serde_json::Map::default(), + )) } fn partial_decoder_should_cache_input(&self) -> bool { diff --git a/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_macros.rs b/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_macros.rs new file mode 100644 index 00000000..0ea12587 --- /dev/null +++ b/zarrs/src/array/codec/array_to_bytes/vlen_v2/vlen_v2_macros.rs @@ -0,0 +1,176 @@ +macro_rules! vlen_v2_module { + ($module:ident, $module_codec:ident, $struct:ident) => { + mod $module_codec; + + use std::sync::Arc; + + pub use $module::IDENTIFIER; + + pub use $module_codec::$struct; + + use crate::{ + array::codec::{Codec, CodecPlugin}, + metadata::v2::array::codec::$module, + metadata::v3::MetadataV3, + plugin::{PluginCreateError, PluginMetadataInvalidError}, + }; + + // Register the codec. + inventory::submit! { + CodecPlugin::new(IDENTIFIER, is_name, create_codec) + } + + fn is_name(name: &str) -> bool { + name.eq(IDENTIFIER) + } + + fn create_codec(metadata: &MetadataV3) -> Result { + if metadata.configuration_is_none_or_empty() { + let codec = Arc::new($struct::new()); + Ok(Codec::ArrayToBytes(codec)) + } else { + Err(PluginMetadataInvalidError::new(IDENTIFIER, "codec", metadata.clone()).into()) + } + } + }; +} + +macro_rules! vlen_v2_codec { + ($struct:ident,$identifier:expr) => { + use std::sync::Arc; + + use zarrs_metadata::v3::MetadataV3; + + use crate::array::{ + codec::{ + array_to_bytes::vlen_v2::VlenV2Codec, ArrayPartialDecoderTraits, + ArrayPartialEncoderTraits, ArrayToBytesCodecTraits, BytesPartialDecoderTraits, + BytesPartialEncoderTraits, CodecError, CodecOptions, CodecTraits, + }, + ArrayBytes, ArrayCodecTraits, ArrayMetadataOptions, BytesRepresentation, + ChunkRepresentation, RawBytes, RecommendedConcurrency, + }; + + #[cfg(feature = "async")] + use crate::array::codec::{AsyncArrayPartialDecoderTraits, AsyncBytesPartialDecoderTraits}; + + /// The `$identifier` codec implementation. + #[derive(Debug, Clone)] + pub struct $struct { + inner: Arc, + } + + impl $struct { + /// Create a new `$identifier` codec. + #[must_use] + pub fn new() -> Self { + Self { + inner: Arc::new(VlenV2Codec::new($identifier.to_string())), + } + } + } + + impl Default for $struct { + fn default() -> Self { + Self::new() + } + } + + impl CodecTraits for $struct { + fn create_metadata_opt(&self, options: &ArrayMetadataOptions) -> Option { + self.inner.create_metadata_opt(options) + } + + fn partial_decoder_should_cache_input(&self) -> bool { + self.inner.partial_decoder_should_cache_input() + } + + fn partial_decoder_decodes_all(&self) -> bool { + self.inner.partial_decoder_decodes_all() + } + } + + impl ArrayCodecTraits for $struct { + fn recommended_concurrency( + &self, + decoded_representation: &ChunkRepresentation, + ) -> Result { + self.inner.recommended_concurrency(decoded_representation) + } + } + + #[cfg_attr(feature = "async", async_trait::async_trait)] + impl ArrayToBytesCodecTraits for $struct { + fn dynamic(self: Arc) -> Arc { + self as Arc + } + + fn encode<'a>( + &self, + bytes: ArrayBytes<'a>, + decoded_representation: &ChunkRepresentation, + options: &CodecOptions, + ) -> Result, CodecError> { + self.inner.encode(bytes, decoded_representation, options) + } + + fn decode<'a>( + &self, + bytes: RawBytes<'a>, + decoded_representation: &ChunkRepresentation, + options: &CodecOptions, + ) -> Result, CodecError> { + self.inner.decode(bytes, decoded_representation, options) + } + + fn partial_decoder( + self: Arc, + input_handle: Arc, + decoded_representation: &ChunkRepresentation, + options: &CodecOptions, + ) -> Result, CodecError> { + self.inner + .clone() + .partial_decoder(input_handle, decoded_representation, options) + } + + fn partial_encoder( + self: Arc, + input_handle: Arc, + output_handle: Arc, + decoded_representation: &ChunkRepresentation, + options: &CodecOptions, + ) -> Result, CodecError> { + self.inner.clone().partial_encoder( + input_handle, + output_handle, + decoded_representation, + options, + ) + } + + #[cfg(feature = "async")] + async fn async_partial_decoder( + self: Arc, + input_handle: Arc, + decoded_representation: &ChunkRepresentation, + options: &CodecOptions, + ) -> Result, CodecError> { + self.inner + .clone() + .async_partial_decoder(input_handle, decoded_representation, options) + .await + } + + fn compute_encoded_size( + &self, + decoded_representation: &ChunkRepresentation, + ) -> Result { + self.inner.compute_encoded_size(decoded_representation) + } + } + }; +} + +pub(crate) use vlen_v2_codec; +pub(crate) use vlen_v2_module; diff --git a/zarrs/src/config.rs b/zarrs/src/config.rs index 5b2a7ad8..d1bab970 100644 --- a/zarrs/src/config.rs +++ b/zarrs/src/config.rs @@ -133,7 +133,6 @@ impl Default for Config { #[cfg(feature = "pcodec")] (codec::pcodec::IDENTIFIER.to_string(), "https://codec.zarrs.dev/array_to_bytes/pcodec".to_string()), (codec::vlen::IDENTIFIER.to_string(), "https://codec.zarrs.dev/array_to_bytes/vlen".to_string()), - (codec::vlen_v2::IDENTIFIER.to_string(), "https://codec.zarrs.dev/array_to_bytes/vlen_v2".to_string()), // Bytes to bytes #[cfg(feature = "bz2")] (codec::bz2::IDENTIFIER.to_string(), "https://codec.zarrs.dev/bytes_to_bytes/bz2".to_string()), diff --git a/zarrs/tests/cities.rs b/zarrs/tests/cities.rs index 17e18143..6f6828f5 100644 --- a/zarrs/tests/cities.rs +++ b/zarrs/tests/cities.rs @@ -12,7 +12,7 @@ use zarrs::{ array::{ codec::{ array_to_bytes::{ - sharding::ShardingCodecBuilder, vlen::VlenCodec, vlen_v2::VlenV2Codec, + sharding::ShardingCodecBuilder, vlen::VlenCodec, vlen_utf8::VlenUtf8Codec, }, ArrayToBytesCodecTraits, ZstdCodec, }, @@ -97,7 +97,7 @@ fn cities() -> Result<(), Box> { assert_eq!(cities[47862], "SariwĹŹn-si"); assert_eq!(cities[47867], "Charlotte Amalie"); - let vlen_v2 = Arc::new(VlenV2Codec::new("vlen-utf8".to_string())); + let vlen_utf8 = Arc::new(VlenUtf8Codec::new()); // let vlen = Arc::new(VlenCodec::default()); let vlen_configuration: VlenCodecConfiguration = serde_json::from_str(r#"{ @@ -116,8 +116,8 @@ fn cities() -> Result<(), Box> { print!("| encoding | compression | size |\n"); print!("| ---------------- | ----------- | ------ |\n"); - print!("| vlen_v2 | | {} |\n", cities_impl(&cities, None, 1000, None, vlen_v2.clone(), true)?); - print!("| vlen_v2 | zstd 5 | {} |\n", cities_impl(&cities, Some(5), 1000, None, vlen_v2.clone(), false)?); + print!("| vlen_utf8 | | {} |\n", cities_impl(&cities, None, 1000, None, vlen_utf8.clone(), true)?); + print!("| vlen_utf8 | zstd 5 | {} |\n", cities_impl(&cities, Some(5), 1000, None, vlen_utf8.clone(), false)?); print!("| vlen | | {} |\n", cities_impl(&cities, None, 1000, None, vlen.clone(), false)?); print!("| vlen | zstd 5 | {} |\n", cities_impl(&cities, None, 1000, None, vlen_compressed.clone(), false)?); println!(); @@ -125,8 +125,8 @@ fn cities() -> Result<(), Box> { // | encoding | compression | size | // | ---------------- | ----------- | ------ | - // | vlen_v2 | | 642196 | - // | vlen_v2 | zstd 5 | 362626 | + // | vlen_utf8 | | 642196 | + // | vlen_utf8 | zstd 5 | 362626 | // | vlen | | 642580 | // | vlen | zstd 5 | 346950 | diff --git a/zarrs_metadata/CHANGELOG.md b/zarrs_metadata/CHANGELOG.md index c8fed74b..af622b3a 100644 --- a/zarrs_metadata/CHANGELOG.md +++ b/zarrs_metadata/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - **Breaking**: Rename `DataTypeMetadataV3::Binary` to `Bytes` for compatibility with `zarr-python` +### Removed +- **Breaking**: Remove the `v3::array::codec::vlen_v2` module and all associated types + ## [0.2.0] - 2024-11-15 ### Added diff --git a/zarrs_metadata/src/v2/array/codec/vlen_array.rs b/zarrs_metadata/src/v2/array/codec/vlen_array.rs index abc84ebf..101e1216 100644 --- a/zarrs_metadata/src/v2/array/codec/vlen_array.rs +++ b/zarrs_metadata/src/v2/array/codec/vlen_array.rs @@ -1,4 +1,4 @@ /// The identifier for the `vlen-array` codec. pub const IDENTIFIER: &str = "vlen-array"; -pub use crate::v3::array::codec::vlen_v2::VlenV2CodecConfigurationV1; +// pub use crate::v3::array::codec::vlen_v2::VlenV2CodecConfigurationV1; diff --git a/zarrs_metadata/src/v2/array/codec/vlen_bytes.rs b/zarrs_metadata/src/v2/array/codec/vlen_bytes.rs index 32e3dbcc..cff97673 100644 --- a/zarrs_metadata/src/v2/array/codec/vlen_bytes.rs +++ b/zarrs_metadata/src/v2/array/codec/vlen_bytes.rs @@ -1,4 +1,4 @@ /// The identifier for the `vlen-bytes` codec. pub const IDENTIFIER: &str = "vlen-bytes"; -pub use crate::v3::array::codec::vlen_v2::VlenV2CodecConfigurationV1; +// pub use crate::v3::array::codec::vlen_v2::VlenV2CodecConfigurationV1; diff --git a/zarrs_metadata/src/v2/array/codec/vlen_utf8.rs b/zarrs_metadata/src/v2/array/codec/vlen_utf8.rs index 76e6bcad..bb5b350d 100644 --- a/zarrs_metadata/src/v2/array/codec/vlen_utf8.rs +++ b/zarrs_metadata/src/v2/array/codec/vlen_utf8.rs @@ -1,4 +1,4 @@ /// The identifier for the `vlen-utf8` codec. pub const IDENTIFIER: &str = "vlen-utf8"; -pub use crate::v3::array::codec::vlen_v2::VlenV2CodecConfigurationV1; +// pub use crate::v3::array::codec::vlen_v2::VlenV2CodecConfigurationV1; diff --git a/zarrs_metadata/src/v2_to_v3.rs b/zarrs_metadata/src/v2_to_v3.rs index 4887ade6..b81c3042 100644 --- a/zarrs_metadata/src/v2_to_v3.rs +++ b/zarrs_metadata/src/v2_to_v3.rs @@ -19,7 +19,6 @@ use crate::{ codec::{ bytes::BytesCodecConfigurationV1, transpose::{TransposeCodecConfigurationV1, TransposeOrder}, - vlen_v2::VlenV2CodecConfigurationV1, }, fill_value::{FillValueFloat, FillValueFloatStringNonFinite, FillValueMetadataV3}, }, @@ -148,10 +147,8 @@ pub fn array_metadata_v2_to_v3( | crate::v2::array::codec::vlen_bytes::IDENTIFIER | crate::v2::array::codec::vlen_utf8::IDENTIFIER => { has_array_to_bytes = true; - let vlen_v2_metadata = MetadataV3::new_with_serializable_configuration( - crate::v3::array::codec::vlen_v2::IDENTIFIER, - &VlenV2CodecConfigurationV1 {}, - )?; + let vlen_v2_metadata = + MetadataV3::new_with_configuration(filter.id(), serde_json::Map::default()); codecs.push(vlen_v2_metadata); } _ => { diff --git a/zarrs_metadata/src/v3/array.rs b/zarrs_metadata/src/v3/array.rs index 4df7a127..c5b8ff4a 100644 --- a/zarrs_metadata/src/v3/array.rs +++ b/zarrs_metadata/src/v3/array.rs @@ -35,8 +35,8 @@ pub mod codec { pub mod transpose; /// `vlen` codec metadata. pub mod vlen; - /// `vlen_v2` codec metadata. - pub mod vlen_v2; + // /// `vlen_v2` codec metadata. + // pub mod vlen_v2; /// `zfp` codec metadata. pub mod zfp; /// `zstd` codec metadata.