Skip to content

Commit 898b4d9

Browse files
committed
Update tests to pass for numpy 1.26
1 parent eb2f999 commit 898b4d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

numexpr/tests/test_numexpr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,11 @@ def test_expressions(
963963
# "overflows" or "divide by zero" in plain eval().
964964
warnings.simplefilter("ignore")
965965
try:
966-
npval = eval(expr, globals(), locals())
966+
npexpr = expr
967+
if "sign" in expr and dtype==complex and np.__version__<"2.0":
968+
#definition of sign changed in numpy 2.0 for complex numbers
969+
npexpr = expr.replace("sign(b+c)", "(b+c)/abs(b+c)")
970+
npval = eval(npexpr, globals(), locals())
967971
except Exception as ex:
968972
np_exception = ex
969973
npval = None

0 commit comments

Comments
 (0)