From b7e96d7697c98cb1dfa30af65382af68b44c4fb8 Mon Sep 17 00:00:00 2001 From: "Konstantin (Tino) Sering" Date: Tue, 19 Sep 2023 14:27:29 +0200 Subject: [PATCH] bumps Cython version to 3.0.0; adds explicit Cython language levels and removes numpy deprecations warnings --- pyndl/correlation_openmp.pyx | 1 + pyndl/error_codes.pxd | 2 ++ pyndl/ndl_openmp.pyx | 1 + pyndl/ndl_parallel.pxd | 3 +++ pyndl/ndl_parallel.pyx | 1 + pyproject.toml | 2 +- 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pyndl/correlation_openmp.pyx b/pyndl/correlation_openmp.pyx index 1939cc2..6627a27 100644 --- a/pyndl/correlation_openmp.pyx +++ b/pyndl/correlation_openmp.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION import numpy as np cimport numpy as np diff --git a/pyndl/error_codes.pxd b/pyndl/error_codes.pxd index 1e5e2fe..df9dec8 100644 --- a/pyndl/error_codes.pxd +++ b/pyndl/error_codes.pxd @@ -1,3 +1,5 @@ +# cython: language_level=3 + cdef enum ErrorCode: NO_ERROR = 0 MAGIC_NUMBER_DOES_NOT_MATCH = 1 diff --git a/pyndl/ndl_openmp.pyx b/pyndl/ndl_openmp.pyx index a5306f1..54afcd6 100644 --- a/pyndl/ndl_openmp.pyx +++ b/pyndl/ndl_openmp.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION import numpy as np import math diff --git a/pyndl/ndl_parallel.pxd b/pyndl/ndl_parallel.pxd index 378788b..0b5bf1e 100644 --- a/pyndl/ndl_parallel.pxd +++ b/pyndl/ndl_parallel.pxd @@ -1,3 +1,6 @@ +# cython: language_level=3 +# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION + cimport numpy as np ctypedef np.float64_t dtype_t from error_codes cimport ErrorCode diff --git a/pyndl/ndl_parallel.pyx b/pyndl/ndl_parallel.pyx index d1ef52d..1c0e254 100644 --- a/pyndl/ndl_parallel.pyx +++ b/pyndl/ndl_parallel.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION import numpy as np import math diff --git a/pyproject.toml b/pyproject.toml index 8498931..d9e1688 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ scipy = "^1.9.0" pandas = "^1.4.3" xarray = "^2022.6.0" netCDF4 = "^1.6.0" -Cython = "^0.29.32" +Cython = "^3.0.0" [tool.poetry.dev-dependencies] pytest = "^7.0"