Skip to content

Commit 6e33956

Browse files
committed
Pass sub-classes through returns.
1 parent 3032eb3 commit 6e33956

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/zarr/core/array.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ def _create(
21662166
# runtime
21672167
overwrite: bool = False,
21682168
config: ArrayConfigLike | None = None,
2169-
) -> AnyArray:
2169+
) -> Self:
21702170
"""Creates a new Array instance from an initialized store.
21712171
Deprecated in favor of [`zarr.create_array`][].
21722172
"""
@@ -2191,14 +2191,14 @@ def _create(
21912191
config=config,
21922192
),
21932193
)
2194-
return Array(async_array)
2194+
return cls(async_array)
21952195

21962196
@classmethod
21972197
def from_dict(
21982198
cls,
21992199
store_path: StorePath,
22002200
data: dict[str, JSON],
2201-
) -> AnyArray:
2201+
) -> Self:
22022202
"""
22032203
Create a Zarr array from a dictionary.
22042204
@@ -2222,13 +2222,13 @@ def from_dict(
22222222
If the dictionary data is invalid or missing required fields for array creation.
22232223
"""
22242224
async_array = AsyncArray.from_dict(store_path=store_path, data=data)
2225-
return Array(async_array)
2225+
return cls(async_array)
22262226

22272227
@classmethod
22282228
def open(
22292229
cls,
22302230
store: StoreLike,
2231-
) -> AnyArray:
2231+
) -> Self:
22322232
"""Opens an existing Array from a store.
22332233
22342234
Parameters
@@ -2242,7 +2242,7 @@ def open(
22422242
Array opened from the store.
22432243
"""
22442244
async_array = sync(AsyncArray.open(store))
2245-
return Array(async_array)
2245+
return cls(async_array)
22462246

22472247
@property
22482248
def store(self) -> Store:

0 commit comments

Comments
 (0)