Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unumpy test to be compatible with numpy 2 #225

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/test_unumpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ def test_broadcast_funcs():
# Some functions do not bear the same name in the math module and
# in NumPy (acos instead of arccos, etc.):
assert unumpy.arccos(arr)[1] == uncertainties.umath.acos(arr[1])
# The acos() function should not exist in unumpy because it does
# not exist in numpy:
assert not hasattr(numpy, 'acos')

# The acos() function should not exist in unumpy because the function
# should have been renamed to arccos(). Starting with numpy 2 numpy.acos()
# is an alias to numpy.arccos(). If similar aliases are added to unumpy,
# the following tests can be removed.
assert not hasattr(unumpy, 'acos')

# Test of the __all__ variable:
Expand Down Expand Up @@ -297,4 +299,4 @@ def test_array_comparisons():

# For matrices, 1D arrays are converted to 2D arrays:
mat = unumpy.umatrix([1, 2], [1, 4])
assert numpy.all((mat == [mat[0,0], 4]) == [True, False])
assert numpy.all((mat == [mat[0,0], 4]) == [True, False])
Loading