@@ -102,9 +102,6 @@ def from_native_dtype(cls: type[Self], dtype: TBaseDType) -> Self:
102
102
"""
103
103
Create a ZDType instance from a native data type.
104
104
105
- The base implementation first performs a type check via ``cls._check_native_dtype``.
106
- If that type check succeeds, the ZDType class instance is created.
107
-
108
105
This method is used when taking a user-provided native data type, like a NumPy data type,
109
106
and creating the corresponding ZDType instance from them.
110
107
@@ -123,7 +120,7 @@ def from_native_dtype(cls: type[Self], dtype: TBaseDType) -> Self:
123
120
TypeError
124
121
If the native data type is not consistent with the wrapped data type.
125
122
"""
126
- ...
123
+ raise NotImplementedError # pragma: no cover
127
124
128
125
@abstractmethod
129
126
def to_native_dtype (self : Self ) -> TDType_co :
@@ -135,15 +132,17 @@ def to_native_dtype(self: Self) -> TDType_co:
135
132
TDType
136
133
The native data type wrapped by this ZDType.
137
134
"""
138
- ...
135
+ raise NotImplementedError # pragma: no cover
139
136
140
137
@classmethod
141
138
@abstractmethod
142
- def _from_json_v2 (cls : type [Self ], data : DTypeJSON ) -> Self : ...
139
+ def _from_json_v2 (cls : type [Self ], data : DTypeJSON ) -> Self :
140
+ raise NotImplementedError # pragma: no cover
143
141
144
142
@classmethod
145
143
@abstractmethod
146
- def _from_json_v3 (cls : type [Self ], data : DTypeJSON ) -> Self : ...
144
+ def _from_json_v3 (cls : type [Self ], data : DTypeJSON ) -> Self :
145
+ raise NotImplementedError # pragma: no cover
147
146
148
147
@classmethod
149
148
def from_json (cls : type [Self ], data : DTypeJSON , * , zarr_format : ZarrFormat ) -> Self :
@@ -190,7 +189,7 @@ def to_json(self, zarr_format: ZarrFormat) -> DTypeSpec_V2 | DTypeSpec_V3:
190
189
DTypeJSON_V2 | DTypeJSON_V3
191
190
The JSON-serializable representation of the wrapped data type
192
191
"""
193
- ...
192
+ raise NotImplementedError # pragma: no cover
194
193
195
194
@abstractmethod
196
195
def _check_scalar (self , data : object ) -> bool :
@@ -207,7 +206,7 @@ def _check_scalar(self, data: object) -> bool:
207
206
Bool
208
207
True if the object is valid, False otherwise.
209
208
"""
210
- ...
209
+ raise NotImplementedError # pragma: no cover
211
210
212
211
@abstractmethod
213
212
def cast_scalar (self , data : object ) -> TScalar_co :
@@ -227,6 +226,7 @@ def cast_scalar(self, data: object) -> TScalar_co:
227
226
TScalar
228
227
The cast value.
229
228
"""
229
+ raise NotImplementedError # pragma: no cover
230
230
231
231
@abstractmethod
232
232
def default_scalar (self ) -> TScalar_co :
@@ -242,7 +242,7 @@ def default_scalar(self) -> TScalar_co:
242
242
TScalar
243
243
The default value for this data type.
244
244
"""
245
- ...
245
+ raise NotImplementedError # pragma: no cover
246
246
247
247
@abstractmethod
248
248
def from_json_scalar (self : Self , data : JSON , * , zarr_format : ZarrFormat ) -> TScalar_co :
@@ -262,7 +262,7 @@ def from_json_scalar(self: Self, data: JSON, *, zarr_format: ZarrFormat) -> TSca
262
262
TScalar
263
263
The deserialized scalar value.
264
264
"""
265
- ...
265
+ raise NotImplementedError # pragma: no cover
266
266
267
267
@abstractmethod
268
268
def to_json_scalar (self , data : object , * , zarr_format : ZarrFormat ) -> JSON :
@@ -285,7 +285,7 @@ def to_json_scalar(self, data: object, *, zarr_format: ZarrFormat) -> JSON:
285
285
JSON
286
286
The JSON-serialized scalar.
287
287
"""
288
- ...
288
+ raise NotImplementedError # pragma: no cover
289
289
290
290
291
291
def scalar_failed_type_check_msg (
0 commit comments