diff options
| author | Matti Picus <matti.picus@gmail.com> | 2021-12-18 19:05:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-18 11:05:35 -0600 |
| commit | bb95cf015165bcf85f99ba0d28a7a6e727ca955b (patch) | |
| tree | 17e398814b9e2ac45788f9afb4fb37fdefa76b5f /numpy/core/include | |
| parent | 0302205105161c6bbae5d45fe4e7a5a624f0dbf4 (diff) | |
| download | numpy-bb95cf015165bcf85f99ba0d28a7a6e727ca955b.tar.gz | |
DEP: remove NPY_ARRAY_UPDATEIFCOPY, deprecated in 1.14 (#20589)
* DEP: remove NPY_ARRAY_UPDATEIFCOPY, deprecated in 1.14
* remove more UPDATEIFCOPY
* typo: add missing comma
* remove a few more UPDATEIFCOPY
* Add release note
* remove UPDATEIFCOPY from comment (from review)
Diffstat (limited to 'numpy/core/include')
| -rw-r--r-- | numpy/core/include/numpy/ndarrayobject.h | 19 | ||||
| -rw-r--r-- | numpy/core/include/numpy/ndarraytypes.h | 7 | ||||
| -rw-r--r-- | numpy/core/include/numpy/noprefix.h | 1 | ||||
| -rw-r--r-- | numpy/core/include/numpy/npy_1_7_deprecated_api.h | 1 |
4 files changed, 3 insertions, 25 deletions
diff --git a/numpy/core/include/numpy/ndarrayobject.h b/numpy/core/include/numpy/ndarrayobject.h index 2eb951486..aaaefd7de 100644 --- a/numpy/core/include/numpy/ndarrayobject.h +++ b/numpy/core/include/numpy/ndarrayobject.h @@ -152,19 +152,16 @@ extern "C" { (k)*PyArray_STRIDES(obj)[2] + \ (l)*PyArray_STRIDES(obj)[3])) -/* Move to arrayobject.c once PyArray_XDECREF_ERR is removed */ static NPY_INLINE void PyArray_DiscardWritebackIfCopy(PyArrayObject *arr) { PyArrayObject_fields *fa = (PyArrayObject_fields *)arr; if (fa && fa->base) { - if ((fa->flags & NPY_ARRAY_UPDATEIFCOPY) || - (fa->flags & NPY_ARRAY_WRITEBACKIFCOPY)) { + if (fa->flags & NPY_ARRAY_WRITEBACKIFCOPY) { PyArray_ENABLEFLAGS((PyArrayObject*)fa->base, NPY_ARRAY_WRITEABLE); Py_DECREF(fa->base); fa->base = NULL; PyArray_CLEARFLAGS(arr, NPY_ARRAY_WRITEBACKIFCOPY); - PyArray_CLEARFLAGS(arr, NPY_ARRAY_UPDATEIFCOPY); } } } @@ -246,20 +243,6 @@ NPY_TITLE_KEY_check(PyObject *key, PyObject *value) #define DEPRECATE(msg) PyErr_WarnEx(PyExc_DeprecationWarning,msg,1) #define DEPRECATE_FUTUREWARNING(msg) PyErr_WarnEx(PyExc_FutureWarning,msg,1) -#if !defined(NPY_NO_DEPRECATED_API) || \ - (NPY_NO_DEPRECATED_API < NPY_1_14_API_VERSION) -static NPY_INLINE void -PyArray_XDECREF_ERR(PyArrayObject *arr) -{ - /* 2017-Nov-10 1.14 */ - DEPRECATE("PyArray_XDECREF_ERR is deprecated, call " - "PyArray_DiscardWritebackIfCopy then Py_XDECREF instead"); - PyArray_DiscardWritebackIfCopy(arr); - Py_XDECREF(arr); -} -#endif - - #ifdef __cplusplus } #endif diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h index 6240adc0c..0bd259983 100644 --- a/numpy/core/include/numpy/ndarraytypes.h +++ b/numpy/core/include/numpy/ndarraytypes.h @@ -934,7 +934,6 @@ typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *); * This flag may be requested in constructor functions. * This flag may be tested for in PyArray_FLAGS(arr). */ -#define NPY_ARRAY_UPDATEIFCOPY 0x1000 /* Deprecated in 1.14 */ #define NPY_ARRAY_WRITEBACKIFCOPY 0x2000 /* @@ -965,14 +964,12 @@ typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *); #define NPY_ARRAY_DEFAULT (NPY_ARRAY_CARRAY) #define NPY_ARRAY_IN_ARRAY (NPY_ARRAY_CARRAY_RO) #define NPY_ARRAY_OUT_ARRAY (NPY_ARRAY_CARRAY) -#define NPY_ARRAY_INOUT_ARRAY (NPY_ARRAY_CARRAY | \ - NPY_ARRAY_UPDATEIFCOPY) +#define NPY_ARRAY_INOUT_ARRAY (NPY_ARRAY_CARRAY) #define NPY_ARRAY_INOUT_ARRAY2 (NPY_ARRAY_CARRAY | \ NPY_ARRAY_WRITEBACKIFCOPY) #define NPY_ARRAY_IN_FARRAY (NPY_ARRAY_FARRAY_RO) #define NPY_ARRAY_OUT_FARRAY (NPY_ARRAY_FARRAY) -#define NPY_ARRAY_INOUT_FARRAY (NPY_ARRAY_FARRAY | \ - NPY_ARRAY_UPDATEIFCOPY) +#define NPY_ARRAY_INOUT_FARRAY (NPY_ARRAY_FARRAY) #define NPY_ARRAY_INOUT_FARRAY2 (NPY_ARRAY_FARRAY | \ NPY_ARRAY_WRITEBACKIFCOPY) diff --git a/numpy/core/include/numpy/noprefix.h b/numpy/core/include/numpy/noprefix.h index 2c0ce1420..cea5b0d46 100644 --- a/numpy/core/include/numpy/noprefix.h +++ b/numpy/core/include/numpy/noprefix.h @@ -165,7 +165,6 @@ #define ALIGNED NPY_ALIGNED #define NOTSWAPPED NPY_NOTSWAPPED #define WRITEABLE NPY_WRITEABLE -#define UPDATEIFCOPY NPY_UPDATEIFCOPY #define WRITEBACKIFCOPY NPY_ARRAY_WRITEBACKIFCOPY #define ARR_HAS_DESCR NPY_ARR_HAS_DESCR #define BEHAVED NPY_BEHAVED diff --git a/numpy/core/include/numpy/npy_1_7_deprecated_api.h b/numpy/core/include/numpy/npy_1_7_deprecated_api.h index 4fd4015a9..6455d40d2 100644 --- a/numpy/core/include/numpy/npy_1_7_deprecated_api.h +++ b/numpy/core/include/numpy/npy_1_7_deprecated_api.h @@ -48,7 +48,6 @@ #define NPY_ALIGNED NPY_ARRAY_ALIGNED #define NPY_NOTSWAPPED NPY_ARRAY_NOTSWAPPED #define NPY_WRITEABLE NPY_ARRAY_WRITEABLE -#define NPY_UPDATEIFCOPY NPY_ARRAY_UPDATEIFCOPY #define NPY_BEHAVED NPY_ARRAY_BEHAVED #define NPY_BEHAVED_NS NPY_ARRAY_BEHAVED_NS #define NPY_CARRAY NPY_ARRAY_CARRAY |
