| 1764 | } |
| 1765 | |
| 1766 | static int |
| 1767 | npyiter_iterrange_set( |
| 1768 | NewNpyArrayIterObject *self, PyObject *value, void *NPY_UNUSED(ignored)) |
| 1769 | { |
| 1770 | npy_intp istart = 0, iend = 0; |
| 1771 | |
| 1772 | if (value == NULL) { |
| 1773 | PyErr_SetString(PyExc_AttributeError, |
| 1774 | "Cannot delete nditer iterrange"); |
| 1775 | return -1; |
| 1776 | } |
| 1777 | if (self->iter == NULL) { |
| 1778 | PyErr_SetString(PyExc_ValueError, |
| 1779 | "Iterator is invalid"); |
| 1780 | return -1; |
| 1781 | } |
| 1782 | |
| 1783 | if (!PyArg_ParseTuple(value, "nn", &istart, &iend)) { |
| 1784 | return -1; |
| 1785 | } |
| 1786 | |
| 1787 | if (NpyIter_ResetToIterIndexRange(self->iter, istart, iend, NULL) |
| 1788 | != NPY_SUCCEED) { |
| 1789 | return -1; |
| 1790 | } |
| 1791 | if (istart < iend) { |
| 1792 | self->started = self->finished = 0; |
| 1793 | } |
| 1794 | else { |
| 1795 | self->started = self->finished = 1; |
| 1796 | } |
| 1797 | |
| 1798 | if (self->get_multi_index == NULL && NpyIter_HasMultiIndex(self->iter)) { |
| 1799 | self->get_multi_index = NpyIter_GetGetMultiIndex(self->iter, NULL); |
| 1800 | } |
| 1801 | |
| 1802 | /* If there is nesting, the nested iterators should be reset */ |
| 1803 | if (npyiter_resetbasepointers(self) != NPY_SUCCEED) { |
| 1804 | return -1; |
| 1805 | } |
| 1806 | |
| 1807 | return 0; |
| 1808 | } |
| 1809 | |
| 1810 | static PyObject * |
| 1811 | npyiter_has_delayed_bufalloc_get( |
nothing calls this directly
no test coverage detected