Skip to content

Commit 0ecd9a1

Browse files
committed
Pass sub-classes through returns.
1 parent c8f5280 commit 0ecd9a1

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
@@ -2172,7 +2172,7 @@ def _create(
21722172
# runtime
21732173
overwrite: bool = False,
21742174
config: ArrayConfigLike | None = None,
2175-
) -> AnyArray:
2175+
) -> Self:
21762176
"""Creates a new Array instance from an initialized store.
21772177
Deprecated in favor of [`zarr.create_array`][].
21782178
"""
@@ -2197,14 +2197,14 @@ def _create(
21972197
config=config,
21982198
),
21992199
)
2200-
return Array(async_array)
2200+
return cls(async_array)
22012201

22022202
@classmethod
22032203
def from_dict(
22042204
cls,
22052205
store_path: StorePath,
22062206
data: dict[str, JSON],
2207-
) -> AnyArray:
2207+
) -> Self:
22082208
"""
22092209
Create a Zarr array from a dictionary.
22102210
@@ -2228,13 +2228,13 @@ def from_dict(
22282228
If the dictionary data is invalid or missing required fields for array creation.
22292229
"""
22302230
async_array = AsyncArray.from_dict(store_path=store_path, data=data)
2231-
return Array(async_array)
2231+
return cls(async_array)
22322232

22332233
@classmethod
22342234
def open(
22352235
cls,
22362236
store: StoreLike,
2237-
) -> AnyArray:
2237+
) -> Self:
22382238
"""Opens an existing Array from a store.
22392239
22402240
Parameters
@@ -2250,7 +2250,7 @@ def open(
22502250
Array opened from the store.
22512251
"""
22522252
async_array = sync(AsyncArray.open(store))
2253-
return Array(async_array)
2253+
return cls(async_array)
22542254

22552255
@property
22562256
def store(self) -> Store:

0 commit comments

Comments
 (0)