Skip to content

Commit

Permalink
Change DEFs to cdef int constants (#4246)
Browse files Browse the repository at this point in the history
* change DEFs to cdef int constants

* CHANGELOG
  • Loading branch information
hmacdope authored Aug 16, 2023
1 parent 212bf03 commit a14e98d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
??/??/?? IAlibay
??/??/?? IAlibay, hmacdope

* 2.7.0

Expand All @@ -22,6 +22,8 @@ Fixes
Enhancements

Changes
* Cython DEF statments have been replaced with compile time integer constants
as DEF is deprecated as of Cython>=3.0 (Issue #4237, PR #4246)

Deprecations

Expand Down
16 changes: 8 additions & 8 deletions package/MDAnalysis/lib/nsgrid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ import numpy as np
from libcpp.vector cimport vector
from libc cimport math

DEF END = -1
cdef int END = -1

DEF XX = 0
DEF XY = 3
DEF YY = 4
DEF XZ = 6
DEF YZ = 7
DEF ZZ = 8
cdef int XX = 0
cdef int XY = 3
cdef int YY = 4
cdef int XZ = 6
cdef int YZ = 7
cdef int ZZ = 8

# Cube root of the maximum size of a 32 bit signed integer. If the system is divided into more
# grids than this, integer overflow will occur.
DEF MAX_GRID_DIM = 1290
cdef int MAX_GRID_DIM = 1290

ctypedef float coordinate[3]

Expand Down

0 comments on commit a14e98d

Please sign in to comment.