Skip to content

Commit

Permalink
Save accurate list of available field predictions (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfhealy authored Apr 5, 2024
1 parent 4802f8c commit 7673f35
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tools/combine_preds.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,24 @@ def combine_preds(
str(x).split("/")[-1].split(".")[0]
for x in (path_to_preds / combined_preds_dirname).glob("field_*.parquet")
]
done_fields.sort()
fields_to_list = done_fields.copy()

if fields_to_exclude is not None:
fields_to_list.extend(fields_to_exclude)

fields_to_do = list(set(fields_dnn_dict).difference(done_fields))
fields_to_list.extend(fields_to_do)

fields_to_list.sort()

if save:
# Write json file containing field list
with open(path_to_preds / combined_preds_dirname / "fields.json", "w") as f:
json.dump(done_fields, f)
json.dump(fields_to_list, f)

preds_to_save = None
counter = 0
print(
f"Processing {len(set(fields_dnn_dict).difference(done_fields))} fields/files..."
)
print(f"Processing {len(fields_to_do)} fields/files...")

for field in fields_dnn_dict.keys():
if field not in done_fields:
Expand Down

0 comments on commit 7673f35

Please sign in to comment.