Skip to content

FIX: Remove deprecated Numpy C API macros #589

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scott-huberty
Copy link

@scott-huberty scott-huberty commented Jun 24, 2025

If I understand correctly, NPY_OWNDATA and NPY_BEHAVED were deprecated in v1.7 (which was released over a decade ago), in favor of NPY_ARRAY_OWNDATA and NPY_ARRAY_BEHAVED (ref ). These macros were officially removed in Numpy v2.3.

When installing locally I was hitting this error, and as far as I can tell, your CI's will hit these too:

      ../../lib/fff_python_wrapper/fffpy.c:44:29: error: use of undeclared identifier 'NPY_BEHAVED'
                                                        (void*)x, itemsize, NPY_BEHAVED, NULL);
                                                                            ^
      ../../lib/fff_python_wrapper/fffpy.c:143:29: error: use of undeclared identifier 'NPY_OWNDATA'
          x->flags = (x->flags) | NPY_OWNDATA;
                                  ^
      ../../lib/fff_python_wrapper/fffpy.c:169:27: error: use of undeclared identifier 'NPY_OWNDATA'
        x->flags = (x->flags) | NPY_OWNDATA;
                                ^
      ../../lib/fff_python_wrapper/fffpy.c:247:29: error: use of undeclared identifier 'NPY_OWNDATA'
          x->flags = (x->flags) | NPY_OWNDATA;
                                  ^
      ../../lib/fff_python_wrapper/fffpy.c:281:27: error: use of undeclared identifier 'NPY_OWNDATA'
        x->flags = (x->flags) | NPY_OWNDATA;
                                ^
      ../../lib/fff_python_wrapper/fffpy.c:470:27: error: use of undeclared identifier 'NPY_OWNDATA'
        x->flags = (x->flags) | NPY_OWNDATA;

If I understand correctly, NPY_OWNDATA and NPY_BEHAVED were deprecated in v1.7, which was released over a decade ago. These macros were officially removed in Numpy v2.3 (released June 2025).

- https://github.com/numpy/numpy/releases/tag/v2.3.0
- https://numpy.org/devdocs/release/1.7.0-notes.html
- https://github.com/numpy/numpy/blob/v1.12.0b1/numpy/core/include/numpy/npy_1_7_deprecated_api.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant