Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post #4759 review actions #4833

Merged
merged 1 commit into from
Jun 28, 2022
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
8 changes: 4 additions & 4 deletions lib/iris/tests/graphics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
_lock = threading.Lock()

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

return imagehash.phash(Image.open(input), hash_size=_HASH_SIZE)
return imagehash.phash(Image.open(input), hash_size=HASH_SIZE)


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

if distance > _HAMMING_DISTANCE:
if distance > HAMMING_DISTANCE:
if dev_mode:
_create_missing(phash)
else:
Expand Down
6 changes: 3 additions & 3 deletions lib/iris/tests/graphics/recreate_imagerepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def update_json(baseline_image_dir: Path, dry_run: bool = False):
)
print(msg)
else:
for key in set(repo.keys()) | set(suggested_repo.keys()):
old_val = repo.get(key, None)
new_val = suggested_repo.get(key, None)
for key in sorted(set(repo.keys()) | set(suggested_repo.keys())):
old_val = repo.get(key)
new_val = suggested_repo.get(key)
if old_val is None:
repo[key] = suggested_repo[key]
print(key)
Expand Down