Skip to content

Commit 3d2b2a5

Browse files
authored
Merge pull request #331 from jcapriot/cython3.0_updates
Add a noexcept clause to the wrapper function
2 parents 156335c + 8acb337 commit 3d2b2a5

3 files changed

Lines changed: 38 additions & 9 deletions

File tree

discretize/_extensions/tree_ext.pyx

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ cdef class TreeCell:
300300
def _level(self):
301301
return self._cell.level
302302

303-
cdef int _evaluate_func(void* function, c_Cell* cell) with gil:
303+
cdef int _evaluate_func(void* function, c_Cell* cell) noexcept with gil:
304304
# Wraps a function to be called in C++
305305
func = <object> function
306306
pycell = TreeCell()
@@ -750,6 +750,7 @@ cdef class _TreeMesh:
750750

751751
cdef int l
752752
cdef int max_level = self.max_level
753+
cdef int i
753754
for i in range(n_segments):
754755
l = ls[i]
755756
if l < 0:
@@ -5354,8 +5355,16 @@ cdef class _TreeMesh:
53545355

53555356
int_t ii, i, j, offset
53565357
c_Cell *cell
5357-
c_Cell *i0, *i1
5358-
Edge *i000, *i001, *i010, *i011, *i100, *i101, *i110, *i111
5358+
c_Cell *i0
5359+
c_Cell *i1
5360+
Edge *i000
5361+
Edge *i001
5362+
Edge *i010
5363+
Edge *i011
5364+
Edge *i100
5365+
Edge *i101
5366+
Edge *i110
5367+
Edge *i111
53595368
double x, y, z
53605369
double w1, w2, w3
53615370
double eps = 100*np.finfo(float).eps
@@ -5485,9 +5494,22 @@ cdef class _TreeMesh:
54855494

54865495
int_t ii, i, offset
54875496
c_Cell *cell
5488-
c_Cell *i00, *i01, *i10, *i11
5489-
Face *f000, *f001, *f010, *f011, *f100, *f101, *f110, *f111
5490-
Edge *e00, *e01, *e10, *e11
5497+
c_Cell *i00
5498+
c_Cell *i01
5499+
c_Cell *i10
5500+
c_Cell *i11
5501+
Face *f000
5502+
Face *f001
5503+
Face *f010
5504+
Face *f011
5505+
Face *f100
5506+
Face *f101
5507+
Face *f110
5508+
Face *f111
5509+
Edge *e00
5510+
Edge *e01
5511+
Edge *e10
5512+
Edge *e11
54915513
double x, y, z
54925514
double w1, w2, w3
54935515
double eps = 100*np.finfo(float).eps
@@ -5749,7 +5771,14 @@ cdef class _TreeMesh:
57495771
np.float64_t w0, w1, w2
57505772

57515773
int_t ii, i
5752-
c_Cell *i000, *i001, *i010, *i011, *i100, *i101, *i110, *i111
5774+
c_Cell *i000
5775+
c_Cell *i001
5776+
c_Cell *i010
5777+
c_Cell *i011
5778+
c_Cell *i100
5779+
c_Cell *i101
5780+
c_Cell *i110
5781+
c_Cell *i111
57535782
c_Cell *cell
57545783
double x, y, z
57555784
double eps = 100*np.finfo(float).eps

environment_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- numpy>=1.20
66
- scipy>=1.8
7-
- cython>=0.29
7+
- cython>=0.29.31
88
- setuptools_scm
99
- pymatsolver>=0.1.2
1010
- matplotlib

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
build_requires = [
3333
"numpy>=1.20",
34-
"cython>=0.29",
34+
"cython>=0.29.31",
3535
"setuptools_scm",
3636
]
3737

0 commit comments

Comments
 (0)