-
Notifications
You must be signed in to change notification settings - Fork 129
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
PlaceholderArray supports only trivial slices, not ndarray
hit with vector addition after field addition to Jets
#1231
Comments
This is also another example with the same error: events = NanoEventsFactory.from_root(
{"../coffea/tests/samples/nano_dy.root": "Events"},
delayed=True,
).events()
events_with_muon = events[ak.num(events.Muon) > 0]
a, b = ak.unzip(ak.cartesian([events_with_muon.Muon, events_with_muon.Jet], nested=False))
metric = a.delta_r(b)
events_with_muon["Muon", "dr"] = ak.min(metric, axis=1)
nearest_muon = events_with_muon.Electron.nearest(events_with_muon.Muon)
dask.compute(nearest_muon + nearest_muon)[0] In the above code, the |
I'm looking at your second reproducer and so far I can tell that the problem is that not all necessary columns are loaded - or the form is not pruned correctly - for the Placeholder: dxy
Placeholder: dxyErr
Placeholder: dz
Placeholder: dzErr
Loaded: eta
Placeholder: ip3d
Placeholder: jetPtRelv2
Placeholder: jetRelIso
Loaded: mass
Placeholder: miniPFRelIso_all
Placeholder: miniPFRelIso_chg
Placeholder: pfRelIso03_all
Placeholder: pfRelIso03_chg
Placeholder: pfRelIso04_all
Loaded: phi
Loaded: pt
Placeholder: ptErr
Placeholder: segmentComp
Placeholder: sip3d
Placeholder: softMva
Placeholder: tkRelIso
Placeholder: tunepRelPt
Placeholder: mvaLowPt
Placeholder: mvaTTH
Loaded: charge
Placeholder: jetIdx
Placeholder: nStations
Placeholder: nTrackerLayers
Placeholder: pdgId
Placeholder: tightCharge
Placeholder: fsrPhotonIdx
Placeholder: highPtId
Placeholder: inTimeMuon
Placeholder: isGlobal
Placeholder: isPFcand
Placeholder: isTracker
Placeholder: looseId
Placeholder: mediumId
Placeholder: mediumPromptId
Placeholder: miniIsoId
Placeholder: multiIsoId
Placeholder: mvaId
Placeholder: pfIsoId
Placeholder: softId
Placeholder: softMvaId
Placeholder: tightId
Placeholder: tkIsoId
Placeholder: triggerIdLoose
Placeholder: genPartIdx
Placeholder: genPartFlav
Placeholder: cleanmask
Placeholder: fsrPhotonIdxG
Placeholder: genPartIdxG
Placeholder: jetIdxG
Loaded: dr For
Obviously in the second case the reported necessary columns are not enough to fully build a MuonArray, which is why the computation fails. I'm still investigating, but my current assumption is that the typetracer after the You can see this aswell when running @ikrommyd I assume returning a "CandidateArray" is expected in this case, as this happens in the eager case aswell. If this assumption is correct then my best guess currently is that the If you were expecting a "MuonArray" as a result, then I think that something needs to be updated in coffea's behaviors, because currently a I still need to understand what the |
Yes, Muon + Muon is a In [2]: events = NanoEventsFactory.from_root({"https://github.com/scikit-hep/coffea/raw/refs/heads/master/tests/samples/nano_dy.root": "Events"}, delayed=True).events()
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for LowPtElectron_electronIdx => Electron
warnings.warn(
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for LowPtElectron_genPartIdx => GenPart
warnings.warn(
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for LowPtElectron_photonIdx => Photon
warnings.warn(
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for FatJet_genJetAK8Idx => GenJetAK8
warnings.warn(
In [3]: events.Muon + events.Muon
Out[3]: dask.awkward<add, npartitions=1>
In [4]: (events.Muon + events.Muon).compute()
Out[4]: <CandidateArray [[], [], [], [], ..., [], [], [], []] type='40 * var * Cand...'>
In [5]: events = NanoEventsFactory.from_root({"https://github.com/scikit-hep/coffea/raw/refs/heads/master/tests/samples/nano_dy.root": "Events"}, delayed=False).events()
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for LowPtElectron_electronIdx => Electron
warnings.warn(
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for LowPtElectron_genPartIdx => GenPart
warnings.warn(
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for LowPtElectron_photonIdx => Photon
warnings.warn(
/Users/iason/work/coffea_dev/coffea/src/coffea/nanoevents/schemas/nanoaod.py:264: RuntimeWarning: Missing cross-reference index for FatJet_genJetAK8Idx => GenJetAK8
warnings.warn(
In [6]: events.Muon + events.Muon
Out[6]: <CandidateArray [[], [], [], [], ..., [], [], [], []] type='40 * var * Cand...'> |
This code:
fails with
switching to
delayed=False
works fine. Also not masking events and doingevents_with_jet = events
or not attachingDelta_r_bb
to the Jets and jeeping it as a separate variable solve the problem.The text was updated successfully, but these errors were encountered: