@@ -43,7 +43,7 @@ cdef class Criterion:
4343
4444 cdef int init(self , const DOUBLE_t[:, ::1 ] y, DOUBLE_t* sample_weight,
4545 double weighted_n_samples, SIZE_t* samples, SIZE_t start,
46- SIZE_t end) nogil except - 1 :
46+ SIZE_t end) except - 1 nogil :
4747 """ Placeholder for a method which will initialize the criterion.
4848
4949 Returns -1 in case of failure to allocate memory (and raise MemoryError)
@@ -69,22 +69,22 @@ cdef class Criterion:
6969
7070 pass
7171
72- cdef int reset(self ) nogil except - 1 :
72+ cdef int reset(self ) except - 1 nogil :
7373 """ Reset the criterion at pos=start.
7474
7575 This method must be implemented by the subclass.
7676 """
7777
7878 pass
7979
80- cdef int reverse_reset(self ) nogil except - 1 :
80+ cdef int reverse_reset(self ) except - 1 nogil :
8181 """ Reset the criterion at pos=end.
8282
8383 This method must be implemented by the subclass.
8484 """
8585 pass
8686
87- cdef int update(self , SIZE_t new_pos) nogil except - 1 :
87+ cdef int update(self , SIZE_t new_pos) except - 1 nogil :
8888 """ Updated statistics by moving samples[pos:new_pos] to the left child.
8989
9090 This updates the collected statistics by moving samples[pos:new_pos]
@@ -268,7 +268,7 @@ cdef class ClassificationCriterion(Criterion):
268268
269269 cdef int init(self , const DOUBLE_t[:, ::1 ] y,
270270 DOUBLE_t* sample_weight, double weighted_n_samples,
271- SIZE_t* samples, SIZE_t start, SIZE_t end) nogil except - 1 :
271+ SIZE_t* samples, SIZE_t start, SIZE_t end) except - 1 nogil :
272272 """ Initialize the criterion at node samples[start:end] and
273273 children samples[start:start] and samples[start:end].
274274
@@ -333,7 +333,7 @@ cdef class ClassificationCriterion(Criterion):
333333 self .reset()
334334 return 0
335335
336- cdef int reset(self ) nogil except - 1 :
336+ cdef int reset(self ) except - 1 nogil :
337337 """ Reset the criterion at pos=start
338338
339339 Returns -1 in case of failure to allocate memory (and raise MemoryError)
@@ -360,7 +360,7 @@ cdef class ClassificationCriterion(Criterion):
360360 sum_right += self .sum_stride
361361 return 0
362362
363- cdef int reverse_reset(self ) nogil except - 1 :
363+ cdef int reverse_reset(self ) except - 1 nogil :
364364 """ Reset the criterion at pos=end
365365
366366 Returns -1 in case of failure to allocate memory (and raise MemoryError)
@@ -387,7 +387,7 @@ cdef class ClassificationCriterion(Criterion):
387387 sum_right += self .sum_stride
388388 return 0
389389
390- cdef int update(self , SIZE_t new_pos) nogil except - 1 :
390+ cdef int update(self , SIZE_t new_pos) except - 1 nogil :
391391 """ Updated statistics by moving samples[pos:new_pos] to the left child.
392392
393393 Returns -1 in case of failure to allocate memory (and raise MemoryError)
@@ -729,7 +729,7 @@ cdef class RegressionCriterion(Criterion):
729729
730730 cdef int init(self , const DOUBLE_t[:, ::1 ] y, DOUBLE_t* sample_weight,
731731 double weighted_n_samples, SIZE_t* samples, SIZE_t start,
732- SIZE_t end) nogil except - 1 :
732+ SIZE_t end) except - 1 nogil :
733733 """ Initialize the criterion at node samples[start:end] and
734734 children samples[start:start] and samples[start:end]."""
735735 # Initialize fields
@@ -770,7 +770,7 @@ cdef class RegressionCriterion(Criterion):
770770 self .reset()
771771 return 0
772772
773- cdef int reset(self ) nogil except - 1 :
773+ cdef int reset(self ) except - 1 nogil :
774774 """ Reset the criterion at pos=start."""
775775 cdef SIZE_t n_bytes = self .n_outputs * sizeof(double )
776776 memset(self .sum_left, 0 , n_bytes)
@@ -781,7 +781,7 @@ cdef class RegressionCriterion(Criterion):
781781 self .pos = self .start
782782 return 0
783783
784- cdef int reverse_reset(self ) nogil except - 1 :
784+ cdef int reverse_reset(self ) except - 1 nogil :
785785 """ Reset the criterion at pos=end."""
786786 cdef SIZE_t n_bytes = self .n_outputs * sizeof(double )
787787 memset(self .sum_right, 0 , n_bytes)
@@ -792,7 +792,7 @@ cdef class RegressionCriterion(Criterion):
792792 self .pos = self .end
793793 return 0
794794
795- cdef int update(self , SIZE_t new_pos) nogil except - 1 :
795+ cdef int update(self , SIZE_t new_pos) except - 1 nogil :
796796 """ Updated statistics by moving samples[pos:new_pos] to the left."""
797797
798798 cdef double * sum_left = self .sum_left
@@ -1013,7 +1013,7 @@ cdef class MAE(RegressionCriterion):
10131013
10141014 cdef int init(self , const DOUBLE_t[:, ::1 ] y, DOUBLE_t* sample_weight,
10151015 double weighted_n_samples, SIZE_t* samples, SIZE_t start,
1016- SIZE_t end) nogil except - 1 :
1016+ SIZE_t end) except - 1 nogil :
10171017 """ Initialize the criterion at node samples[start:end] and
10181018 children samples[start:start] and samples[start:end]."""
10191019
@@ -1061,7 +1061,7 @@ cdef class MAE(RegressionCriterion):
10611061 self .reset()
10621062 return 0
10631063
1064- cdef int reset(self ) nogil except - 1 :
1064+ cdef int reset(self ) except - 1 nogil :
10651065 """ Reset the criterion at pos=start
10661066
10671067 Returns -1 in case of failure to allocate memory (and raise MemoryError)
@@ -1093,7 +1093,7 @@ cdef class MAE(RegressionCriterion):
10931093 weight)
10941094 return 0
10951095
1096- cdef int reverse_reset(self ) nogil except - 1 :
1096+ cdef int reverse_reset(self ) except - 1 nogil :
10971097 """ Reset the criterion at pos=end
10981098
10991099 Returns -1 in case of failure to allocate memory (and raise MemoryError)
@@ -1122,7 +1122,7 @@ cdef class MAE(RegressionCriterion):
11221122 weight)
11231123 return 0
11241124
1125- cdef int update(self , SIZE_t new_pos) nogil except - 1 :
1125+ cdef int update(self , SIZE_t new_pos) except - 1 nogil :
11261126 """ Updated statistics by moving samples[pos:new_pos] to the left
11271127
11281128 Returns -1 in case of failure to allocate memory (and raise MemoryError)
0 commit comments