Skip to content

Commit

Permalink
Merge pull request #75 from astro-informatics/numpy
Browse files Browse the repository at this point in the history
Add `cnp.import_array` for `numpy>=2`
  • Loading branch information
mdavezac authored Jul 1, 2024
2 parents c83fb2a + fe6d56f commit 17a7f72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/pyssht/cpyssht.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/pyssht/ducc_interface.pyx
Original file line number Diff line number Diff line change
@@ -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('.')
Expand Down

0 comments on commit 17a7f72

Please sign in to comment.