Skip to content

Commit

Permalink
Deal with another random name change
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Jul 17, 2024
1 parent 0cd6283 commit efe0480
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion quaternionic/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import sys
import functools
import numpy as np

ufunc_attributes = [
'nin', 'nout', 'nargs', 'ntypes', 'types', 'identity', 'signature',
Expand Down Expand Up @@ -69,7 +70,6 @@ def convert_numpy_ufunc_type_to_numba_ftylist(typelist):
# 'e': numba.half, # numba.half doesn't exist
# 'f': numba.single, # numba.single doesn't exist
'f': numba.float32, # probably closest
'd': numba.float_,
# 'g': numba.longfloat, # numba.longfloat doesn't exist
'g': numba.double, # probably closest
# 'F': numba.csingle, # numba.csingle doesn't exist
Expand All @@ -78,6 +78,10 @@ def convert_numpy_ufunc_type_to_numba_ftylist(typelist):
'D': numba.complex128, # probably closest
# 'G': numba.clongfloat, # numba.clongfloat doesn't exist
}
try: # This is broken on numpy >= 2.0
map_numpy_typecode_to_numba_type["d"] = numba.float_
except:
pass

ftylist = []
for types in typelist:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def f1(a, b, c):
def test_types_to_ftylist():
import numba
types_to_ftylist = quaternionic.utilities.convert_numpy_ufunc_type_to_numba_ftylist
types = '?bhilqpBHILQPfdgF->D'
types = '?bhilqpBHILQPfgF->D'
ftylist = numba.complex128(
numba.boolean,
numba.byte,
Expand All @@ -86,7 +86,6 @@ def test_types_to_ftylist():
numba.ulonglong,
numba.uintp,
numba.float32,
numba.float_,
numba.double,
numba.complex64,
)
Expand Down

0 comments on commit efe0480

Please sign in to comment.