Skip to content

Commit f35d4c1

Browse files
committed
remove methods section, correct attributes
1 parent 84b572e commit f35d4c1

File tree

2 files changed

+11
-92
lines changed

2 files changed

+11
-92
lines changed

src/zarr/core/dtype/npy/bytes.py

Lines changed: 11 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,11 @@ class NullTerminatedBytes(ZDType[np.dtypes.BytesDType[int], np.bytes_], HasLengt
4646
4747
Attributes
4848
----------
49-
length : int
50-
The length of the bytes.
51-
5249
dtype_cls: ClassVar[type[np.dtypes.BytesDType[int]]] = np.dtypes.BytesDType
5350
The NumPy data type wrapped by this ZDType.
54-
55-
Methods
56-
-------
57-
to_json(zarr_format) : dict
58-
Convert the NullTerminatedBytes to JSON data.
59-
60-
from_json(data, zarr_format) : NullTerminatedBytes
61-
Create NullTerminatedBytes from JSON data.
62-
63-
cast_scalar(data) : np.bytes_
64-
Cast a python object to np.bytes_.
65-
66-
default_scalar() : np.bytes_
67-
Return the default scalar value.
68-
69-
to_json_scalar(data, zarr_format) : str
70-
Convert input to a scalar and return as JSON data.
71-
72-
from_json_scalar(data, zarr_format) : np.bytes_
73-
Create np.bytes_ from JSON data.
74-
75-
item_size : int
76-
Return the item size, in bytes, of the data type.
51+
_zarr_v3_name : ClassVar[Literal["null_terminated_bytes"]]
52+
length : int
53+
The length of the bytes.
7754
7855
Notes
7956
-----
@@ -380,7 +357,7 @@ def to_json_scalar(self, data: object, *, zarr_format: ZarrFormat) -> str:
380357

381358
def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.bytes_:
382359
"""
383-
Read a JSON-serializable value as np.bytes_.
360+
Read a JSON-serializable value as ``np.bytes_``.
384361
385362
Parameters
386363
----------
@@ -431,34 +408,11 @@ class RawBytes(ZDType[np.dtypes.VoidDType[int], np.void], HasLength, HasItemSize
431408
432409
Attributes
433410
----------
434-
length : int
435-
The length of the bytes.
436-
437411
dtype_cls: ClassVar[type[np.dtypes.VoidDType[int]]] = np.dtypes.VoidDtype
438412
The NumPy data type wrapped by this ZDType.
439-
440-
Methods
441-
-------
442-
to_json(zarr_format) : dict
443-
Convert RawBytes to JSON data.
444-
445-
from_json(data, zarr_format) : NullTerminatedBytes
446-
Create RawBytes from JSON data.
447-
448-
cast_scalar(data) : np.void
449-
Cast a python object to np.void.
450-
451-
default_scalar() : np.void
452-
Return the default scalar value.
453-
454-
to_json_scalar(data, zarr_format) : str
455-
Convert input to a scalar and return as JSON data.
456-
457-
from_json_scalar(data, zarr_format) : np.bytes_
458-
Create a np.void from JSON data.
459-
460-
item_size : int
461-
Return the item size, in bytes, of the data type.
413+
_zarr_v3_name : ClassVar[Literal["raw_bytes"]]
414+
length : int
415+
The length of the bytes.
462416
463417
Notes
464418
-----
@@ -851,26 +805,10 @@ class VariableLengthBytes(ZDType[np.dtypes.ObjectDType, bytes], HasObjectCodec):
851805
----------
852806
dtype_cls: ClassVar[type[np.dtypes.ObjectDType]] = np.dtypes.ObjectDType
853807
The NumPy data type wrapped by this ZDType.
854-
855-
Methods
856-
-------
857-
to_json(zarr_format) : dict
858-
Convert the VariableLengthBytes to JSON data.
859-
860-
from_json(data, zarr_format) : VariableLengthBytes
861-
Create VariableLengthBytes from JSON data.
862-
863-
cast_scalar(data) : bytes
864-
Cast a python object to bytes.
865-
866-
default_scalar() : bytes
867-
Return the default scalar value.
868-
869-
to_json_scalar(data, zarr_format) : str
870-
Convert input to a scalar and return as JSON data.
871-
872-
from_json_scalar(data, zarr_format) : bytes
873-
Create bytes from JSON data.
808+
_zarr_v3_name: ClassVar[Literal["variable_length_bytes"]] = "variable_length_bytes"
809+
The name of this data type in Zarr V3.
810+
object_codec_id: ClassVar[Literal["vlen-bytes"]] = "vlen-bytes"
811+
The object codec ID for this data type.
874812
875813
Notes
876814
-----

src/zarr/core/dtype/npy/int.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,6 @@ class BaseInt(ZDType[TIntDType_co, TIntScalar_co], HasItemSize):
6363
----------
6464
_zarr_v2_names : ClassVar[tuple[str, ...]]
6565
Possible Zarr V2 JSON names for the data type.
66-
67-
Methods
68-
-------
69-
_check_json_v2(data: object) -> TypeGuard[DTypeConfig_V2[str, None]]:
70-
Check if input is a valid JSON representation for Zarr v2.
71-
_check_json_v3(data: object) -> TypeGuard[str]:
72-
Check if JSON value is consistent with Zarr v3 for this data type.
73-
_check_scalar(data: object) -> TypeGuard[IntLike]:
74-
Check if a Python object is IntLike.
75-
_cast_scalar_unchecked(data: IntLike) -> TIntScalar_co:
76-
Create an integer without type checking of the input.
77-
cast_scalar(data: object) -> TIntScalar_co:
78-
Convert object to NumPy integer, raising TypeError if invalid.
79-
default_scalar() -> TIntScalar_co:
80-
Get the default value, which is 0 cast to this dtype.
81-
from_json_scalar(data: JSON, *, zarr_format: ZarrFormat) -> TIntScalar_co:
82-
Read a JSON-serializable value as a NumPy int scalar.
83-
to_json_scalar(data: object, *, zarr_format: ZarrFormat) -> int:
84-
Convert an object to JSON-serializable scalar.
8566
"""
8667

8768
_zarr_v2_names: ClassVar[tuple[str, ...]]

0 commit comments

Comments
 (0)