Skip to content

Commit 4967351

Browse files
committed
moving cimport to helper, so it can become a template
1 parent 89c4110 commit 4967351

File tree

2 files changed

+24
-41
lines changed

2 files changed

+24
-41
lines changed

pandas/_libs/hashtable.pyx

-41
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,6 @@ cnp.import_array()
1414

1515
from pandas._libs cimport util
1616
from pandas._libs.khash cimport (
17-
kh_destroy_float64,
18-
kh_destroy_int64,
19-
kh_destroy_int32,
20-
kh_destroy_pymap,
21-
kh_destroy_str,
22-
kh_destroy_uint64,
23-
kh_exist_float64,
24-
kh_exist_int64,
25-
kh_exist_int32,
26-
kh_exist_pymap,
27-
kh_exist_str,
28-
kh_exist_uint64,
29-
kh_float64_t,
30-
kh_get_float64,
31-
kh_get_int64,
32-
kh_get_int32,
33-
kh_get_pymap,
34-
kh_get_str,
35-
kh_get_strbox,
36-
kh_get_uint64,
37-
kh_init_float64,
38-
kh_init_int64,
39-
kh_init_int32,
40-
kh_init_pymap,
41-
kh_init_str,
42-
kh_init_strbox,
43-
kh_init_uint64,
44-
kh_int64_t,
45-
kh_put_float64,
46-
kh_put_int64,
47-
kh_put_int32,
48-
kh_put_pymap,
49-
kh_put_str,
50-
kh_put_strbox,
51-
kh_put_uint64,
52-
kh_resize_float64,
53-
kh_resize_int64,
54-
kh_resize_int32,
55-
kh_resize_pymap,
56-
kh_resize_str,
57-
kh_resize_uint64,
5817
kh_str_t,
5918
khiter_t,
6019
)

pandas/_libs/hashtable_class_helper.pxi.in

+24
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
55
"""
66

77

8+
9+
{{py:
10+
11+
# name
12+
cimported_types = ['float64',
13+
'int64',
14+
'int32',
15+
'pymap',
16+
'str',
17+
'strbox',
18+
'uint64']
19+
}}
20+
21+
{{for name in cimported_types}}
22+
from pandas._libs.khash cimport (
23+
kh_destroy_{{name}},
24+
kh_exist_{{name}},
25+
kh_get_{{name}},
26+
kh_init_{{name}},
27+
kh_put_{{name}},
28+
kh_resize_{{name}},
29+
)
30+
{{endfor}}
31+
832
# ----------------------------------------------------------------------
933
# VectorData
1034
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)