Skip to content

Commit 0700f0b

Browse files
jbrockmendelproost
authored andcommitted
CLN: derivation of nogil param (pandas-dev#29047)
1 parent de69b2b commit 0700f0b

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

pandas/_libs/algos_take_helper.pxi.in

+22-20
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
1212

1313
# name, dest, c_type_in, c_type_out, preval, postval, can_copy, nogil
1414
dtypes = [
15-
('bool', 'bool', 'uint8_t', 'uint8_t', '', '', True, True),
15+
('bool', 'bool', 'uint8_t', 'uint8_t', '', '', True),
1616
('bool', 'object', 'uint8_t', 'object',
17-
'True if ', ' > 0 else False', False, False),
18-
('int8', 'int8', 'int8_t', 'int8_t', '', '', True, False),
19-
('int8', 'int32', 'int8_t', 'int32_t', '', '', False, True),
20-
('int8', 'int64', 'int8_t', 'int64_t', '', '', False, True),
21-
('int8', 'float64', 'int8_t', 'float64_t', '', '', False, True),
22-
('int16', 'int16', 'int16_t', 'int16_t', '', '', True, True),
23-
('int16', 'int32', 'int16_t', 'int32_t', '', '', False, True),
24-
('int16', 'int64', 'int16_t', 'int64_t', '', '', False, True),
25-
('int16', 'float64', 'int16_t', 'float64_t', '', '', False, True),
26-
('int32', 'int32', 'int32_t', 'int32_t', '', '', True, True),
27-
('int32', 'int64', 'int32_t', 'int64_t', '', '', False, True),
28-
('int32', 'float64', 'int32_t', 'float64_t', '', '', False, True),
29-
('int64', 'int64', 'int64_t', 'int64_t', '', '', True, True),
30-
('int64', 'float64', 'int64_t', 'float64_t', '', '', False, True),
31-
('float32', 'float32', 'float32_t', 'float32_t', '', '', True, True),
32-
('float32', 'float64', 'float32_t', 'float64_t', '', '', False, True),
33-
('float64', 'float64', 'float64_t', 'float64_t', '', '', True, True),
34-
('object', 'object', 'object', 'object', '', '', False, False)]
17+
'True if ', ' > 0 else False', False),
18+
('int8', 'int8', 'int8_t', 'int8_t', '', '', True),
19+
('int8', 'int32', 'int8_t', 'int32_t', '', '', False),
20+
('int8', 'int64', 'int8_t', 'int64_t', '', '', False),
21+
('int8', 'float64', 'int8_t', 'float64_t', '', '', False),
22+
('int16', 'int16', 'int16_t', 'int16_t', '', '', True),
23+
('int16', 'int32', 'int16_t', 'int32_t', '', '', False),
24+
('int16', 'int64', 'int16_t', 'int64_t', '', '', False),
25+
('int16', 'float64', 'int16_t', 'float64_t', '', '', False),
26+
('int32', 'int32', 'int32_t', 'int32_t', '', '', True),
27+
('int32', 'int64', 'int32_t', 'int64_t', '', '', False),
28+
('int32', 'float64', 'int32_t', 'float64_t', '', '', False),
29+
('int64', 'int64', 'int64_t', 'int64_t', '', '', True),
30+
('int64', 'float64', 'int64_t', 'float64_t', '', '', False),
31+
('float32', 'float32', 'float32_t', 'float32_t', '', '', True),
32+
('float32', 'float64', 'float32_t', 'float64_t', '', '', False),
33+
('float64', 'float64', 'float64_t', 'float64_t', '', '', True),
34+
('object', 'object', 'object', 'object', '', '', False)]
3535

3636

3737
def get_dispatch(dtypes):
@@ -118,7 +118,9 @@ def get_dispatch(dtypes):
118118
"""
119119

120120
for (name, dest, c_type_in, c_type_out, preval, postval,
121-
can_copy, nogil) in dtypes:
121+
can_copy) in dtypes:
122+
123+
nogil = c_type_out != "object"
122124
if nogil:
123125
nogil_str = "with nogil:"
124126
tab = ' '

0 commit comments

Comments
 (0)