Defined in uproot.reading on line 2223.
- class uproot.reading.ReadOnlyKey(chunk, cursor, context, file, parent, read_strings=False)
chunk (uproot.source.chunk.Chunk) – Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) – Current position in the uproot.ReadOnlyFile.
context (dict) – Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) – The open file object.
parent (None or calling object) – The previous
readin the recursive descent.
read_strings (bool) – If True, interpret the fClassName, fName, and fTitle attributes; otherwise, ignore them.
TKeyin a ROOT file, which aren’t often accessed by users.
See the ROOT TKey documentation for a specification of
A uproot.Cursor pointing to the seek point in the file where this
TKeystarts (before its header fields).
A uproot.Cursor pointing to the seek point in the file where the data begins (the object to be read, after its copy of the
TKeyand before the object’s number of bytes/version header).
The uproot.ReadOnlyFile in which this
The object that was deserialized before this one in recursive descent, usually the containing object (or the container’s container).
The name of the object pointed to by this
TKey, with semicolon (
;) and cycle number if
The title of the object pointed to by this
- ReadOnlyKey.classname(encoded=False, version=None)
The classname of the object pointed to by this
encodedis True, the classname is a Python (encoded) classname (optionally with
encodedis False, the classname is a C++ (decoded) classname.
Object path of the object pointed to by this
If an object path is not known (e.g. the object does not reside in a
TDirectory), this returns a message with the raw seek position.
String that uniquely specifies this
TKey, to use as part of object and array cache keys.
True if the object is compressed; False otherwise.
Note: compression is determined by comparing
fNbytes - fKeylen; if they are the same, the object is uncompressed.
Creation date/time as a Python datetime.
uproot.reading.ReadOnlyKey.fDatime presents this in ROOT’s raw integer encoding.
Returns the object pointed to by this
TKey, decompressing it if necessary.
If the first attempt to deserialize the object fails with uproot.DeserializationError and any of the models used in that attempt were predefined (not from streamers), this method will try again with the file’s own streamers.
(Some ROOT files do have classes that don’t match the standard
TStreamerInfo; they may have been produced from private builds of ROOT between official releases.)
Returns an uncompressed uproot.source.chunk.Chunk and uproot.Cursor for the object pointed to by this
TKeyas a 2-tuple.
The total number of bytes in the compressed object and
Raw integer version of the
The number of bytes in the uncompressed object, not including its
Raw integer date/time when the object was written.
uproot.reading.ReadOnlyKey.created_on presents this as a Python datetime.
The number of bytes in the
TKey, not including the object.
The cycle number of the object, which disambiguates different versions of an object with the same name.
File seek position (int) pointing to a second copy of this
TKey, just before the object itself.
File seek position (int) to the
TDirectoryin which this object resides.
The C++ (decoded) classname of the object or None if the uproot.reading.ReadOnlyKey was constructed with
The name of the object or None if the uproot.reading.ReadOnlyKey was constructed with
The title of the object or None if the uproot.reading.ReadOnlyKey was constructed with
Called in the uproot.reading.ReadOnlyKey constructor before interpeting anything.
This is the first hook called in the uproot.reading.ReadOnlyKey constructor.
Called in the uproot.reading.ReadOnlyKey constructor after interpeting the header and before interpreting fClassName, fName, and fTitle.
Only called if
read_strings=Trueis passed to the constructor.
Called in the uproot.reading.ReadOnlyKey constructor after interpeting everything.
This is the last hook called in the uproot.reading.ReadOnlyKey constructor.