From f20fbbc798bf9637025ee00c92b8fae2d7d9c0cf Mon Sep 17 00:00:00 2001 From: Arin Wongprommoon <arin.wongprommoon@ed.ac.uk> Date: Fri, 13 Jan 2023 15:04:38 +0000 Subject: [PATCH] test(aliby): fix numpy array comparison in test_image WHY IS THIS CHANGE NEEDED?: - https://git.ecdf.ed.ac.uk/swain-lab/aliby/aliby/-/jobs/56767 failed because ValueError: The truth value of a Array is ambiguous. HOW DOES THE CHANGE SOLVE THE PROBLEM?: - use numpy.array_equal() to compare arrays instead REFERENCES: - issue #53 --- tests/aliby/pipeline/test_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/aliby/pipeline/test_image.py b/tests/aliby/pipeline/test_image.py index 18c46522..f5abe3e5 100644 --- a/tests/aliby/pipeline/test_image.py +++ b/tests/aliby/pipeline/test_image.py @@ -34,6 +34,6 @@ def test_pad_array(sample_da, dim, n_empty_slices): ] # Checks that original image array is there and is at the last index - assert padded_da.compute()[ix] == sample_da + assert np.array_equal(padded_da.compute()[ix], sample_da) # Checks that the additional axis is extended correctly assert padded_da.compute.shape[dim] == n_empty_slices + 1 -- GitLab