diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-01-15 18:29:59 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-01-15 18:31:47 -0600 |
commit | 68e8d47e68a45ed1ce2fd2870e78265f051a2ceb (patch) | |
tree | 90ec3a6f94b746586ffb22abd68fcc036d4d2d8e /numpy | |
parent | b425ce69054daee63bd43ec922d1c741e1a8e97b (diff) | |
download | numpy-68e8d47e68a45ed1ce2fd2870e78265f051a2ceb.tar.gz |
DEP: Actually deprecate fasttake and fastclipmask
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/usertypes.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c index 2e8fb514f..9ab3a2a5e 100644 --- a/numpy/core/src/multiarray/usertypes.c +++ b/numpy/core/src/multiarray/usertypes.c @@ -128,6 +128,32 @@ PyArray_InitArrFuncs(PyArray_ArrFuncs *f) f->cancastto = NULL; } + +static int +test_deprecated_arrfuncs_members(PyArray_ArrFuncs *f) { + /* NumPy 1.19, 2020-01-15 */ + if (f->fastputmask != NULL) { + if (DEPRECATE( + "The ->f->fastputmask member of custom dtypes is ignored; " + "setting it may be an error in the future.\n" + "The custom dtype you are using must be revised, but " + "results will not be affected.") < 0) { + return -1; + } + } + /* NumPy 1.19, 2020-01-15 */ + if (f->fasttake != NULL) { + if (DEPRECATE( + "The ->f->fastputmask member of custom dtypes is ignored; " + "setting it may be an error in the future.\n" + "The custom dtype you are using must be revised, but " + "results will not be affected.") < 0) { + return -1; + } + } + return 0; +} + /* returns typenum to associate with this type >=NPY_USERDEF. needs the userdecrs table and PyArray_NUMUSER variables @@ -176,6 +202,11 @@ PyArray_RegisterDataType(PyArray_Descr *descr) PyErr_SetString(PyExc_ValueError, "missing typeobject"); return -1; } + + if (test_deprecated_arrfuncs_members(f) < 0) { + return -1; + } + userdescrs = realloc(userdescrs, (NPY_NUMUSERTYPES+1)*sizeof(void *)); if (userdescrs == NULL) { |