Commit 3f7aa3f
Extend __setitem__ to more closely match numpy (#7033)
* First implementation of extended __setitem__
* style and typo
* unite test, and fixes to make it pass. Reinstated 'where' for cases when key is Array
* test ValueErrors are raised for disallowed index combintations
* style
* Comments
* Extra tests: assignment of N-d arrays and brodacasting
* Allow assignment to np.ma.masked, and also to read-only arrays (e.g. da.empty)
* ValueError -> NotImplementedError
* numpy style docstring
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
* Doc strings; value_shape1 renamed to value_common_shape
* Update message format
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
* Update message format
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
* test more non-valid assignments
* Style
* Style
* Prevent corruption of chunks shared between objects - allows, e.g. d[:] = d[::-1]
* Fix f-string
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
* Prevent hanging when value is self - allows, e.g. d[...] = d and d[...] = d[...]
* Fix for integer-valued indices - allows, e.g. d[:, 0] = d[:, 2]
* Restructure code, catch illegal corner cases, remove premature compute
* Reorganise imports
* setitem assignment docs
* fixed labels, add to toctree
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>1 parent 058aef6 commit 3f7aa3f
File tree
5 files changed
+807
-8
lines changed- dask/array
- tests
- docs/source
5 files changed
+807
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
1605 | 1611 | | |
1606 | 1612 | | |
1607 | 1613 | | |
1608 | | - | |
1609 | | - | |
| 1614 | + | |
| 1615 | + | |
1610 | 1616 | | |
| 1617 | + | |
| 1618 | + | |
1611 | 1619 | | |
1612 | 1620 | | |
1613 | 1621 | | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
1614 | 1625 | | |
1615 | 1626 | | |
1616 | 1627 | | |
| |||
1625 | 1636 | | |
1626 | 1637 | | |
1627 | 1638 | | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1631 | 1666 | | |
1632 | 1667 | | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
1633 | 1759 | | |
1634 | 1760 | | |
1635 | 1761 | | |
| |||
0 commit comments