Skip to content

Commit 064e6ee

Browse files
authored
idiff acceptance fix (SciTools#5482)
* removed duplication case in Accept * updated docstring * corrected whatsnew (hopefully) * the merge undid the fix. Here we go * removed trailng . from whatsnew * changed ref to mod
1 parent c53481e commit 064e6ee

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

docs/src/whatsnew/latest.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ This document explains the changes made to Iris for this release
3838

3939
#. `@scottrobinson02`_ fixed the output units when dividing a coordinate by a
4040
cube. (:issue:`5305`, :pull:`5331`)
41+
42+
#. `@ESadek-MO`_ has updated :mod:`iris.tests.graphics.idiff` to stop duplicated file names
43+
preventing acceptance. (:issue:`5098`, :pull:`5482`)
4144

4245

4346
💣 Incompatible Changes

lib/iris/tests/graphics/idiff.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,12 @@ def diff_viewer(
7373
repo = graphics.read_repo_json()
7474

7575
def accept(event):
76-
if test_id not in repo:
77-
repo[test_id] = phash
78-
graphics.write_repo_json(repo)
79-
out_file = result_dir / (test_id + ".png")
80-
result_path.rename(out_file)
81-
msg = f"ACCEPTED: {result_path.name} -> {out_file.name}"
82-
print(msg)
83-
else:
84-
msg = f"DUPLICATE: {result_path.name} -> {expected_path.name} (ignored)"
85-
print(msg)
86-
result_path.unlink()
76+
repo[test_id] = phash
77+
graphics.write_repo_json(repo)
78+
out_file = result_dir / (test_id + ".png")
79+
result_path.rename(out_file)
80+
msg = f"ACCEPTED: {result_path.name} -> {out_file.name}"
81+
print(msg)
8782
diff_fname.unlink()
8883
plt.close()
8984

0 commit comments

Comments
 (0)