ExecutionGraphFixup¶
- class lsst.pipe.base.exec_fixup_data_id.ExecutionGraphFixup¶
Bases:
ABC
Interface for classes which update quantum graphs before execution.
Notes
The primary goal of this class is to modify quanta dependencies which may not be possible to reflect in a quantum graph using standard tools. One known use case for that is to guarantee particular execution order of visits in CI jobs for cases when outcome depends on the processing order of visits (e.g. AP association pipeline).
Instances of this class receive a preliminary graph and are allowed to add edges, as long as those edges do not result in a cycle. Edges and nodes may not be removed.
New subclasses should implement only
fixup_graph
, which will always be called first.fixupQuanta
is only called iffixup_graph
raisesNotImplementedError
.Methods Summary
fixupQuanta
(graph)Update quanta in a graph.
fixup_graph
(xgraph, quanta_by_task)Update a networkx graph of quanta in place by adding edges to further constrain the ordering.
Methods Documentation
- fixupQuanta(graph: QuantumGraph) QuantumGraph ¶
Update quanta in a graph.
- Parameters:
- graph
QuantumGraph
Quantum Graph that will be executed by the executor.
- graph
- Returns:
- graph
QuantumGraph
Modified graph.
- graph
Notes
This hook is provided for backwards compatibility only.
- fixup_graph(xgraph: DiGraph, quanta_by_task: Mapping[str, Mapping[DataCoordinate, UUID]]) None ¶
Update a networkx graph of quanta in place by adding edges to further constrain the ordering.
- Parameters:
- xgraph
networkx.DiGraph
A directed acyclic graph of quanta to modify in place. Node keys are quantum UUIDs, and attributes include
task_label
(str
) anddata_id
(a fulllsst.daf.butler.DataCoordinate
, without dimension records attached). Edges may be added, but not removed. Nodes may not be modified.- quanta_by_task
Mapping
[str
,Mapping
[lsst.daf.butler.DataCoordinate
,uuid.UUID
] ] All quanta in the graph, grouped first by task label and then by data ID.
- xgraph