Skip to content

Commit d85de09

Browse files
committed
post SciTools#4759 review actions
1 parent 59eccc3 commit d85de09

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/iris/tests/graphics/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
_lock = threading.Lock()
5858

5959
#: Default perceptual hash size.
60-
_HASH_SIZE = 16
60+
HASH_SIZE = 16
6161
#: Default maximum perceptual hash hamming distance.
62-
_HAMMING_DISTANCE = 2
62+
HAMMING_DISTANCE = 2
6363
# Prefix for image test results (that aren't yet verified as good to add to
6464
# reference images)
6565
RESULT_PREFIX = "result-"
@@ -135,7 +135,7 @@ def get_phash(input: Path) -> str:
135135
from PIL import Image
136136
import imagehash
137137

138-
return imagehash.phash(Image.open(input), hash_size=_HASH_SIZE)
138+
return imagehash.phash(Image.open(input), hash_size=HASH_SIZE)
139139

140140

141141
def generate_repo_from_baselines(baseline_image_dir: Path) -> Dict[str, str]:
@@ -220,7 +220,7 @@ def _create_missing(phash: str) -> None:
220220
# Calculate hamming distance vector for the result hash.
221221
distance = expected - phash
222222

223-
if distance > _HAMMING_DISTANCE:
223+
if distance > HAMMING_DISTANCE:
224224
if dev_mode:
225225
_create_missing(phash)
226226
else:

lib/iris/tests/graphics/recreate_imagerepo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def update_json(baseline_image_dir: Path, dry_run: bool = False):
2929
)
3030
print(msg)
3131
else:
32-
for key in set(repo.keys()) | set(suggested_repo.keys()):
33-
old_val = repo.get(key, None)
34-
new_val = suggested_repo.get(key, None)
32+
for key in sorted(set(repo.keys()) | set(suggested_repo.keys())):
33+
old_val = repo.get(key)
34+
new_val = suggested_repo.get(key)
3535
if old_val is None:
3636
repo[key] = suggested_repo[key]
3737
print(key)

0 commit comments

Comments
 (0)