From 10cc09f383d38539fc26ebcb2564f9930ebff020 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 19 Jun 2023 08:21:05 -0500 Subject: [PATCH 1/2] fix warnings and test on python 3.12 --- .github/workflows/tests.yml | 2 +- oct2py/tests/test_numpy.py | 4 ++-- oct2py/tests/test_roundtrip.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 64f46abb..c978f627 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] fail-fast: false steps: diff --git a/oct2py/tests/test_numpy.py b/oct2py/tests/test_numpy.py index 330ebd2c..1df37b9c 100644 --- a/oct2py/tests/test_numpy.py +++ b/oct2py/tests/test_numpy.py @@ -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""" @@ -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""" diff --git a/oct2py/tests/test_roundtrip.py b/oct2py/tests/test_roundtrip.py index ed7fbf1f..f14f5e52 100644 --- a/oct2py/tests/test_roundtrip.py +++ b/oct2py/tests/test_roundtrip.py @@ -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]) From 6af2bd3cc49e89bbc324f9ebd49bd0c8be57df66 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 19 Jun 2023 08:21:21 -0500 Subject: [PATCH 2/2] remove python 3.12 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c978f627..64f46abb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11"] fail-fast: false steps: