Skip to content

Commit efe0480

Browse files
committed
Deal with another random name change
1 parent 0cd6283 commit efe0480

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

quaternionic/utilities.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import sys
66
import functools
7+
import numpy as np
78

89
ufunc_attributes = [
910
'nin', 'nout', 'nargs', 'ntypes', 'types', 'identity', 'signature',
@@ -69,7 +70,6 @@ def convert_numpy_ufunc_type_to_numba_ftylist(typelist):
6970
# 'e': numba.half, # numba.half doesn't exist
7071
# 'f': numba.single, # numba.single doesn't exist
7172
'f': numba.float32, # probably closest
72-
'd': numba.float_,
7373
# 'g': numba.longfloat, # numba.longfloat doesn't exist
7474
'g': numba.double, # probably closest
7575
# 'F': numba.csingle, # numba.csingle doesn't exist
@@ -78,6 +78,10 @@ def convert_numpy_ufunc_type_to_numba_ftylist(typelist):
7878
'D': numba.complex128, # probably closest
7979
# 'G': numba.clongfloat, # numba.clongfloat doesn't exist
8080
}
81+
try: # This is broken on numpy >= 2.0
82+
map_numpy_typecode_to_numba_type["d"] = numba.float_
83+
except:
84+
pass
8185

8286
ftylist = []
8387
for types in typelist:

tests/test_utilities.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def f1(a, b, c):
7070
def test_types_to_ftylist():
7171
import numba
7272
types_to_ftylist = quaternionic.utilities.convert_numpy_ufunc_type_to_numba_ftylist
73-
types = '?bhilqpBHILQPfdgF->D'
73+
types = '?bhilqpBHILQPfgF->D'
7474
ftylist = numba.complex128(
7575
numba.boolean,
7676
numba.byte,
@@ -86,7 +86,6 @@ def test_types_to_ftylist():
8686
numba.ulonglong,
8787
numba.uintp,
8888
numba.float32,
89-
numba.float_,
9089
numba.double,
9190
numba.complex64,
9291
)

0 commit comments

Comments
 (0)