Skip to content

Commit

Permalink
fix: dump processed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ming-Yan committed Apr 11, 2024
1 parent 67e478c commit b7034c5
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 27,590 deletions.
27,584 changes: 0 additions & 27,584 deletions prescales.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion ps_weight_JSON_PFJet140.json

This file was deleted.

16 changes: 11 additions & 5 deletions scripts/dump_processed.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,23 @@ def dump_lumi(output, fname):
def dump_dataset(output, fname, alljson):
jsonlist = glob.glob(alljson) if "*" in alljson else alljson.split(",")
print("Original jsons:", jsonlist)
oldf, newf = {}, {}
original_list, list_from_coffea = {}, {}
for j in jsonlist:
old = json.load(open(j))
original_list[j] = []
for o in old.keys():
oldf[o] = old[o]
original_list[o].append(old[o])

for m in output.keys():
list_from_coffea[m] = []
for f in output[m].keys():
newf[f] = list(output[m][f]["fname"])
list_from_coffea[f].append(list(set(output[m][f]["fname"])))
failed = {}
for t in oldf.keys():
failed[t] = list(set(oldf[t]) - set(newf[t]))
for t in original_list.keys():
failed[t] = []
for f in original_list[t]:
if not f in list_from_coffea[t]:
failed[t].append(f)

with open(f"{fname}_failed_dataset.json", "w") as outfile:
json.dump(failed, outfile, indent=4)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b7034c5

Please sign in to comment.