|
8 | 8 | import numpy as np |
9 | 9 | import numpy.typing as npt |
10 | 10 |
|
| 11 | +from zarr._compat import _deprecate_positional_args |
| 12 | +from zarr.abc.codec import Codec, CodecPipeline |
11 | 13 | from zarr.abc.store import set_or_delete |
12 | 14 | from zarr.codecs import BytesCodec |
13 | 15 | from zarr.codecs._v2 import V2Compressor, V2Filters |
@@ -621,6 +623,7 @@ class Array: |
621 | 623 | _async_array: AsyncArray |
622 | 624 |
|
623 | 625 | @classmethod |
| 626 | + @_deprecate_positional_args |
624 | 627 | def create( |
625 | 628 | cls, |
626 | 629 | store: StoreLike, |
@@ -1016,6 +1019,7 @@ def __setitem__(self, selection: Selection, value: npt.ArrayLike) -> None: |
1016 | 1019 | else: |
1017 | 1020 | self.set_basic_selection(cast(BasicSelection, pure_selection), value, fields=fields) |
1018 | 1021 |
|
| 1022 | + @_deprecate_positional_args |
1019 | 1023 | def get_basic_selection( |
1020 | 1024 | self, |
1021 | 1025 | selection: BasicSelection = Ellipsis, |
@@ -1139,6 +1143,7 @@ def get_basic_selection( |
1139 | 1143 | ) |
1140 | 1144 | ) |
1141 | 1145 |
|
| 1146 | + @_deprecate_positional_args |
1142 | 1147 | def set_basic_selection( |
1143 | 1148 | self, |
1144 | 1149 | selection: BasicSelection, |
@@ -1234,6 +1239,7 @@ def set_basic_selection( |
1234 | 1239 | indexer = BasicIndexer(selection, self.shape, self.metadata.chunk_grid) |
1235 | 1240 | sync(self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype)) |
1236 | 1241 |
|
| 1242 | + @_deprecate_positional_args |
1237 | 1243 | def get_orthogonal_selection( |
1238 | 1244 | self, |
1239 | 1245 | selection: OrthogonalSelection, |
@@ -1358,6 +1364,7 @@ def get_orthogonal_selection( |
1358 | 1364 | ) |
1359 | 1365 | ) |
1360 | 1366 |
|
| 1367 | + @_deprecate_positional_args |
1361 | 1368 | def set_orthogonal_selection( |
1362 | 1369 | self, |
1363 | 1370 | selection: OrthogonalSelection, |
@@ -1468,6 +1475,7 @@ def set_orthogonal_selection( |
1468 | 1475 | self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype) |
1469 | 1476 | ) |
1470 | 1477 |
|
| 1478 | + @_deprecate_positional_args |
1471 | 1479 | def get_mask_selection( |
1472 | 1480 | self, |
1473 | 1481 | mask: MaskSelection, |
@@ -1550,6 +1558,7 @@ def get_mask_selection( |
1550 | 1558 | ) |
1551 | 1559 | ) |
1552 | 1560 |
|
| 1561 | + @_deprecate_positional_args |
1553 | 1562 | def set_mask_selection( |
1554 | 1563 | self, |
1555 | 1564 | mask: MaskSelection, |
@@ -1628,6 +1637,7 @@ def set_mask_selection( |
1628 | 1637 | indexer = MaskIndexer(mask, self.shape, self.metadata.chunk_grid) |
1629 | 1638 | sync(self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype)) |
1630 | 1639 |
|
| 1640 | + @_deprecate_positional_args |
1631 | 1641 | def get_coordinate_selection( |
1632 | 1642 | self, |
1633 | 1643 | selection: CoordinateSelection, |
@@ -1717,6 +1727,7 @@ def get_coordinate_selection( |
1717 | 1727 | out_array = np.array(out_array).reshape(indexer.sel_shape) |
1718 | 1728 | return out_array |
1719 | 1729 |
|
| 1730 | + @_deprecate_positional_args |
1720 | 1731 | def set_coordinate_selection( |
1721 | 1732 | self, |
1722 | 1733 | selection: CoordinateSelection, |
@@ -1806,6 +1817,7 @@ def set_coordinate_selection( |
1806 | 1817 |
|
1807 | 1818 | sync(self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype)) |
1808 | 1819 |
|
| 1820 | + @_deprecate_positional_args |
1809 | 1821 | def get_block_selection( |
1810 | 1822 | self, |
1811 | 1823 | selection: BasicSelection, |
@@ -1904,6 +1916,7 @@ def get_block_selection( |
1904 | 1916 | ) |
1905 | 1917 | ) |
1906 | 1918 |
|
| 1919 | + @_deprecate_positional_args |
1907 | 1920 | def set_block_selection( |
1908 | 1921 | self, |
1909 | 1922 | selection: BasicSelection, |
|
0 commit comments