fix: keep the object cache in the graphed TTree source - #1731
Merged
ariostas merged 1 commit intoSep 25, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
|
Contributor
Author
|
@ariostas Here's another quick fix from doing higher level tests with the nanoevents integration built in scikit-hep/coffea#1637. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Fixes #1730
_GraphedTTreeSource._open_directoryno longer passesobject_cache=None, soReadOnlyFile's default (object_cache=100, as inuproot.open) applies. The file is already opened once per worker throughresources.open_once; with its object cache, later partitions of that file reuse theTTreeinstead of deserializing it again.array_cache=Nonestays, so no arrays are held across partitions.No caller setting is overridden: an explicit
object_cache=passed touproot.graphedis already rejected at construction by_util.regularize_object_path, whichuproot.daskshares.Timing
Eventstree ofRun2012B_SingleMu.root(CMS Open Data NanoAOD, 16 GB, 86 branches), first 2^21 entries as 4 explicit steps of 2^19;gak.sum(MET_pt)throughgraphed.aggregate_plan+SequentialRunner, median of 5 runs after one warm-up; Apple M1 Max, Python 3.13, graphed 0.0.5.main(ca3a8a2)TTreereads for 4 partitionsopen_treeper partition (ms)MET_pt, 4 partitions (s)Test
tests/test_1730_graphed_tree_cache.py: two partitions of one file, opened through oneLocalResources, get the sameTTreeobject. It fails onmain(assert second is first: two distinctTTreeobjects) and passes here.