analyzer.core.columns

Attributes

Classes

EventBackend

str(object='') -> str

Column

Simple wrapper for a "path" in events.

ColumnCollection

TrackedColumns

Functions

coerceFields(data)

setColumn(→ awkward.Array)

Set a potentially column in an array.

getAllColumns(→ set[Column])

Extract all columns from a potentially nested layout.

mergeColumns(column_views)

addSelection(columns, name, data)

Module Contents

analyzer.core.columns.logger[source]
analyzer.core.columns.coerceFields(data)[source]
analyzer.core.columns.EVENTS[source]
class analyzer.core.columns.EventBackend[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

coffea_virtual = 'coffea_virtual'[source]
coffea_dask = 'coffea_dask'[source]
coffea_imm = 'coffea_eager'[source]
rdf = 'rdf'[source]
class analyzer.core.columns.Column[source]

Simple wrapper for a “path” in events. Stores a single tuple representing the path to the desired field. Automatically converts “dot” delimited paths.

fields: tuple[str, Ellipsis][source]
contains(other: Column | str | tuple[str, Ellipsis])[source]
extract(events: awkward.Array)[source]
__iter__()[source]
__eq__(other)[source]
__len__()[source]
__getitem__(key: int)[source]
__add__(other: Column)[source]
__radd__(other)[source]
__hash__()[source]
__str__()[source]
__repr__()[source]
property adl_name[source]
parents()[source]
analyzer.core.columns.setColumn(events: awkward.Array, column: Column, value: awkward.Array) awkward.Array[source]

Set a potentially column in an array. Automatically creates intermediate fields if needed.

class analyzer.core.columns.ColumnCollection[source]
columns: set[Column][source]
__iter__()[source]
contains(other: Column)[source]

Check if any of the columns in the set is a parent of other.

intersect(other: ColumnCollection)[source]
analyzer.core.columns.getAllColumns(events, cur_col=None, cur_depth=0, max_depth=None) set[Column][source]

Extract all columns from a potentially nested layout.

class analyzer.core.columns.TrackedColumns[source]
INTERNAL_USE_COL: ClassVar[Column][source]
backend: EventBackend[source]
metadata: Any | None = None[source]
pipeline_data: dict[str, Any][source]
property events[source]
flush()[source]

Synchronize stored lazy columns with underlying events

property fields[source]
updatedColumns(old, limit=None)[source]

Determine which in the current TrackedColumns have been updated from old by comparing their provenance.

copy()[source]
static fromEvents(events, metadata, backend, provenance: int)[source]
getKeyForColumns(columns)[source]

Get an excecution key for the column. Returns a hash dependent on the provenance of all the columns contains in the input.

getKeyForAll()[source]
__setitem__(column, value)[source]

Set a column, potentially lazy.

__getitem__(column)[source]

Get a column. May use the lazy cache.

addColumnsFrom(other, columns)[source]

Merge in columns from another TrackedColumns.

filter(mask)[source]

Filter at the event level.

useKey(provenance)[source]
allowedInputs(columns: list[Column] | ColumnCollection)[source]
allowedOutputs(columns: list[Column] | ColumnCollection)[source]
analyzer.core.columns.mergeColumns(column_views)[source]
analyzer.core.columns.addSelection(columns, name, data)[source]