Skip to content

BUG: Fix experimental dtype slot numbers #21979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions numpy/core/include/numpy/experimental_dtype_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"?
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions numpy/core/src/multiarray/experimental_public_dtype_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "common_dtype.h"


#define EXPERIMENTAL_DTYPE_API_VERSION 4
#define EXPERIMENTAL_DTYPE_API_VERSION 5


typedef struct{
Expand Down Expand Up @@ -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
Expand Down