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

Be less strict and more granular when defining inconsistent version #1920

Merged
merged 1 commit into from
Jan 25, 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
13 changes: 10 additions & 3 deletions validphys2/src/validphys/fitdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,21 @@ def print_systype_overlap(groups_commondata, group_dataset_inputs_by_metadata):

@table
def fit_code_version(fit):
"""Returns table with the code version from ``replica_1/{fitname}.json`` files."""
"""Returns table with the code version from ``replica_1/{fitname}.json`` files.
Note that the version for thensorflow distinguishes between the mkl=on and off version
"""
vinfo = {}
for json_path in fit.path.glob(f"nnfit/replica_*/{fit.name}.json"):
tmp = json.loads(json_path.read_text(encoding="utf-8")).get("version")
if (vinfo and vinfo != tmp) or tmp is None:
# if there's at least a replica without information, then they are all inconsistent
if tmp is None:
vinfo = {i: "inconsistent" for i in tmp}
break
vinfo = tmp
elif not vinfo:
vinfo = tmp
for k, v in tmp.items():
# If any value has changed for any replica, set it as inconsistent
vinfo[k] = v if v == vinfo[k] else "inconsistent"

return pd.DataFrame(vinfo.items(), columns=["module", fit.name]).set_index("module")

Expand Down
Loading