RNtuple __len__
should return the number of keys, and have a num_entries
property for the number of entries
#1220
Labels
feature
New feature or request
Although it may be counterintuitive,
uproot.TTree
anduproot.RNTuple
should return the number of branches/top-level columns from__len__
, rather than the number of entries. This is because they satisfy the Mapping protocol:__len__
is the length of the output ofkeys
,values
, anditems
.For the number of entries,
uproot.RNTuple
should followuproot.TTree
in having a num_entries property. Users will need this information to know how to setentry_start
andentry_stop
.Maybe
uproot.RNTuple
needs an iterate method as well. For TTree, this is functionally equivalent tobut TTree does a little more and the partially read TBaskets that were trimmed to yield one array are reused if they're part of the next array (taking advantage of the fact that
iterate
is sequential: we know what's coming next). Here's where that happens:uproot5/src/uproot/behaviors/TBranch.py
Lines 1028 to 1114 in 13087b0
I don't know if the RNTuple code is organized in such a way that it would be easy to do this. (Not that I would call the TTree implementation "easy": this feature is obfuscating the code quite a bit.) I'm sympathetic to the argument that this isn't worth doing, since parallel chunked-access methods are more important than sequential ones.
The text was updated successfully, but these errors were encountered: