From c1afec5d5bf2fcae901122db218e26e56336a6cc Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Mon, 17 Jun 2024 11:52:43 +0100 Subject: [PATCH 1/2] Add `cnp.import_array` for `numpy>=2` --- src/pyssht/cpyssht.pyx | 3 +++ src/pyssht/ducc_interface.pyx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/pyssht/cpyssht.pyx b/src/pyssht/cpyssht.pyx index 337fc8c..2419ad3 100644 --- a/src/pyssht/cpyssht.pyx +++ b/src/pyssht/cpyssht.pyx @@ -5,6 +5,9 @@ import numpy as np cimport numpy as np cimport cython +# required if using any part of the numpy PyArray_* API +np.import_array() + from libc.math cimport log, exp, sqrt, atan2, cos, sin, asin, atan, tan from scipy.special import factorial from scipy.interpolate import interp2d diff --git a/src/pyssht/ducc_interface.pyx b/src/pyssht/ducc_interface.pyx index f23f12b..c1acaca 100644 --- a/src/pyssht/ducc_interface.pyx +++ b/src/pyssht/ducc_interface.pyx @@ -1,6 +1,9 @@ import numpy as np cimport numpy as np +# required if using any part of the numpy PyArray_* API +np.import_array() + cdef import_ducc0(): import ducc0 major, minor, patch = ducc0.__version__.split('.') From fe6d56f2ea31b97c31f7931361defcea0cc19785 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Thu, 20 Jun 2024 09:57:27 +0100 Subject: [PATCH 2/2] Force `numpy==2` --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7bf4d29..0a7c49f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -22,7 +22,7 @@ jobs: - name: Install build packages and pytest run: | python -m pip install --upgrade pip wheel setuptools - python -m pip install "conan<2" scikit-build pytest cython numpy + python -m pip install "conan<2" scikit-build pytest cython numpy>=2 - name: Create sdist run: python setup.py sdist