File: 0001-MNT-stop-using-deprecated-numpy-macros.patch

package info (click to toggle)
pyopencl 2025.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,336 kB
  • sloc: python: 21,012; cpp: 7,986; lisp: 3,539; ansic: 523; makefile: 45; sh: 37
file content (49 lines) | stat: -rw-r--r-- 1,497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From a56381055c6b4a75d69f62be82a4b72ee6d1d7ab Mon Sep 17 00:00:00 2001
From: Thomas A Caswell <tcaswell@bnl.gov>
Date: Wed, 12 Feb 2025 16:52:52 -0500
Subject: [PATCH] MNT: stop using deprecated numpy macros

These were deprecated in np1.7 and will be removed in np2.3 (currently removed
on numpy main branch).

xref https://github.com/numpy/numpy/pull/28254/
---
 src/wrap_cl.hpp      | 4 ++--
 src/wrap_helpers.hpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp
index 5b225d3c..d61f3d54 100644
--- a/src/wrap_cl.hpp
+++ b/src/wrap_cl.hpp
@@ -5893,9 +5893,9 @@ namespace pyopencl
 
     int ary_flags = 0;
     if (order == NPY_FORTRANORDER)
-      ary_flags |= NPY_FARRAY;
+      ary_flags |= NPY_ARRAY_FARRAY;
     else if (order == NPY_CORDER)
-      ary_flags |= NPY_CARRAY;
+      ary_flags |= NPY_ARRAY_CARRAY;
     else
       throw std::runtime_error("unrecognized order specifier");
 
diff --git a/src/wrap_helpers.hpp b/src/wrap_helpers.hpp
index 36774953..04106593 100644
--- a/src/wrap_helpers.hpp
+++ b/src/wrap_helpers.hpp
@@ -142,9 +142,9 @@ namespace py = nanobind;
     \
     int ary_flags = 0; \
     if (order == NPY_FORTRANORDER) \
-      ary_flags |= NPY_FARRAY; \
+      ary_flags |= NPY_ARRAY_FARRAY; \
     else if (order == NPY_CORDER) \
-      ary_flags |= NPY_CARRAY; \
+      ary_flags |= NPY_ARRAY_CARRAY; \
     else \
       throw std::runtime_error("unrecognized order specifier"); \
     \
-- 
2.39.5