Component
The base class for the main components of UTCA programs
This class contains basic methods for executing components and chaining them together.
Module: core
Methods and properties
Main methods and properties
__init__
Arguments:
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
__or__
Create ExecutionSchema from two components
Arguments:
component (Component): Component that will be added with this component to ExecutionSchema.
Returns:
ExecutionSchema: Result of combination of two components. When schema will be called, this component will be executed first.
__call__
Component Call
Arguments:
input_data (Transformable): Data for processing
evaluator (Optional[Evaluator], optional): Evaluator in context of which component executed. If equals to None, default evaluator will be created. Defaults to None.
Returns:
Transformable: Result of executed component.
run
Run Component. This method should be called to run program.
Arguments:
input_data (Optional[Dict[str, Any]], optional): Data for processing. If equals to None, empty dict will be used for input_data. Defaults to None.
evaluator (Optional[Evaluator], optional): Evaluator in context of which component executed. If equals to None, default evaluator will be created. Defaults to None.
Returns:
Dict[str, Any]: Result of execution.
set_name
Arguments:
name (str): New name.
Returns:
Component: self
name (str)
Name for identification. Usefull for logging and debugging.
Last updated