Skip to content

Commit 2c0667f

Browse files
committed
refactor: Change order of nogil and except to fix compiler warnings
Signed-off-by: bluedrink9 <[email protected]>
1 parent 58ea512 commit 2c0667f

File tree

6 files changed

+992
-993
lines changed

6 files changed

+992
-993
lines changed

econml/tree/_criterion.pxd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ cdef class Criterion:
6666
# Methods
6767
cdef int init(self, const DOUBLE_t[:, ::1] y,
6868
DOUBLE_t* sample_weight, double weighted_n_samples,
69-
SIZE_t* samples) nogil except -1
70-
cdef int node_reset(self, SIZE_t start, SIZE_t end) nogil except -1
71-
cdef int reset(self) nogil except -1
72-
cdef int reverse_reset(self) nogil except -1
73-
cdef int update(self, SIZE_t new_pos) nogil except -1
69+
SIZE_t* samples) except -1 nogil
70+
cdef int node_reset(self, SIZE_t start, SIZE_t end) except -1 nogil
71+
cdef int reset(self) except -1 nogil
72+
cdef int reverse_reset(self) except -1 nogil
73+
cdef int update(self, SIZE_t new_pos) except -1 nogil
7474
cdef double node_impurity(self) nogil
7575
cdef double proxy_node_impurity(self) nogil
7676
cdef void children_impurity(self, double* impurity_left,

econml/tree/_splitter.pxd

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ cdef class Splitter:
103103
cdef int init_sample_inds(self, SIZE_t* samples,
104104
const SIZE_t[::1] np_samples,
105105
DOUBLE_t* sample_weight,
106-
SIZE_t* n_samples, double* weighted_n_samples) nogil except -1
106+
SIZE_t* n_samples, double* weighted_n_samples) except -1 nogil
107107

108108
cdef int init(self, const DTYPE_t[:, :] X, const DOUBLE_t[:, ::1] y,
109109
DOUBLE_t* sample_weight,
110110
const SIZE_t[::1] np_samples_train,
111-
const SIZE_t[::1] np_samples_val) nogil except -1
111+
const SIZE_t[::1] np_samples_val) except -1 nogil
112112

113113
cdef int node_reset(self, SIZE_t start, SIZE_t end, double* weighted_n_node_samples,
114-
SIZE_t start_val, SIZE_t end_val, double* weighted_n_node_samples_val) nogil except -1
114+
SIZE_t start_val, SIZE_t end_val, double* weighted_n_node_samples_val) except -1 nogil
115115

116116
cdef int node_split(self,
117117
double impurity, # Impurity of the node
118118
SplitRecord* split,
119-
SIZE_t* n_constant_features) nogil except -1
119+
SIZE_t* n_constant_features) except -1 nogil
120120

121121
cdef void node_value_val(self, double* dest) nogil
122122
cdef void node_jacobian_val(self, double* dest) nogil
@@ -126,4 +126,3 @@ cdef class Splitter:
126126
cdef double proxy_node_impurity(self) nogil
127127
cdef double proxy_node_impurity_val(self) nogil
128128
cdef bint is_children_impurity_proxy(self) nogil
129-

econml/tree/_tree.pxd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ cdef class Tree:
6969
double impurity_train, SIZE_t n_node_samples_train,
7070
double weighted_n_samples_train,
7171
double impurity_val, SIZE_t n_node_samples_val,
72-
double weighted_n_samples_val) nogil except -1
73-
cdef int _resize(self, SIZE_t capacity) nogil except -1
74-
cdef int _resize_c(self, SIZE_t capacity=*) nogil except -1
72+
double weighted_n_samples_val) except -1 nogil
73+
cdef int _resize(self, SIZE_t capacity) except -1 nogil
74+
cdef int _resize_c(self, SIZE_t capacity=*) except -1 nogil
7575

7676
cdef np.ndarray _get_value_ndarray(self)
7777
cdef np.ndarray _get_jac_ndarray(self)

0 commit comments

Comments
 (0)