From d5eb7fe5269968489fe71360d17a335834075a09 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 7 Sep 2023 11:56:30 +0100 Subject: [PATCH 1/6] removed duplication case in Accept --- lib/iris/tests/graphics/idiff.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/iris/tests/graphics/idiff.py b/lib/iris/tests/graphics/idiff.py index a355f2cf82..62e72f4e0e 100755 --- a/lib/iris/tests/graphics/idiff.py +++ b/lib/iris/tests/graphics/idiff.py @@ -73,17 +73,12 @@ def diff_viewer( repo = graphics.read_repo_json() def accept(event): - if test_id not in repo: - repo[test_id] = phash - graphics.write_repo_json(repo) - out_file = result_dir / (test_id + ".png") - result_path.rename(out_file) - msg = f"ACCEPTED: {result_path.name} -> {out_file.name}" - print(msg) - else: - msg = f"DUPLICATE: {result_path.name} -> {expected_path.name} (ignored)" - print(msg) - result_path.unlink() + repo[test_id] = phash + graphics.write_repo_json(repo) + out_file = result_dir / (test_id + ".png") + result_path.rename(out_file) + msg = f"ACCEPTED: {result_path.name} -> {out_file.name}" + print(msg) diff_fname.unlink() plt.close() From abcb94b1f6f9769c6fe9d30ed505ed145b928391 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 7 Sep 2023 14:30:34 +0100 Subject: [PATCH 2/6] updated docstring --- docs/src/whatsnew/latest.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 35e2158141..38f4c5dad5 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -36,7 +36,8 @@ This document explains the changes made to Iris for this release 🐛 Bugs Fixed ============= -#. N/A +#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff.py` to stop duplicated file names + preventing acceptance. (:issue:`5098`, :pull:`5482`) 💣 Incompatible Changes From 169a752e33d0add4daa84e30a9f0fd9625fcb1ab Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 14 Sep 2023 12:10:36 +0100 Subject: [PATCH 3/6] corrected whatsnew (hopefully) --- docs/src/whatsnew/latest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 38f4c5dad5..c51ccc9f06 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -36,7 +36,7 @@ This document explains the changes made to Iris for this release 🐛 Bugs Fixed ============= -#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff.py` to stop duplicated file names +#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff` to stop duplicated file names preventing acceptance. (:issue:`5098`, :pull:`5482`) From 20fc36fd50804c807547fa5ddb58431d5b7dd25a Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 14 Sep 2023 12:19:08 +0100 Subject: [PATCH 4/6] the merge undid the fix. Here we go --- docs/src/whatsnew/latest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 97f410e9cf..5aab4743ca 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -39,7 +39,7 @@ This document explains the changes made to Iris for this release #. `@scottrobinson02`_ fixed the output units when dividing a coordinate by a cube. (:issue:`5305`, :pull:`5331`) -#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff.py` to stop duplicated file names +#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff.` to stop duplicated file names preventing acceptance. (:issue:`5098`, :pull:`5482`) From 0b6ea3eff67e31dfc675fdcdc64471ba0f9016fa Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 14 Sep 2023 12:26:57 +0100 Subject: [PATCH 5/6] removed trailng . from whatsnew --- docs/src/whatsnew/latest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 5aab4743ca..571c9cf487 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -39,7 +39,7 @@ This document explains the changes made to Iris for this release #. `@scottrobinson02`_ fixed the output units when dividing a coordinate by a cube. (:issue:`5305`, :pull:`5331`) -#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff.` to stop duplicated file names +#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff` to stop duplicated file names preventing acceptance. (:issue:`5098`, :pull:`5482`) From 290f3fdf6b271d2f1141725c58d93b34fdacb6b1 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 14 Sep 2023 13:32:02 +0100 Subject: [PATCH 6/6] changed ref to mod --- docs/src/whatsnew/latest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 571c9cf487..077adb39dc 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -39,7 +39,7 @@ This document explains the changes made to Iris for this release #. `@scottrobinson02`_ fixed the output units when dividing a coordinate by a cube. (:issue:`5305`, :pull:`5331`) -#. `@ESadek-MO`_ has updated :ref:`~iris.tests.graphics.idiff` to stop duplicated file names +#. `@ESadek-MO`_ has updated :mod:`iris.tests.graphics.idiff` to stop duplicated file names preventing acceptance. (:issue:`5098`, :pull:`5482`)