Skip to content

Commit

Permalink
Fix: Git record difference check
Browse files Browse the repository at this point in the history
  • Loading branch information
HCookie committed Sep 12, 2024
1 parent 340842c commit d34f946
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/anemoi/inference/checkpoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def validate_environment(
)

for git_record in train_environment["git_versions"].keys():
file_record = train_environment["git_versions"][git_record]["git"]
if file_record["modified_files"] == 0 and file_record["untracked_files"] == 0:
continue

if git_record not in inference_environment["git_versions"]:
invalid_messages["uncommitted"].append(
f"Training environment contained uncommitted change missing in inference environment: {git_record}"
Expand All @@ -131,6 +135,10 @@ def validate_environment(
)

for git_record in inference_environment["git_versions"].keys():
file_record = inference_environment["git_versions"][git_record]["git"]
if file_record["modified_files"] == 0 and file_record["untracked_files"] == 0:
continue

if git_record not in train_environment["git_versions"]:
invalid_messages["uncommitted"].append(
f"Inference environment contains uncommited changes missing in training: {git_record}"
Expand Down

0 comments on commit d34f946

Please sign in to comment.