@@ -35,8 +35,10 @@ class FixedLengthBytesConfig(TypedDict):
3535@dataclass (frozen = True , kw_only = True )
3636class NullTerminatedBytes (ZDType [np .dtypes .BytesDType [int ], np .bytes_ ], HasLength , HasItemSize ):
3737 """
38- A Zarr data type for arrays containing null-terminated bytes. Wraps the NumPy
39- ``np.dtypes.BytesDType`` data type. Scalars for this data type are instances of ``np.bytes_``.
38+ A Zarr data type for arrays containing fixed-length null-terminated byte sequences.
39+
40+ Wraps the NumPy ``np.dtypes.BytesDType`` data type. Scalars for this data type are instances of
41+ ``np.bytes_``.
4042
4143 This data type is parametrized by an integral length which specifies size in bytes of each
4244 scalar. Because this data type uses null-terminated semantics, indexing into
@@ -158,15 +160,6 @@ def _check_json_v3(cls, data: DTypeJSON) -> TypeGuard[NullTerminatedBytesJSONV3]
158160 """
159161 Check that the input is a valid representation of NullTerminatedBytes in Zarr V3.
160162
161- The input must be a mapping with the following structure:
162-
163- {
164- "name": "null_terminated_bytes",
165- "configuration": {
166- "length_bytes": <int>
167- }
168- }
169-
170163 Parameters
171164 ----------
172165 data : DTypeJSON
@@ -256,19 +249,7 @@ def to_json(
256249 self , zarr_format : ZarrFormat
257250 ) -> DTypeConfig_V2 [str , None ] | NullTerminatedBytesJSONV3 :
258251 """
259- Generate a JSON representation of NullTerminatedBytes.
260-
261- If zarr_format is 2, the return value will be a dictionary with the form
262- {
263- "name": "|S<self.length>",
264- "object_codec_id": None
265- }
266-
267- If zarr_format is 3, the resulting JSON will be a dictionary with the form
268- {
269- "name": "null_terminated_bytes",
270- "configuration": {"length_bytes": self.length}
271- }
252+ Generate a JSON representation of this data type.
272253
273254 Parameters
274255 ----------
@@ -440,13 +421,10 @@ def item_size(self) -> int:
440421
441422@dataclass (frozen = True , kw_only = True )
442423class RawBytes (ZDType [np .dtypes .VoidDType [int ], np .void ], HasLength , HasItemSize ):
443- # np.dtypes.VoidDType is specified in an odd way in NumPy
444- # it cannot be used to create instances of the dtype
445- # so we have to tell mypy to ignore this here
446-
447424 """
448- A Zarr data type for arrays containing raw bytes. Wraps the NumPy ``void`` data type.
449- Scalars for this data type are instances of ``np.void``.
425+ A Zarr data type for arrays containing fixed-length sequences of raw bytes.
426+
427+ Wraps the NumPy ``void`` data type. Scalars for this data type are instances of ``np.void``.
450428
451429 This data type is parametrized by an integral length which specifies size in bytes of each
452430 scalar belonging to this data type.
@@ -491,6 +469,9 @@ class does not support structured data types.
491469
492470 """
493471
472+ # np.dtypes.VoidDType is specified in an odd way in NumPy
473+ # it cannot be used to create instances of the dtype
474+ # so we have to tell mypy to ignore this here
494475 dtype_cls = np .dtypes .VoidDType # type: ignore[assignment]
495476 _zarr_v3_name : ClassVar [Literal ["raw_bytes" ]] = "raw_bytes"
496477
@@ -694,19 +675,7 @@ def to_json(self, zarr_format: Literal[3]) -> RawBytesJSONV3: ...
694675
695676 def to_json (self , zarr_format : ZarrFormat ) -> DTypeConfig_V2 [str , None ] | RawBytesJSONV3 :
696677 """
697- Generate a JSON representation of RawBytes.
698-
699- If zarr_format is 2, the return value will be a dictionary with the form
700- {
701- "name": "|V<self.length>",
702- "object_codec_id": None
703- }
704-
705- If zarr_format is 3, the resulting JSON will be a dictionary with the form
706- {
707- "name": "raw_bytes",
708- "configuration": {"length_bytes": self.length}
709- }
678+ Generate a JSON representation of this data type.
710679
711680 Parameters
712681 ----------
@@ -874,8 +843,9 @@ def item_size(self) -> int:
874843@dataclass (frozen = True , kw_only = True )
875844class VariableLengthBytes (ZDType [np .dtypes .ObjectDType , bytes ], HasObjectCodec ):
876845 """
877- A Zarr data type for arrays containing variable-length bytes. Wraps the NumPy
878- "object" data type. Scalars for this data type are instances of plain python bytes.
846+ A Zarr data type for arrays containing variable-length sequences of bytes.
847+
848+ Wraps the NumPy "object" data type. Scalars for this data type are instances of ``bytes``.
879849
880850 Attributes
881851 ----------
0 commit comments