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

hotfix: fix dump_dataset in dump_processed.py #116

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

felixzinn
Copy link
Contributor

Hi

i think the dump_dataset function did not compare the processed dataset filenames of the coffea output correctly with the dataset json file.
Please verify that the changes work correctly. For me they work now. Previously all files from the json file were listed as failed although they were contained in the coffea output file.

previously the code looked like this

original_list, list_from_coffea = {}, {}
    for j in jsonlist:
        old = json.load(open(j))
        for o in old.keys():
            if o not in original_list.keys():
                original_list[o] = []
            original_list[o].extend(old[o])

for m in output.keys():
        for f in output[m].keys():
            if f not in list_from_coffea.keys():
                list_from_coffea[f] = []
            else:
                list_from_coffea[f] += list(set(output[m][f]["fname"]))

since list_from_coffea is instantiated as an empty dictionary, there will be no keys and hence list_from_coffea will be filled with empty lists instead of the list from the coffea output

@Ming-Yan Ming-Yan changed the title fix dump_dataset in dump_processed.py hotfix: fix dump_dataset in dump_processed.py Feb 11, 2025
Copy link
Collaborator

@Ming-Yan Ming-Yan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @felixzinn thank you for fixing this, this PR looks good to me, merge it

@Ming-Yan Ming-Yan merged commit c5210af into cms-btv-pog:master Feb 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants