From 11a1fa62bc862177f37e9fafc205d110daa96361 Mon Sep 17 00:00:00 2001 From: Brian Kohan Date: Sat, 18 May 2024 10:15:01 -0400 Subject: [PATCH] try fix image comparison tests --- tests/tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tests.py b/tests/tests.py index f23bff8..4e29203 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -66,6 +66,8 @@ def img_similarity(expected, to_compare): """ img_a, img_b = resize_image_to_match(expected, to_compare) io.imsave(str(expected.parent / f'resized_{expected.name}'), img_a) + # reshape img_a to match img_b - fix spurious failures on github actions + img_b = img_a.reshape(img_b.shape[0], img_b.shape[1], img_b.shape[2]) err = np.sum((img_a.astype("float") - img_b.astype("float")) ** 2) err /= float(img_a.shape[0] * img_a.shape[1]) return err