uproot.reading.DetachedFile — Uproot documentation

# uproot.reading.DetachedFile

Defined in uproot.reading on line 446.

Inheritance order:
uproot.reading.CommonFileMethods

class uproot.reading.DetachedFile(file)
  Parameters:

    file (uproot.ReadOnlyFile) – The active file object to convert into a detached file.

  A placeholder for a uproot.ReadOnlyFile with useful 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

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.file_path

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

## options

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.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

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.root_version

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

  See root_version_tuple and fVersion.

## root_version_tuple

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.root_version_tuple

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

  See root_version and fVersion.

## is_64bit

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.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

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.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

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.hex_uuid

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

  See uuid and fUUID.

## uuid

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.uuid

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

  See hex_uuid and fUUID.

## fVersion

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fVersion

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

## fBEGIN

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fBEGIN

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

  Usually 100.

## fEND

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fEND

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

## fSeekFree

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fSeekFree

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

## fNbytesFree

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fNbytesFree

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

## nfree

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.nfree

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

## fNbytesName

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fNbytesName

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

## fUnits

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fUnits

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

## fCompress

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.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

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fSeekInfo

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

## fNbytesInfo

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fNbytesInfo

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

## fUUID

Inherited from uproot.reading.CommonFileMethods.

DetachedFile.fUUID

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

  See hex_uuid and uuid.