|
9 | 9 | import numpy as np |
10 | 10 | import numpy.typing as npt |
11 | 11 |
|
| 12 | +from zarr._compat import _deprecate_positional_args |
12 | 13 | from zarr.abc.codec import Codec, CodecPipeline |
13 | 14 | from zarr.abc.store import set_or_delete |
14 | 15 | from zarr.codecs import BytesCodec |
@@ -604,6 +605,7 @@ class Array: |
604 | 605 | _async_array: AsyncArray |
605 | 606 |
|
606 | 607 | @classmethod |
| 608 | + @_deprecate_positional_args |
607 | 609 | def create( |
608 | 610 | cls, |
609 | 611 | store: StoreLike, |
@@ -999,6 +1001,7 @@ def __setitem__(self, selection: Selection, value: npt.ArrayLike) -> None: |
999 | 1001 | else: |
1000 | 1002 | self.set_basic_selection(cast(BasicSelection, pure_selection), value, fields=fields) |
1001 | 1003 |
|
| 1004 | + @_deprecate_positional_args |
1002 | 1005 | def get_basic_selection( |
1003 | 1006 | self, |
1004 | 1007 | selection: BasicSelection = Ellipsis, |
@@ -1122,6 +1125,7 @@ def get_basic_selection( |
1122 | 1125 | ) |
1123 | 1126 | ) |
1124 | 1127 |
|
| 1128 | + @_deprecate_positional_args |
1125 | 1129 | def set_basic_selection( |
1126 | 1130 | self, |
1127 | 1131 | selection: BasicSelection, |
@@ -1217,6 +1221,7 @@ def set_basic_selection( |
1217 | 1221 | indexer = BasicIndexer(selection, self.shape, self.metadata.chunk_grid) |
1218 | 1222 | sync(self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype)) |
1219 | 1223 |
|
| 1224 | + @_deprecate_positional_args |
1220 | 1225 | def get_orthogonal_selection( |
1221 | 1226 | self, |
1222 | 1227 | selection: OrthogonalSelection, |
@@ -1341,6 +1346,7 @@ def get_orthogonal_selection( |
1341 | 1346 | ) |
1342 | 1347 | ) |
1343 | 1348 |
|
| 1349 | + @_deprecate_positional_args |
1344 | 1350 | def set_orthogonal_selection( |
1345 | 1351 | self, |
1346 | 1352 | selection: OrthogonalSelection, |
@@ -1451,6 +1457,7 @@ def set_orthogonal_selection( |
1451 | 1457 | self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype) |
1452 | 1458 | ) |
1453 | 1459 |
|
| 1460 | + @_deprecate_positional_args |
1454 | 1461 | def get_mask_selection( |
1455 | 1462 | self, |
1456 | 1463 | mask: MaskSelection, |
@@ -1533,6 +1540,7 @@ def get_mask_selection( |
1533 | 1540 | ) |
1534 | 1541 | ) |
1535 | 1542 |
|
| 1543 | + @_deprecate_positional_args |
1536 | 1544 | def set_mask_selection( |
1537 | 1545 | self, |
1538 | 1546 | mask: MaskSelection, |
@@ -1611,6 +1619,7 @@ def set_mask_selection( |
1611 | 1619 | indexer = MaskIndexer(mask, self.shape, self.metadata.chunk_grid) |
1612 | 1620 | sync(self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype)) |
1613 | 1621 |
|
| 1622 | + @_deprecate_positional_args |
1614 | 1623 | def get_coordinate_selection( |
1615 | 1624 | self, |
1616 | 1625 | selection: CoordinateSelection, |
@@ -1700,6 +1709,7 @@ def get_coordinate_selection( |
1700 | 1709 | out_array = np.array(out_array).reshape(indexer.sel_shape) |
1701 | 1710 | return out_array |
1702 | 1711 |
|
| 1712 | + @_deprecate_positional_args |
1703 | 1713 | def set_coordinate_selection( |
1704 | 1714 | self, |
1705 | 1715 | selection: CoordinateSelection, |
@@ -1789,6 +1799,7 @@ def set_coordinate_selection( |
1789 | 1799 |
|
1790 | 1800 | sync(self._async_array._set_selection(indexer, value, fields=fields, prototype=prototype)) |
1791 | 1801 |
|
| 1802 | + @_deprecate_positional_args |
1792 | 1803 | def get_block_selection( |
1793 | 1804 | self, |
1794 | 1805 | selection: BasicSelection, |
@@ -1887,6 +1898,7 @@ def get_block_selection( |
1887 | 1898 | ) |
1888 | 1899 | ) |
1889 | 1900 |
|
| 1901 | + @_deprecate_positional_args |
1890 | 1902 | def set_block_selection( |
1891 | 1903 | self, |
1892 | 1904 | selection: BasicSelection, |
|
0 commit comments