From 3b372f0b3fc29300552904182f18bd8213a3824e Mon Sep 17 00:00:00 2001 From: Jonathan L Long Date: Tue, 2 May 2017 16:09:35 -0700 Subject: [PATCH] BUG: ndarray.conjugate broken for custom dtypes (unlike np.conjugate) This is especially relevant to moble's numpy quaternion library, which will silently fail to conjugate when using ndarray.conjugate. --- numpy/core/src/multiarray/calculation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c index c82c6c46c173..be69f0167009 100644 --- a/numpy/core/src/multiarray/calculation.c +++ b/numpy/core/src/multiarray/calculation.c @@ -1173,7 +1173,8 @@ PyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *o NPY_NO_EXPORT PyObject * PyArray_Conjugate(PyArrayObject *self, PyArrayObject *out) { - if (PyArray_ISCOMPLEX(self) || PyArray_ISOBJECT(self)) { + if (PyArray_ISCOMPLEX(self) || PyArray_ISOBJECT(self) || + PyArray_ISUSERDEF(self)) { if (out == NULL) { return PyArray_GenericUnaryFunction(self, n_ops.conjugate);