Skip to content

Commit

Permalink
Fix numpy warnings (#293)
Browse files Browse the repository at this point in the history
* fix warnings and test on python 3.12

* remove python 3.12
  • Loading branch information
blink1073 committed Jun 19, 2023
1 parent 2e854b8 commit 63fe22d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions oct2py/tests/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_scalars(self):
try:
assert np.allclose(incoming, outgoing)
except (ValueError, TypeError, NotImplementedError, AssertionError):
assert np.alltrue(np.array(incoming).astype(typecode) == outgoing)
assert np.all(np.array(incoming).astype(typecode) == outgoing)

def test_ndarrays(self):
"""Send ndarrays and make sure we get the same array back"""
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_ndarrays(self):
if "c" in incoming.dtype.str:
incoming = np.abs(incoming)
outgoing = np.abs(outgoing)
assert np.alltrue(np.array(incoming).astype(typecode) == outgoing)
assert np.all(np.array(incoming).astype(typecode) == outgoing)

def test_sparse(self):
"""Test roundtrip sparse matrices"""
Expand Down
2 changes: 1 addition & 1 deletion oct2py/tests/test_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def nested_equal(self, val1, val2):
assert val1 == val2
else:
try:
assert np.alltrue(np.isnan(val1)) and np.alltrue(np.isnan(val2))
assert np.all(np.isnan(val1)) and np.all(np.isnan(val2))
except (AssertionError, NotImplementedError):
assert np.allclose([val1], [val2])

Expand Down

0 comments on commit 63fe22d

Please sign in to comment.