uproot.reading.CommonFileMethods

Defined in uproot.reading on line 192.

class uproot.reading.CommonFileMethods

Abstract class for uproot.ReadOnlyFile and uproot.reading.DetachedFile. The latter is a placeholder for file information, such as the file_path used in many error messages, without holding a reference to the active uproot.source.chunk.Source.

This allows the file to be closed and deleted while objects that were read from it still exist. Also, only objects that hold detached file references, rather than active ones, can be pickled.

The (unpickleable) objects that must hold a reference to an active uproot.ReadOnlyFile are listed by C++ (decoded) classname in uproot.must_be_attached.

file_path

CommonFileMethods.file_path

The original path to the file (converted to str if it was originally a pathlib.Path).

options

CommonFileMethods.options

The dict of options originally passed to the file constructor.

If this is a uproot.WritableFile, the options are a copy of the current state of the options; change the properties (e.g. initial_directory_bytes, uuid_function) directly on the file object to make a lasting change. Modifying the copied dict does not change the file’s future behavior.

root_version

CommonFileMethods.root_version

Version of ROOT used to write the file as a string.

See root_version_tuple and fVersion.

root_version_tuple

CommonFileMethods.root_version_tuple

Version of ROOT used to write teh file as a tuple.

See root_version and fVersion.

is_64bit

CommonFileMethods.is_64bit

True if the ROOT file is 64-bit ready; False otherwise.

A file that is larger than 4 GiB must be 64-bit ready, though any file might be. This refers to seek points like fSeekFree being 64-bit integers, rather than 32-bit.

Note that a file being 64-bit is distinct from a TDirectory being 64-bit; see is_64bit.

compression

CommonFileMethods.compression

A uproot.compression.Compression object describing the compression setting for the ROOT file.

Note that different objects (even different TBranches within a TTree) can be compressed differently, so this file-level compression is only a strong hint of how the objects are likely to be compressed.

For some versions of ROOT TStreamerInfo is always compressed with uproot.ZLIB, even if the compression is set to a different algorithm.

See fCompress.

hex_uuid

CommonFileMethods.hex_uuid

The unique identifier (UUID) of the ROOT file expressed as a hexadecimal string.

See uuid and fUUID.

uuid

CommonFileMethods.uuid

The unique identifier (UUID) of the ROOT file expressed as a Python uuid.UUID object.

See hex_uuid and fUUID.

fVersion

CommonFileMethods.fVersion

Raw version information for the ROOT file; this number is used to derive root_version, root_version_tuple, and is_64bit.

fBEGIN

CommonFileMethods.fBEGIN

The seek point (int) for the first data record, past the TFile header.

Usually 100.

fEND

CommonFileMethods.fEND

The seek point (int) to the last free word at the end of the ROOT file.

fSeekFree

CommonFileMethods.fSeekFree

The seek point (int) to the TFree data, for managing empty spaces in a ROOT file (filesystem-like fragmentation).

fNbytesFree

CommonFileMethods.fNbytesFree

The number of bytes in the TFree data, for managing empty spaces in a ROOT file (filesystem-like fragmentation).

nfree

CommonFileMethods.nfree

The number of objects in the TFree data, for managing empty spaces in a ROOT file (filesystem-like fragmentation).

fNbytesName

CommonFileMethods.fNbytesName

The number of bytes in the filename (TNamed) that is embedded in the ROOT file.

fUnits

CommonFileMethods.fUnits

Number of bytes in the serialization of file seek points, which can either be 4 or 8.

fCompress

CommonFileMethods.fCompress

The raw integer describing the compression setting for the ROOT file.

Note that different objects (even different TBranches within a TTree) can be compressed differently, so this file-level compression is only a strong hint of how the objects are likely to be compressed.

For some versions of ROOT TStreamerInfo is always compressed with uproot.ZLIB, even if the compression is set to a different algorithm.

See compression.

fSeekInfo

CommonFileMethods.fSeekInfo

The seek point (int) to the TStreamerInfo data, where streamers are located.

fNbytesInfo

CommonFileMethods.fNbytesInfo

The number of bytes in the TStreamerInfo data, where streamers are located.

fUUID

CommonFileMethods.fUUID

The unique identifier (UUID) of the ROOT file as a raw bytestring (Python bytes).

See hex_uuid and uuid.