summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-07-13 12:43:02 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2022-07-13 12:43:02 -0700
commitb1d2335618e51382de5da9d7cf7832062236e7d8 (patch)
treed318919a86032bc4148a29a382ad348789e78daf
parent37846563156b3ed8287fc94d6a7d107a316c5ecf (diff)
downloadnumpy-b1d2335618e51382de5da9d7cf7832062236e7d8.tar.gz
BUG: Fix experimental dtype slot numbers
Unfortunately, I forgot to move them around when introducing ensure_canonical, but the code relies on the order for simplicitly currently... Which doesn't matter, just means that the DType part of the experimental ufunc API is completely unusable in 1.23 right now.
-rw-r--r--numpy/core/include/numpy/experimental_dtype_api.h7
-rw-r--r--numpy/core/src/multiarray/experimental_public_dtype_api.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/numpy/core/include/numpy/experimental_dtype_api.h b/numpy/core/include/numpy/experimental_dtype_api.h
index 23e9a8d21..1fbd41981 100644
--- a/numpy/core/include/numpy/experimental_dtype_api.h
+++ b/numpy/core/include/numpy/experimental_dtype_api.h
@@ -336,8 +336,9 @@ typedef int (PyArrayMethod_StridedLoop)(PyArrayMethod_Context *context,
#define NPY_DT_default_descr 3
#define NPY_DT_common_dtype 4
#define NPY_DT_common_instance 5
-#define NPY_DT_setitem 6
-#define NPY_DT_getitem 7
+#define NPY_DT_ensure_canonical 6
+#define NPY_DT_setitem 7
+#define NPY_DT_getitem 8
// TODO: These slots probably still need some thought, and/or a way to "grow"?
@@ -457,7 +458,7 @@ PyArray_GetDefaultDescr(PyArray_DTypeMeta *DType)
*/
#if !defined(NO_IMPORT) && !defined(NO_IMPORT_ARRAY)
-#define __EXPERIMENTAL_DTYPE_VERSION 4
+#define __EXPERIMENTAL_DTYPE_VERSION 5
static int
import_experimental_dtype_api(int version)
diff --git a/numpy/core/src/multiarray/experimental_public_dtype_api.c b/numpy/core/src/multiarray/experimental_public_dtype_api.c
index 441dbdc1f..36350c832 100644
--- a/numpy/core/src/multiarray/experimental_public_dtype_api.c
+++ b/numpy/core/src/multiarray/experimental_public_dtype_api.c
@@ -16,7 +16,7 @@
#include "common_dtype.h"
-#define EXPERIMENTAL_DTYPE_API_VERSION 4
+#define EXPERIMENTAL_DTYPE_API_VERSION 5
typedef struct{
@@ -117,7 +117,7 @@ PyArray_ArrFuncs default_funcs = {
/* other slots are in order, so keep only last around: */
-#define NUM_DTYPE_SLOTS 7
+#define NUM_DTYPE_SLOTS 8
int