Skip to content

Commit 17a7f72

Browse files
authored
Merge pull request #75 from astro-informatics/numpy
Add `cnp.import_array` for `numpy>=2`
2 parents c83fb2a + fe6d56f commit 17a7f72

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install build packages and pytest
2323
run: |
2424
python -m pip install --upgrade pip wheel setuptools
25-
python -m pip install "conan<2" scikit-build pytest cython numpy
25+
python -m pip install "conan<2" scikit-build pytest cython numpy>=2
2626
2727
- name: Create sdist
2828
run: python setup.py sdist

src/pyssht/cpyssht.pyx

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import numpy as np
55
cimport numpy as np
66
cimport cython
77

8+
# required if using any part of the numpy PyArray_* API
9+
np.import_array()
10+
811
from libc.math cimport log, exp, sqrt, atan2, cos, sin, asin, atan, tan
912
from scipy.special import factorial
1013
from scipy.interpolate import interp2d

src/pyssht/ducc_interface.pyx

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import numpy as np
22
cimport numpy as np
33

4+
# required if using any part of the numpy PyArray_* API
5+
np.import_array()
6+
47
cdef import_ducc0():
58
import ducc0
69
major, minor, patch = ducc0.__version__.split('.')

0 commit comments

Comments
 (0)