uproot.streamers.Model_TStreamerObjectAnyPointerο
Defined in uproot.streamers on line 1429.
Inheritance order: |
---|
- class uproot.streamers.Model_TStreamerObjectAnyPointerο
A versionless uproot.Model for
TStreamerObjectAnyPointer
.Since this model is versionless and most of its functionality is internal (not to be directly accessed by most users), it is defined on the model instead of creating a behavior class to mix in functionality.
class_codeο
Inherited from uproot.streamers.TStreamerPointerTypes.
- Model_TStreamerObjectAnyPointer.class_code(streamerinfo, i, elements, read_members, read_member_n, strided_interpretation, awkward_form, fields, formats, dtypes, formats_memberwise, containers, base_names_versions, member_names, class_flags)ο
showο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.show(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)ο
- Parameters:
stream (object with a
write(str)
method) β Stream to write the output to.
Interactively display a
TStreamerElement
.
nameο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.nameο
The name (
fName
) of thisTStreamerElement
.
titleο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.titleο
The title (
fTitle
) of thisTStreamerElement
.
typenameο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.typenameο
The typename (
fTypeName
) of thisTStreamerElement
.
array_lengthο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.array_lengthο
The array length (
fArrayLength
) of thisTStreamerElement
.
file_uuidο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.file_uuidο
The unique identifier (uproot.ReadOnlyFile) of the file from which this
TStreamerElement
was extracted.
fTypeο
Inherited from uproot.streamers.Model_TStreamerElement.
- Model_TStreamerObjectAnyPointer.fTypeο
The type code (
fType
) of thisTStreamerElement
.
classnameο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.classnameο
The C++ (decoded) classname of the modeled class.
See uproot.classname_decode, uproot.classname_encode, and uproot.model.classname_version.
encoded_classnameο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.encoded_classnameο
The Python (encoded) classname of the modeled class. May or may not include version.
See uproot.classname_decode, uproot.classname_encode, and uproot.model.classname_version.
class_versionο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.class_versionο
The version number of the modeled class (int) if any; None otherwise.
See uproot.classname_decode, uproot.classname_encode, and uproot.model.classname_version.
cursorο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.cursorο
A cursor pointing to the start of this instance in the byte stream (before read_numbytes_version).
fileο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.fileο
A uproot.ReadOnlyFile, which may be open and readable, or a uproot.reading.DetachedFile, which only contains information about the original file (not an open file handle).
closeο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.close()ο
Closes the file from which this object is derived, if such a file is still attached (i.e. not uproot.reading.DetachedFile).
closedο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.closedο
True if the associated file is known to be closed; False if it is known to be open. If the associated file is detached (uproot.reading.DetachedFile), then the value is None.
parentο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.parentο
The object that was deserialized before this one in recursive descent, usually the containing object (or the containerβs container).
concreteο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.concreteο
The Python instance corresponding to the concrete (instantiated) class in C++, which is
self
if this is the concrete class or another object if this is actually a holder of superclass members for that other object (i.e. if this object is in the otherβs bases).
membersο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.membersο
A dict of C++ member data directly associated with this class (i.e. not its superclasses). For all members, see all_members.
all_membersο
Inherited from uproot.Model.
has_memberο
Inherited from uproot.Model.
memberο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.member(name, all=True, none_if_missing=False)ο
- Parameters:
name (str) β The name of the member datum to retrieve.
all (bool) β If True, recursively search all superclasses in bases. Otherwise, search the direct class only.
none_if_missing (bool) β If a member datum doesnβt exist in the search path,
none_if_missing=True
has this function return None, butnone_if_missing=False
would have it raise an exception. Note that None is a possible value for some member data.
Returns a C++ member datum by name.
basesο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.basesο
List of uproot.Model objects representing superclass data for this object in the order given in C++ (opposite method resolution order).
If this object has no superclasses,
bases
is empty.If it has one superclass, which itself might have superclasses,
bases
has length 1.Only if this object multiply inherits from more than one superclass at the same level does
bases
have length greater than 1.
Since multiple inheritance is usually avoided,
bases
rarely has length greater than 1. A linear chain of superclasses deriving from super-superclasses is represented bybases
containing an object whosebases
contains objects.
baseο
Inherited from uproot.Model.
is_instanceο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.is_instance(*cls)ο
Returns True if this object matches a given type in the C++ class hierarchy.
The
cls
arguments may be Python classes or C++ classname strings to match.
num_bytesο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.num_bytesο
Number of bytes expected in the (uncompressed) serialization of this instance.
This value may be None (unknown before reading) or an integer.
If the value is an integer and the object exists (no exceptions in read), then the expected number of bytes agreed with the actual number of bytes, and this numer is reliable.
If this object is re-serialized, it wonβt necessarily occupy the same number of bytes.
instance_versionο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.instance_versionο
Version of this instance as read from the byte stream.
If this model is versioned (uproot.model.VersionedModel), the
instance_version
ought to be equal to the class_version.If this model is versionless, the
instance_version
contains new information about the actual version deserialized.
is_memberwiseο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.is_memberwiseο
True if the object was serialized in ROOTβs memberwise format; False otherwise.
awkward_formο
Inherited from uproot.Model.
- classmethod Model_TStreamerObjectAnyPointer.awkward_form(file, context)ο
- Parameters:
cls (subclass of uproot.Model) β This class.
file (uproot.ReadOnlyFile) β File to use to generate uproot.Model classes from its streamers and
file_path
for error messages.context (dict) β Context for the Form-generation; defaults are the remaining arguments below.
index_format (str) β Format to use for indexes of the
awkward.forms.Form
; may be"i32"
,"u32"
, or"i64"
.header (bool) β If True, include headers in the Formβs
"uproot"
parameters.tobject_header (bool) β If True, include headers for
TObject
classes in the Formβs"uproot"
parameters.breadcrumbs (tuple of class objects) β Used to check for recursion. Types that contain themselves cannot be Awkward Arrays because the depth of instances is unknown.
The
awkward.forms.Form
to use to put objects of type type in an Awkward Array.
strided_interpretationο
Inherited from uproot.Model.
- classmethod Model_TStreamerObjectAnyPointer.strided_interpretation(file, header=False, tobject_header=True, breadcrumbs=(), original=None)ο
- Parameters:
cls (subclass of uproot.Model) β This class.
file (uproot.ReadOnlyFile) β File to use to generate uproot.Model classes from its streamers and
file_path
for error messages.header (bool) β If True, assume the outermost object has a header.
tobject_header (bool) β If True, assume that
TObjects
have headers.original (None, uproot.Model, or uproot.containers.Container) β The original, non-strided model or container.
breadcrumbs (tuple of class objects) β Used to check for recursion. Types that contain themselves cannot be strided because the depth of instances is unknown.
Returns a list of (str,
numpy.dtype
) pairs to build a uproot.AsStridedObjects interpretation.
tojsonο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.tojson()ο
Serializes this object in its ROOT JSON form (as Python lists and dicts, which can be passed to
json.dump
orjson.dumps
).
emptyο
Inherited from uproot.Model.
- classmethod Model_TStreamerObjectAnyPointer.empty()ο
Creates a model instance (of subclass
cls
) with no data; all required attributes are None or empty.
readο
Inherited from uproot.Model.
- classmethod Model_TStreamerObjectAnyPointer.read(chunk, cursor, context, file, selffile, parent, concrete=None)ο
- Parameters:
cls (subclass of uproot.Model) β Class to instantiate.
chunk (uproot.source.chunk.Chunk) β Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) β Current position in that
chunk
.context (dict) β Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) β An open file object, capable of generating new uproot.Model classes from its streamers.
selffile (uproot.reading.CommonFileMethods) β A possibly uproot.reading.DetachedFile associated with this object.
parent (None or calling object) β The previous
read
in the recursive descent.concrete (None or uproot.Model instance) β If None, this model corresponds to the concrete (instantiated) class in C++. Otherwise, this model represents a superclass part of the object, and
concrete
points to the concrete instance.
Creates a model instance by reading data from a file.
read_numbytes_versionο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.read_numbytes_version(chunk, cursor, context)ο
- Parameters:
chunk (uproot.source.chunk.Chunk) β Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) β Current position in that
chunk
.context (dict) β Auxiliary data used in deserialization.
Reads the number of bytes and instance version from the byte stream, which is usually 6 bytes (4 + 2). Bits with special meanings are appropriately masked out.
Some types donβt have a 6-byte header or handle it differently; in those cases, this method should be overridden.
read_membersο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.read_members(chunk, cursor, context, file)ο
- Parameters:
chunk (uproot.source.chunk.Chunk) β Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) β Current position in that
chunk
.context (dict) β Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) β An open file object, capable of generating new uproot.Model classes from its streamers.
Reads the member data for this class. The abstract class uproot.Model has an empty
read_members
method; this must be overridden by subclasses.
check_numbytesο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.check_numbytes(chunk, cursor, context)ο
- Parameters:
chunk (uproot.source.chunk.Chunk) β Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) β Current position in that
chunk
.context (dict) β Auxiliary data used in deserialization.
Reads nothing; checks the expected number of bytes against the actual movement of the
cursor
at the end of the object, possibly raising a uproot.DeserializationError exception.If num_bytes is None, this method does nothing.
It is possible that a subclass would override this method, but not likely.
postprocessο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.postprocess(chunk, cursor, context, file)ο
- Parameters:
chunk (uproot.source.chunk.Chunk) β Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) β Current position in that
chunk
.context (dict) β Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) β An open file object, capable of generating new uproot.Model classes from its streamers.
Called for any additional processing after the object has been fully read.
The return value from this method is the object that actually represents the ROOT data, which might be a different instance or even a different type from this class. The default in uproot.Model is to return
self
.Note that for versioned models, postprocess is called first, then postprocess is called on its output, allowing a uproot.model.DispatchByVersion to refine all data of its type, regardless of version.
hook_before_readο
Inherited from uproot.Model.
hook_before_read_membersο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.hook_before_read_members(**kwargs)ο
Called in read, after read_numbytes_version and before read_members.
hook_after_read_membersο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.hook_after_read_members(**kwargs)ο
Called in read, after read_members and before check_numbytes.
hook_before_postprocessο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.hook_before_postprocess(**kwargs)ο
Called in read, after check_numbytes and before postprocess.
to_writableο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.to_writable()ο
- Parameters:
obj (uproot.Model instance of the same C++ class) β The object to convert to this class version.
Returns a writable version of this object or raises a NotImplementedError if no writable version exists.
serializeο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.serialize(name=None)ο
Serialize a object (from num_bytes and version onward) for writing into an output ROOT file.
If a
name
is given, override the objectβs current name.This method has not been implemented on all classes (raises NotImplementedError).
to_pyrootο
Inherited from uproot.Model.
- Model_TStreamerObjectAnyPointer.to_pyroot(name=None)ο
- Parameters:
name (str or None) β A name for the new PyROOT object.
Converts this uproot.Model into a PyROOT object if it is writable. A minority of Uproot models are writable, mostly just histograms. Writability is necessary for conversion to PyROOT because it is serialized through a ROOT TMessage.