b_asic.graph_component¶

B-ASIC Graph Component Module.
Contains the base for all components with an ID in a signal flow graph.
- class b_asic.graph_component.AbstractGraphComponent(name: str = '')¶
Bases:
GraphComponentGeneric abstract graph component base class.
Concrete graph components should normally derive from this to get the default behavior.
- copy(*args, **kwargs) GraphComponent¶
Get a new instance of this graph component type.
The new instance will have the same name, id, and parameters.
- property graph_id: GraphID¶
Get the graph id of this graph component.
- set_param(name: str, value: Any) None¶
Set the value of a parameter.
Adds the parameter if it is not already defined.
- traverse() Generator[GraphComponent, None, None]¶
Get a generator for traversing the all connected components.
The generator recursively iterates through all components that are connected to this operation, as well as the ones that they are connected to.
- class b_asic.graph_component.GraphComponent¶
Bases:
ABCGraph component interface.
Each graph component has a type name, a name and a unique ID. Graph components also contain parameters and provide an interface for copying that automatically copies each parameter in its default implementation.
Graph components also provide an interface for traversing connected graph components and accessing their direct neighbors.
- abstractmethod copy(*args, **kwargs) GraphComponent¶
Get a new instance of this graph component type.
The new instance will have the same name, id, and parameters.
- abstract property graph_id: GraphID¶
Get the graph id of this graph component.
- abstract property neighbors: Iterable[GraphComponent]¶
Get all components that are directly connected to this operation.
- abstractmethod param(name: str) Any¶
Get the value of a parameter.
Returns None if the parameter is not defined.
- abstractmethod set_param(name: str, value: Any) None¶
Set the value of a parameter.
Adds the parameter if it is not already defined.
- abstractmethod traverse() Generator[GraphComponent, None, None]¶
Get a generator for traversing the all connected components.
The generator recursively iterates through all components that are connected to this operation, as well as the ones that they are connected to.
- abstractmethod classmethod type_name() TypeName¶
Get the type name of this graph component.