File tree Expand file tree Collapse file tree
tests/test_dtype/test_npy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Remove the ` UnstableSpecificationWarning ` emitted when serializing a ` FixedLengthUTF32 ` data type instance, as a spec for this data type has been published to zarr-extensions.
Original file line number Diff line number Diff line change 2626 HasLength ,
2727 HasObjectCodec ,
2828 check_dtype_spec_v2 ,
29- v3_unstable_dtype_warning ,
3029)
3130from zarr .core .dtype .npy .common import (
3231 check_json_str ,
@@ -115,6 +114,9 @@ class FixedLengthUTF32(
115114 Wraps the ``np.dtypes.StrDType`` data type. Scalars for this data type are instances of
116115 ``np.str_``.
117116
117+ The Zarr V3 specification for this data type is defined at
118+ https://github.com/zarr-developers/zarr-extensions/tree/main/data-types/fixed_length_utf32.
119+
118120 Attributes
119121 ----------
120122 dtype_cls : Type[np.dtypes.StrDType]
@@ -247,7 +249,6 @@ def to_json(
247249 if zarr_format == 2 :
248250 return {"name" : self .to_native_dtype ().str , "object_codec_id" : None }
249251 elif zarr_format == 3 :
250- v3_unstable_dtype_warning (self )
251252 return {
252253 "name" : self ._zarr_v3_name ,
253254 "configuration" : {"length_bytes" : self .length * self .code_point_bytes },
Original file line number Diff line number Diff line change 66from tests .test_dtype .test_wrapper import BaseTestZDType
77from zarr .core .dtype import FixedLengthUTF32
88from zarr .core .dtype .npy .string import _NUMPY_SUPPORTS_VLEN_STRING , VariableLengthUTF8
9- from zarr .errors import UnstableSpecificationWarning
109
1110if _NUMPY_SUPPORTS_VLEN_STRING :
1211
@@ -125,21 +124,6 @@ class TestFixedLengthUTF32(BaseTestZDType):
125124 invalid_scalar_params = (None ,)
126125
127126
128- @pytest .mark .parametrize (
129- "zdtype" ,
130- [
131- FixedLengthUTF32 (length = 10 ),
132- ],
133- )
134- def test_unstable_dtype_warning (zdtype : FixedLengthUTF32 | VariableLengthUTF8 ) -> None :
135- """
136- Test that we get a warning when serializing a dtype without a zarr v3 spec to json
137- when zarr_format is 3
138- """
139- with pytest .warns (UnstableSpecificationWarning ):
140- zdtype .to_json (zarr_format = 3 )
141-
142-
143127def test_invalid_size () -> None :
144128 """
145129 Test that it's impossible to create a data type that has no length
You can’t perform that action at this time.
0 commit comments