common#
This module contains common code used across the multiple modules such as the data, flow, and plot. For example, the configuration options parsing is placed in this module. The data variable shared across modules is placed in this module also (with name data_aux). The format of the data_aux is described below.
- Attributes:
- data_aux (dict): A dictionary that has the current data information.
x_axis (list[float]): The x-axis column values (shared for all rows).
signals (list[dict]): The list of signals.
triggers (list[dict]): The list of triggers.
ts (float): The sample period for the x_axis.
Each signal and trigger has the same data structure of a signal.
- Attributes:
- signal (dict): A signal informaiton
vector (list[float]): The values of the signal.
name (str): The name of the signal.
Example of data structure:
data_aux = {
'x_axis': [1, 2, 3],
'signals': [
{ 'name': 'test', 'vector': [5, 6, 1] }
],
'triggers': [],
'ts': 1
}
Another action done by the common module is to handle the piping of data information across multiple commands (as examplified in the quick start).
- hwpwn.common.error(*args)#
Outputs an error message and exits the application.
- hwpwn.common.warning(*args)#
Outputs a warning message.
- hwpwn.common.info(*args)#
Outputs an information message.
- hwpwn.common.finish(data: dict)#
This function should be called whenever a command has completed. It will store the data passed by
data
in the local data_aux variable to persist across sequential command calls in the same process.