Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BLD: remove upper bound for Cython (drop deprecated DEF statements)
Browse files Browse the repository at this point in the history
neutrinoceros committed Jul 20, 2024
1 parent a093170 commit 82994dc
Showing 5 changed files with 14 additions and 19 deletions.
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -2,10 +2,7 @@
# keep in sync with .github/workflows/wheels.yaml
requires = [
"setuptools>=61.2",

# for the upper pin in Cython
# see https://github.com/yt-project/yt/issues/4044
"Cython>=3.0.3, <3.1",
"Cython>=3.0.3",
"numpy>=2.0.0",
"ewah-bool-utils>=1.2.0",
]
17 changes: 11 additions & 6 deletions yt/utilities/lib/geometry_utils.pxd
Original file line number Diff line number Diff line change
@@ -11,12 +11,17 @@ cimport numpy as np
from libc.float cimport DBL_MANT_DIG
from libc.math cimport frexp, ldexp, sqrt

DEF ORDER_MAX=20
DEF INDEX_MAX_64=2097151
# TODO: Handle error for indices past max
DEF XSHIFT=2
DEF YSHIFT=1
DEF ZSHIFT=0
cdef enum:
ORDER_MAX=20

cdef enum:
# TODO: Handle error for indices past max
INDEX_MAX_64=2097151

cdef enum:
XSHIFT=2
YSHIFT=1
ZSHIFT=0

@cython.cdivision(True)
@cython.boundscheck(False)
6 changes: 0 additions & 6 deletions yt/utilities/lib/geometry_utils.pyx
Original file line number Diff line number Diff line change
@@ -23,12 +23,6 @@ from yt.utilities.exceptions import YTDomainOverflow

from yt.utilities.lib.vec3_ops cimport L2_norm, cross, dot, subtract

DEF ORDER_MAX=20
DEF INDEX_MAX_64=2097151
DEF XSHIFT=2
DEF YSHIFT=1
DEF ZSHIFT=0

cdef extern from "math.h":
double exp(double x) noexcept nogil
float expf(float x) noexcept nogil
3 changes: 2 additions & 1 deletion yt/utilities/lib/image_samplers.pxd
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@ cimport numpy as np
from .partitioned_grid cimport PartitionedGrid
from .volume_container cimport VolumeContainer

DEF Nch = 4
cdef enum:
Nch = 4

# NOTE: We don't want to import the field_interpolator_tables here, as it
# breaks a bunch of C++ interop. Maybe some day it won't. So, we just forward
2 changes: 0 additions & 2 deletions yt/utilities/lib/image_samplers.pyx
Original file line number Diff line number Diff line change
@@ -37,8 +37,6 @@ from ._octree_raytracing cimport RayInfo, _OctreeRayTracing
cdef extern from "platform_dep.h":
long int lrint(double x) noexcept nogil

DEF Nch = 4

from cython.parallel import parallel, prange

from cpython.exc cimport PyErr_CheckSignals

0 comments on commit 82994dc

Please sign in to comment.