Skip to content

Commit 9b3c5a5

Browse files
committed
use template for uint64/float64/int32-map
1 parent 8983425 commit 9b3c5a5

File tree

1 file changed

+5
-49
lines changed

1 file changed

+5
-49
lines changed

pandas/_libs/khash_for_primitive_helper.pxi.in

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
77
{{py:
88

99
# name, c_type
10-
primitive_types = [('int64', 'int64_t')]
10+
primitive_types = [('int64', 'int64_t'),
11+
('uint64', 'uint64_t'),
12+
('float64', 'float64_t'),
13+
('int32', 'int32_t'),
14+
]
1115
}}
1216

1317
{{for name, c_type in primitive_types}}
@@ -34,51 +38,3 @@ cdef extern from "khash_python.h":
3438
cdef extern from "khash_python.h":
3539

3640
ctypedef uint64_t khuint64_t
37-
38-
ctypedef struct kh_uint64_t:
39-
khint_t n_buckets, size, n_occupied, upper_bound
40-
uint32_t *flags
41-
khuint64_t *keys
42-
size_t *vals
43-
44-
kh_uint64_t* kh_init_uint64() nogil
45-
void kh_destroy_uint64(kh_uint64_t*) nogil
46-
void kh_clear_uint64(kh_uint64_t*) nogil
47-
khint_t kh_get_uint64(kh_uint64_t*, uint64_t) nogil
48-
void kh_resize_uint64(kh_uint64_t*, khint_t) nogil
49-
khint_t kh_put_uint64(kh_uint64_t*, uint64_t, int*) nogil
50-
void kh_del_uint64(kh_uint64_t*, khint_t) nogil
51-
52-
bint kh_exist_uint64(kh_uint64_t*, khiter_t) nogil
53-
54-
ctypedef struct kh_float64_t:
55-
khint_t n_buckets, size, n_occupied, upper_bound
56-
uint32_t *flags
57-
float64_t *keys
58-
size_t *vals
59-
60-
kh_float64_t* kh_init_float64() nogil
61-
void kh_destroy_float64(kh_float64_t*) nogil
62-
void kh_clear_float64(kh_float64_t*) nogil
63-
khint_t kh_get_float64(kh_float64_t*, float64_t) nogil
64-
void kh_resize_float64(kh_float64_t*, khint_t) nogil
65-
khint_t kh_put_float64(kh_float64_t*, float64_t, int*) nogil
66-
void kh_del_float64(kh_float64_t*, khint_t) nogil
67-
68-
bint kh_exist_float64(kh_float64_t*, khiter_t) nogil
69-
70-
ctypedef struct kh_int32_t:
71-
khint_t n_buckets, size, n_occupied, upper_bound
72-
uint32_t *flags
73-
int32_t *keys
74-
size_t *vals
75-
76-
kh_int32_t* kh_init_int32() nogil
77-
void kh_destroy_int32(kh_int32_t*) nogil
78-
void kh_clear_int32(kh_int32_t*) nogil
79-
khint_t kh_get_int32(kh_int32_t*, int32_t) nogil
80-
void kh_resize_int32(kh_int32_t*, khint_t) nogil
81-
khint_t kh_put_int32(kh_int32_t*, int32_t, int*) nogil
82-
void kh_del_int32(kh_int32_t*, khint_t) nogil
83-
84-
bint kh_exist_int32(kh_int32_t*, khiter_t) nogil

0 commit comments

Comments
 (0)