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

Make metadata error message more informative #229

Merged
merged 2 commits into from
Oct 13, 2024
Merged
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: 6 additions & 2 deletions alea/submitters/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,13 @@ def _read_metadata(self, output_filename_pattern):
metadata_list = get_metadata(output_filename_pattern)
for m in metadata_list:
m.pop("date", None)
if len(set([deterministic_hash(m) for m in metadata_list])) != 1:
n_metadata = len(set([deterministic_hash(m) for m in metadata_list]))
if n_metadata != 1:
raise ValueError(
f"The metadata are not the same for all the {len(output_filename_list)} output!"
"The metadata for output_filename_pattern "
f"{output_filename_pattern} are not the same for all the "
f"{len(output_filename_list)} outputs "
f"({n_metadata} unique sets of metadata)!"
)
metadata = metadata_list[0]
if metadata["poi"] != self.poi:
Expand Down
Loading