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

fix: PFnano format for dask #835

Merged
merged 6 commits into from Jun 10, 2023
Merged

fix: PFnano format for dask #835

merged 6 commits into from Jun 10, 2023

Conversation

yimuchen
Copy link
Contributor

@yimuchen yimuchen commented Jun 10, 2023

  • Fixing missing parenthesis for nested jet object access
  • Adding test file for automatic format tests
  • Fix issue where opening the same file multiple files can cause the access to nested structures to fail.

@yimuchen yimuchen changed the title fix [WIP]: PFnano format for dask fix: PFnano format for dask Jun 10, 2023
@yimuchen
Copy link
Contributor Author

This fixes the issue with first time opening, but has a strange side effect if you first open the file with dask and without dask:

from coffea.nanoevents import NanoEventsFactory
from coffea.nanoevents.schemas import PFNanoAODSchema


def open_events(permit_dask=False):
    factory = NanoEventsFactory.from_root(
        "file:./pfnano.root",
        schemaclass=PFNanoAODSchema,
        permit_dask=permit_dask,
    )
    return factory.events()

The following works fine

events = open_events(permit_dask=False)
print(events.Jet.constituents.pf.pt)
events = open_events(permit_dask=False)
print(events.Jet.constituents.pf.pt)

The following is also fine:

events = open_events(permit_dask=False)
print(events.Jet.constituents.pf.pt)
events = open_events(permit_dask=False)
print(events.Jet.constituents.pf.pt)

But the following fails:

events = open_events(permit_dask=True)
print(events.Jet.constituents.pf.pt)
events = open_events(permit_dask=False)
print(events.Jet.constituents.pf.pt)

@yimuchen yimuchen changed the title fix: PFnano format for dask fix: PFnano format for dask [WIP] Jun 10, 2023
@yimuchen yimuchen mentioned this pull request Jun 10, 2023
11 tasks
@lgray
Copy link
Collaborator

lgray commented Jun 10, 2023

figured this one out - thanks for isolating this problem, it was really starting to bug me!

@lgray lgray changed the title fix: PFnano format for dask [WIP] fix: PFnano format for dask Jun 10, 2023
@lgray lgray merged commit 94c34ae into CoffeaTeam:master Jun 10, 2023
8 of 12 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.

None yet

2 participants