uproot.AsString

Defined in uproot.containers on line 390.

Inheritance order:

  1. uproot.containers.AsContainer

class uproot.containers.AsString(header, length_bytes='1-5', typename=None)
Parameters:
  • header (bool) – Sets the header.

  • length_bytes ("1-5" or "4") – Method used to determine the length of a string: “1-5” means one byte if the length is less than 256, otherwise the true length is in the next four bytes; “4” means always four bytes.

  • typename (None or str) – If None, construct a plausible C++ typename. Otherwise, take the suggestion as given.

A uproot.containers.AsContainer for strings nested withing other objects.

This is not an uproot.interpretation.Interpretation; it must be nested, at least within uproot.AsObjects.

Note that the uproot.AsStrings class is for a TBranch that contains only strings.

(simplify converts an uproot.AsObjects of uproot.AsString into a uproot.AsStrings.)

length_bytes

AsString.length_bytes

“1-5” means one byte if the length is less than 256, otherwise the true length is in the next four bytes; “4” means always four bytes.

Type:

Method used to determine the length of a string

cache_key

Inherited from uproot.containers.AsContainer.

AsString.cache_key

typename

Inherited from uproot.containers.AsContainer.

AsString.typename

awkward_form

Inherited from uproot.containers.AsContainer.

AsString.awkward_form(file, context)
Parameters:
  • file (uproot.reading.CommonFileMethods) – The file associated with this interpretation’s TBranch.

  • 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 header fields of each C++ class.

  • tobject_header (bool) – If True, include header fields of each TObject base class.

  • 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.containers.AsContainer.

AsString.strided_interpretation(file, header=False, tobject_header=True, breadcrumbs=(), original=None)
Parameters:
  • 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.

  • breadcrumbs (tuple of class objects) – Used to check for recursion. Types that contain themselves cannot be strided because the depth of instances is unknown.

  • original (None, uproot.Model, or uproot.containers.Container) – The original, non-strided model or container.

Returns a list of (str, numpy.dtype) pairs to build a uproot.AsStridedObjects interpretation.

read

Inherited from uproot.containers.AsContainer.

AsString.read(chunk, cursor, context, file, selffile, parent, header=True)
Parameters:

Read one object as part of a recursive descent.