Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ 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 :mod:`iris.tests.graphics.idiff` to stop duplicated file names
preventing acceptance. (:issue:`5098`, :pull:`5482`)


💣 Incompatible Changes
Expand Down
17 changes: 6 additions & 11 deletions lib/iris/tests/graphics/idiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down