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 @@ -65,6 +65,24 @@ cdef Py_ssize_t _INIT_VEC_CAP = 128
65
65
include " hashtable_class_helper.pxi"
66
66
include " hashtable_func_helper.pxi"
67
67
68
+
69
+ # map derived hash-map types onto basic hash-map types:
70
+ if np.dtype(np.intp) == np.dtype(np.int64):
71
+ IntpHashTable = Int64HashTable
72
+ value_count_intp = value_count_int64
73
+ duplicated_intp = duplicated_int64
74
+ ismember_intp = ismember_int64
75
+ mode_intp = mode_int64
76
+ elif np.dtype(np.intp) == np.dtype(np.int32):
77
+ IntpHashTable = Int32HashTable
78
+ value_count_intp = value_count_int32
79
+ duplicated_intp = duplicated_int32
80
+ ismember_intp = ismember_int32
81
+ mode_intp = mode_int32
82
+ else :
83
+ raise ValueError (np.dtype(np.intp))
84
+
85
+
68
86
cdef class Factorizer:
69
87
cdef readonly:
70
88
Py_ssize_t count
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ def get_allocated_khash_memory():
44
44
(ht .UInt16HashTable , np .uint16 ),
45
45
(ht .Int8HashTable , np .int8 ),
46
46
(ht .UInt8HashTable , np .uint8 ),
47
+ (ht .IntpHashTable , np .intp ),
47
48
],
48
49
)
49
50
class TestHashTable :
@@ -389,6 +390,7 @@ def get_ht_function(fun_name, type_suffix):
389
390
(np .uint16 , "uint16" ),
390
391
(np .int8 , "int8" ),
391
392
(np .uint8 , "uint8" ),
393
+ (np .intp , "intp" ),
392
394
],
393
395
)
394
396
class TestHelpFunctions :
You can’t perform that action at this time.
0 commit comments