Skip to content

Commit d9ab327

Browse files
committed
moving cimport to helper, so it can become a template
1 parent 5ab4d68 commit d9ab327

File tree

2 files changed

+24
-45
lines changed

2 files changed

+24
-45
lines changed

pandas/_libs/hashtable.pyx

+1-45
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,7 @@ cnp.import_array()
1313

1414

1515
from pandas._libs cimport util
16-
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,
58-
kh_str_t,
59-
khiter_t,
60-
)
16+
from pandas._libs.khash cimport kh_str_t, khiter_t
6117
from pandas._libs.missing cimport checknull
6218

6319

pandas/_libs/hashtable_class_helper.pxi.in

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

77

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

0 commit comments

Comments
 (0)