File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,24 @@ cdef Py_ssize_t _INIT_VEC_CAP = 128
55
55
include " hashtable_class_helper.pxi"
56
56
include " hashtable_func_helper.pxi"
57
57
58
+
59
+ # map derived hash-map types onto basic hash-map types:
60
+ if np.dtype(np.intp) == np.dtype(np.int64):
61
+ IntpHashTable = Int64HashTable
62
+ value_count_intp = value_count_int64
63
+ duplicated_intp = duplicated_int64
64
+ ismember_intp = ismember_int64
65
+ mode_intp = mode_int64
66
+ elif np.dtype(np.intp) == np.dtype(np.int32):
67
+ IntpHashTable = Int32HashTable
68
+ value_count_intp = value_count_int32
69
+ duplicated_intp = duplicated_int32
70
+ ismember_intp = ismember_int32
71
+ mode_intp = mode_int32
72
+ else :
73
+ raise ValueError (np.dtype(np.intp))
74
+
75
+
58
76
cdef class Factorizer:
59
77
cdef readonly:
60
78
Py_ssize_t count
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ def get_allocated_khash_memory():
43
43
(ht .UInt16HashTable , np .uint16 ),
44
44
(ht .Int8HashTable , np .int8 ),
45
45
(ht .UInt8HashTable , np .uint8 ),
46
+ (ht .IntpHashTable , np .intp ),
46
47
],
47
48
)
48
49
class TestHashTable :
@@ -297,6 +298,7 @@ def get_ht_function(fun_name, type_suffix):
297
298
(np .uint16 , "uint16" ),
298
299
(np .int8 , "int8" ),
299
300
(np .uint8 , "uint8" ),
301
+ (np .intp , "intp" ),
300
302
],
301
303
)
302
304
class TestHelpFunctions :
You can’t perform that action at this time.
0 commit comments