If I make a notebook with cells
%load_ext cython
and
%%cython -a
cimport numpy as cnp
then the second one outputs
In file included from /home/ignoring_gravity/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960,
from /home/ignoring_gravity/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/ignoring_gravity/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
from /home/ignoring_gravity/.cache/ipython/cython/_cython_magic_7ec32efe76f8c3e83109f4fadb9a4e1f.c:765:
/home/ignoring_gravity/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
My question is - where should I put#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION? If I change the second cell to
%%cython -a
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
cimport numpy as cnp
then it still gives the same warning