|
34 | 34 | from zarr.core.attributes import Attributes |
35 | 35 | from zarr.core.buffer import ( |
36 | 36 | BufferPrototype, |
| 37 | + NDArrayLike, |
37 | 38 | NDArrayOrScalarLike, |
38 | 39 | NDBuffer, |
39 | 40 | default_buffer_prototype, |
40 | 41 | ) |
41 | | -from zarr.core.buffer.core import NDArrayLike |
42 | 42 | from zarr.core.chunk_grids import RegularChunkGrid, _auto_partition, normalize_chunks |
43 | 43 | from zarr.core.chunk_key_encodings import ( |
44 | 44 | ChunkKeyEncoding, |
@@ -1397,7 +1397,7 @@ async def _set_selection( |
1397 | 1397 | # ), f"shape of value doesn't match indexer shape. Expected {indexer.shape}, got {value.shape}" |
1398 | 1398 | if not hasattr(value, "dtype") or value.dtype.name != self.metadata.dtype.name: |
1399 | 1399 | if hasattr(value, "astype"): |
1400 | | - # Handle things that are already NDArrayOrScalarLike more efficiently |
| 1400 | + # Handle things that are already NDArrayLike more efficiently |
1401 | 1401 | value = value.astype(dtype=self.metadata.dtype, order="A") |
1402 | 1402 | else: |
1403 | 1403 | value = np.array(value, dtype=self.metadata.dtype, order="A") |
@@ -2290,7 +2290,7 @@ def __getitem__(self, selection: Selection) -> NDArrayOrScalarLike: |
2290 | 2290 | Returns |
2291 | 2291 | ------- |
2292 | 2292 | NDArrayOrScalarLike |
2293 | | - An array-like containing the data for the requested region. |
| 2293 | + An array-like or scalar containing the data for the requested region. |
2294 | 2294 |
|
2295 | 2295 | Examples |
2296 | 2296 | -------- |
@@ -2555,7 +2555,7 @@ def get_basic_selection( |
2555 | 2555 | Returns |
2556 | 2556 | ------- |
2557 | 2557 | NDArrayOrScalarLike |
2558 | | - An array-like containing the data for the requested region. |
| 2558 | + An array-like or scalar containing the data for the requested region. |
2559 | 2559 |
|
2560 | 2560 | Examples |
2561 | 2561 | -------- |
@@ -2779,7 +2779,7 @@ def get_orthogonal_selection( |
2779 | 2779 | Returns |
2780 | 2780 | ------- |
2781 | 2781 | NDArrayOrScalarLike |
2782 | | - An array-like containing the data for the requested selection. |
| 2782 | + An array-like or scalar containing the data for the requested selection. |
2783 | 2783 |
|
2784 | 2784 | Examples |
2785 | 2785 | -------- |
@@ -3013,7 +3013,7 @@ def get_mask_selection( |
3013 | 3013 | Returns |
3014 | 3014 | ------- |
3015 | 3015 | NDArrayOrScalarLike |
3016 | | - An array-like containing the data for the requested selection. |
| 3016 | + An array-like or scalar containing the data for the requested selection. |
3017 | 3017 |
|
3018 | 3018 | Examples |
3019 | 3019 | -------- |
@@ -3173,7 +3173,7 @@ def get_coordinate_selection( |
3173 | 3173 | Returns |
3174 | 3174 | ------- |
3175 | 3175 | NDArrayOrScalarLike |
3176 | | - An array-like containing the data for the requested coordinate selection. |
| 3176 | + An array-like or scalar containing the data for the requested coordinate selection. |
3177 | 3177 |
|
3178 | 3178 | Examples |
3179 | 3179 | -------- |
@@ -3361,7 +3361,7 @@ def get_block_selection( |
3361 | 3361 | Returns |
3362 | 3362 | ------- |
3363 | 3363 | NDArrayOrScalarLike |
3364 | | - An array-like containing the data for the requested block selection. |
| 3364 | + An array-like or scalar containing the data for the requested block selection. |
3365 | 3365 |
|
3366 | 3366 | Examples |
3367 | 3367 | -------- |
|
0 commit comments