diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/calculation.c | 17 | ||||
-rw-r--r-- | numpy/core/src/multiarray/usertypes.c | 12 |
2 files changed, 21 insertions, 8 deletions
diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c index b9ed5a9e8..92ab75053 100644 --- a/numpy/core/src/multiarray/calculation.c +++ b/numpy/core/src/multiarray/calculation.c @@ -926,14 +926,15 @@ PyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *o } } - /* NumPy 1.17.0, 2019-02-24 */ - if (DEPRECATE( - "->f->fastclip is deprecated. Use PyUFunc_RegisterLoopForDescr to " - "attach a custom loop to np.core.umath.clip, np.minimum, and " - "np.maximum") < 0) { - return NULL; - } - /* everything below can be removed once this deprecation completes */ + /* + * NumPy 1.17.0, 2019-02-24 + * NumPy 1.19.0, 2020-01-15 + * + * Setting `->f->fastclip to anything but NULL has been deprecated in 1.19 + * the code path below was previously deprecated since 1.17. + * (the deprecation moved to registration time instead of execution time) + * everything below can be removed once this deprecation completes + */ if (func == NULL || (min != NULL && !PyArray_CheckAnyScalar(min)) diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c index 9ab3a2a5e..997467b4d 100644 --- a/numpy/core/src/multiarray/usertypes.c +++ b/numpy/core/src/multiarray/usertypes.c @@ -151,6 +151,18 @@ test_deprecated_arrfuncs_members(PyArray_ArrFuncs *f) { return -1; } } + /* NumPy 1.19, 2020-01-15 */ + if (f->fastclip != NULL) { + /* fastclip was already deprecated at execution time in 1.17. */ + if (DEPRECATE( + "The ->f->fastclip member of custom dtypes is deprecated; " + "setting it will be an error in the future.\n" + "The custom dtype you are using must be changed to use " + "PyUFunc_RegisterLoopForDescr to attach a custom loop to " + "np.core.umath.clip, np.minimum, and np.maximum") < 0) { + return -1; + } + } return 0; } |