| 814 | } |
| 815 | |
| 816 | static int |
| 817 | array_imag_set(PyArrayObject *self, PyObject *val, void *NPY_UNUSED(ignored)) |
| 818 | { |
| 819 | if (val == NULL) { |
| 820 | PyErr_SetString(PyExc_AttributeError, |
| 821 | "Cannot delete array imaginary part"); |
| 822 | return -1; |
| 823 | } |
| 824 | if (PyArray_ISCOMPLEX(self)) { |
| 825 | PyArrayObject *ret; |
| 826 | PyArrayObject *new; |
| 827 | int retcode; |
| 828 | |
| 829 | ret = _get_part(self, 1); |
| 830 | if (ret == NULL) { |
| 831 | return -1; |
| 832 | } |
| 833 | new = (PyArrayObject *)PyArray_FROM_O(val); |
| 834 | if (new == NULL) { |
| 835 | Py_DECREF(ret); |
| 836 | return -1; |
| 837 | } |
| 838 | retcode = PyArray_MoveInto(ret, new); |
| 839 | Py_DECREF(ret); |
| 840 | Py_DECREF(new); |
| 841 | return retcode; |
| 842 | } |
| 843 | else { |
| 844 | PyErr_SetString(PyExc_TypeError, |
| 845 | "array does not have imaginary part to set"); |
| 846 | return -1; |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | static PyObject * |
| 851 | array_flat_get(PyArrayObject *self, void *NPY_UNUSED(ignored)) |
nothing calls this directly
no test coverage detected