Skip to content

Commit cbb0b0d

Browse files
committed
clean up typeddicts
1 parent bf7e2c5 commit cbb0b0d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class FixedLengthBytesConfig(TypedDict):
1515
length_bytes: int
1616

1717

18-
NTBytesJSONV3 = NamedConfig[Literal["null_terminated_bytes"], FixedLengthBytesConfig]
18+
NullTerminatedBytesJSONV3 = NamedConfig[Literal["null_terminated_bytes"], FixedLengthBytesConfig]
1919
RawBytesJSONV3 = NamedConfig[Literal["raw_bytes"], FixedLengthBytesConfig]
2020

2121

@@ -40,7 +40,7 @@ def _check_json_v2(cls, data: JSON, *, object_codec_id: str | None = None) -> Ty
4040
return isinstance(data, str) and re.match(r"^\|S\d+$", data) is not None
4141

4242
@classmethod
43-
def _check_json_v3(cls, data: JSON) -> TypeGuard[NTBytesJSONV3]:
43+
def _check_json_v3(cls, data: JSON) -> TypeGuard[NullTerminatedBytesJSONV3]:
4444
return (
4545
isinstance(data, dict)
4646
and set(data.keys()) == {"name", "configuration"}
@@ -53,9 +53,9 @@ def _check_json_v3(cls, data: JSON) -> TypeGuard[NTBytesJSONV3]:
5353
def to_json(self, zarr_format: Literal[2]) -> str: ...
5454

5555
@overload
56-
def to_json(self, zarr_format: Literal[3]) -> NTBytesJSONV3: ...
56+
def to_json(self, zarr_format: Literal[3]) -> NullTerminatedBytesJSONV3: ...
5757

58-
def to_json(self, zarr_format: ZarrFormat) -> str | NTBytesJSONV3:
58+
def to_json(self, zarr_format: ZarrFormat) -> str | NullTerminatedBytesJSONV3:
5959
if zarr_format == 2:
6060
return self.to_native_dtype().str
6161
elif zarr_format == 3:

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class LengthBytesConfig(TypedDict):
3333
length_bytes: int
3434

3535

36-
# TDO: Fix this terrible name
37-
FixedLengthBytesJSONV3 = NamedConfig[Literal["fixed_length_bytes"], LengthBytesConfig]
38-
39-
4036
# TODO: Fix this terrible name
4137
FixedLengthUTF32JSONV3 = NamedConfig[Literal["fixed_length_utf32"], LengthBytesConfig]
4238

0 commit comments

Comments
 (0)