Belle II Software development
|
Public Member Functions | |
def | __init__ (self, str listname, List[str] variables, str filename, str format) |
def | initialize (self) |
def | initialize_parquet_writer (self) |
def | initialize_csv_writer (self) |
def | initialize_hdf5_writer (self) |
def | fill_buffer (self) |
def | event (self) |
def | terminate (self) |
Protected Attributes | |
_filename | |
Output filename. | |
_listname | |
Particle list name. | |
_variables | |
List of variables. | |
_format | |
Output format. | |
_varnames | |
variable names | |
_var_objects | |
variable objects for each variable | |
_evtmeta | |
Event metadata. | |
_plist | |
Pointer to the particle list. | |
_dtypes | |
The data type. | |
_schema | |
A list of tuples and py.DataTypes to define the pyarrow schema. | |
_parquet_writer | |
a writer object to write data into a parquet file | |
_csv_writer | |
a writer object to write data into a csv file | |
_hdf5_writer | |
The pytable file. | |
_table | |
The pytable. | |
Base class to dump ntuples into a non root format of your choosing
Definition at line 37 of file b2pandas_utils.py.
def __init__ | ( | self, | |
str | listname, | ||
List[str] | variables, | ||
str | filename, | ||
str | format | ||
) |
Constructor to initialize the internal state Arguments: listname(str): name of the particle list variables(list(str)): list of variables to save for each particle filename(str): name of the output file to be created format(str): format of the output file, one of 'hdf5', 'parquet', 'csv'
Reimplemented in VariablesToHDF5.
Definition at line 42 of file b2pandas_utils.py.
def event | ( | self | ) |
Event processing function executes the fill_buffer function and writes the data to the output file
Definition at line 157 of file b2pandas_utils.py.
def fill_buffer | ( | self | ) |
collect all variables for the particle in a numpy array
Definition at line 134 of file b2pandas_utils.py.
def initialize | ( | self | ) |
Create the hdf5 file and list of variable objects to be used during event processing.
Definition at line 61 of file b2pandas_utils.py.
def initialize_csv_writer | ( | self | ) |
Initialize the csv writer using pyarrow
Definition at line 110 of file b2pandas_utils.py.
def initialize_hdf5_writer | ( | self | ) |
Initialize the hdf5 writer using pytables
Definition at line 119 of file b2pandas_utils.py.
def initialize_parquet_writer | ( | self | ) |
Initialize the parquet writer using pyarrow
Definition at line 101 of file b2pandas_utils.py.
def terminate | ( | self | ) |
save and close the output
Definition at line 176 of file b2pandas_utils.py.
|
protected |
a writer object to write data into a csv file
Definition at line 117 of file b2pandas_utils.py.
|
protected |
The data type.
Definition at line 90 of file b2pandas_utils.py.
|
protected |
Event metadata.
Definition at line 75 of file b2pandas_utils.py.
|
protected |
Output filename.
Definition at line 53 of file b2pandas_utils.py.
|
protected |
Output format.
Definition at line 59 of file b2pandas_utils.py.
|
protected |
The pytable file.
Definition at line 124 of file b2pandas_utils.py.
|
protected |
Particle list name.
Definition at line 55 of file b2pandas_utils.py.
|
protected |
a writer object to write data into a parquet file
Definition at line 108 of file b2pandas_utils.py.
|
protected |
Pointer to the particle list.
Definition at line 78 of file b2pandas_utils.py.
|
protected |
A list of tuples and py.DataTypes to define the pyarrow schema.
Definition at line 106 of file b2pandas_utils.py.
|
protected |
The pytable.
Definition at line 132 of file b2pandas_utils.py.
|
protected |
variable objects for each variable
Definition at line 72 of file b2pandas_utils.py.
|
protected |
List of variables.
Definition at line 57 of file b2pandas_utils.py.
|
protected |
variable names
Definition at line 67 of file b2pandas_utils.py.