towhee.functional.mixins.dag.DagMixin¶
- class towhee.functional.mixins.dag.DagMixin[source]¶
Bases:
object
Mixin for creating DAGs and their corresponding yamls from a DC.
Methods
Compile the dag.
Show dags' relations.
Notfify that a DataCollection was consumed.
Function that can be called within the function trying to be added to dag.
Attributes
control_plane
- compile_dag()[source]¶
Compile the dag.
Runs a schema of commands that removes unecessary steps and cleans the DAG.
- Returns:
The compiled DAG.
- Return type:
dict
- notify_consumed(new_id)[source]¶
Notfify that a DataCollection was consumed.
When a DataCollection is consumed by a call to another DataCollection, that Dag needs to be aware of this, so any functions that consume more than the DataCollection calling the function need to use this function, e.g. zip().
- Parameters:
new_id (str) – The ID of the DataCollection that did the consuming.
- register_dag(children)[source]¶
Function that can be called within the function trying to be added to dag.
- Parameters:
children (DataCollecton or list) – List of children DataCollection’s or singular child DataCollection.
- Returns:
The resulting child DataCollections.
- Return type:
DataCollection or list