Skip to content

Commit 6846da9

Browse files
authored
Merge pull request #23919 from seberg/slash-headers-and-interrupt
API: Remove interrupt handling and `noprefix.h`
2 parents 4af0bab + 2560870 commit 6846da9

12 files changed

Lines changed: 15 additions & 333 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* ``npy_interrupt.h`` and the corresponding macros like ``NPY_SIGINT_ON``
2+
have been removed. We recommend querying ``PyErr_CheckSignals()`` or
3+
``PyOS_InterruptOccurred()`` periodically. (These do currently require
4+
holding the GIL though).
5+
* The ``noprefix.h`` header has been removed, replace missing symbols with
6+
their prefixed counterparts (usually an added ``NPY_`` or ``npy_``).

numpy/__init__.cython-30.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,6 @@ cdef extern from "numpy/arrayobject.h":
706706
int PyArray_ClipmodeConverter (object, NPY_CLIPMODE *) except 0
707707
#int PyArray_OutputConverter (object, ndarray*) except 0
708708
object PyArray_BroadcastToShape (object, npy_intp *, int)
709-
void _PyArray_SigintHandler (int)
710-
void* _PyArray_GetSigintBuf ()
711709
#int PyArray_DescrAlignConverter (object, dtype*) except 0
712710
#int PyArray_DescrAlignConverter2 (object, dtype*) except 0
713711
int PyArray_SearchsideConverter (object, void *) except 0

numpy/__init__.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,6 @@ cdef extern from "numpy/arrayobject.h":
664664
int PyArray_ClipmodeConverter (object, NPY_CLIPMODE *) except 0
665665
#int PyArray_OutputConverter (object, ndarray*) except 0
666666
object PyArray_BroadcastToShape (object, npy_intp *, int)
667-
void _PyArray_SigintHandler (int)
668-
void* _PyArray_GetSigintBuf ()
669667
#int PyArray_DescrAlignConverter (object, dtype*) except 0
670668
#int PyArray_DescrAlignConverter2 (object, dtype*) except 0
671669
int PyArray_SearchsideConverter (object, void *) except 0

numpy/core/code_generators/cversions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@
7373
0x00000011 = ca1aebdad799358149567d9d93cbca09
7474

7575
# Version 18 (NumPy 2.0.0)
76-
0x00000012 = 877c68ac06924a4e7cbd3cd5c9342efd
76+
0x00000012 = 84ccd4605c1ef315af287637a706b0fc

numpy/core/code_generators/numpy_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def get_annotations():
9898
# define _PyArrayScalar_BoolValues ((PyBoolScalarObject *)PyArray_API[8])
9999

100100
multiarray_funcs_api = {
101-
'__unused_indices__': [67, 68, 163, 164, 278],
101+
'__unused_indices__': [67, 68, 163, 164, 201, 202, 278],
102102
'PyArray_GetNDArrayCVersion': (0,),
103103
'PyArray_SetNumericOps': (40,),
104104
'PyArray_GetNumericOps': (41,),
@@ -261,8 +261,8 @@ def get_annotations():
261261
'PyArray_ClipmodeConverter': (198,),
262262
'PyArray_OutputConverter': (199,),
263263
'PyArray_BroadcastToShape': (200,),
264-
'_PyArray_SigintHandler': (201,),
265-
'_PyArray_GetSigintBuf': (202,),
264+
# Unused slot 201, was `_PyArray_SigintHandler`
265+
# Unused slot 202, was `_PyArray_GetSigintBuf`
266266
'PyArray_DescrAlignConverter': (203,),
267267
'PyArray_DescrAlignConverter2': (204,),
268268
'PyArray_SearchsideConverter': (205,),

numpy/core/include/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ installed_headers = [
77
'numpy/halffloat.h',
88
'numpy/ndarrayobject.h',
99
'numpy/ndarraytypes.h',
10-
'numpy/noprefix.h',
1110
'numpy/npy_1_7_deprecated_api.h',
1211
'numpy/npy_3kcompat.h',
1312
'numpy/npy_common.h',
1413
'numpy/npy_cpu.h',
1514
'numpy/npy_endian.h',
16-
'numpy/npy_interrupt.h',
1715
'numpy/npy_math.h',
1816
'numpy/npy_no_deprecated_api.h',
1917
'numpy/npy_os.h',

numpy/core/include/numpy/arrayobject.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,5 @@
33
#define Py_ARRAYOBJECT_H
44

55
#include "ndarrayobject.h"
6-
#include "npy_interrupt.h"
7-
8-
#ifdef NPY_NO_PREFIX
9-
#include "noprefix.h"
10-
#endif
116

127
#endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_ */

numpy/core/include/numpy/noprefix.h

Lines changed: 0 additions & 211 deletions
This file was deleted.

numpy/core/include/numpy/npy_interrupt.h

Lines changed: 0 additions & 56 deletions
This file was deleted.

numpy/core/setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,6 @@ def get_mathlib_info(*args):
809809
join('include', 'numpy', '_neighborhood_iterator_imp.h'),
810810
join('include', 'numpy', 'npy_endian.h'),
811811
join('include', 'numpy', 'arrayscalars.h'),
812-
join('include', 'numpy', 'noprefix.h'),
813-
join('include', 'numpy', 'npy_interrupt.h'),
814812
join('include', 'numpy', 'npy_3kcompat.h'),
815813
join('include', 'numpy', 'npy_math.h'),
816814
join('include', 'numpy', 'halffloat.h'),

0 commit comments

Comments
 (0)