Skip to content

Commit

Permalink
Fix Cython 3 and Numpy 2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Feb 12, 2024
1 parent 3887db6 commit 8f6cff3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
shell: bash -l {0}
run: |
python -m pip install \
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ \
--no-deps --pre --upgrade \
matplotlib \
numpy \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel", "numpy", "Cython", "versioneer-518"]
requires = ["setuptools", "wheel", "numpy", "Cython>=3", "versioneer-518"]
build-backend = "setuptools.build_meta"

[tool.ruff]
Expand Down
1 change: 1 addition & 0 deletions pyresample/ewa/_fornav.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cimport cpython
cimport cython
cimport numpy

numpy.import_array()

cdef extern from "_fornav_templates.h":
ctypedef float weight_type
Expand Down
2 changes: 2 additions & 0 deletions pyresample/ewa/_ll2cr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ from pyproj import Proj
cimport cython
cimport numpy

numpy.import_array()

# column and rows can only be doubles for now until the PROJ.4 is linked directly so float->double casting can be done
# inside the loop
ctypedef fused cr_dtype:
Expand Down
1 change: 1 addition & 0 deletions pyresample/gradient/_gradient_search.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ctypedef np.double_t DTYPE_t
cimport cython
from libc.math cimport fabs, isinf

np.import_array()

@cython.boundscheck(False)
@cython.wraparound(False)
Expand Down

0 comments on commit 8f6cff3

Please sign in to comment.