QuantaAdjuster

class lsst.pipe.base.QuantaAdjuster(task_label: str, pipeline_graph: PipelineGraph, skeleton: QuantumGraphSkeleton)

Bases: object

A helper class for the PipelineTaskConnections.adjust_all_quanta hook.

Parameters:
task_labelstr

Label of the task whose quanta are being adjusted.

pipeline_graphpipeline_graph.PipelineGraph

Pipeline graph the quantum graph is being built from.

skeletonquantum_graph_skeleton.QuantumGraphSkeleton

Under-construction quantum graph that will be modified in place.

Attributes Summary

n_removed

The number of quanta that have been removed by this helper.

task_label

The label this task has been configured with.

task_node

The node for this task in the pipeline graph.

Methods Summary

add_input(quantum_data_id, connection_name, ...)

Add a new input to a quantum.

expand_quantum_data_id(data_id)

Expand a quantum data ID to include implied values and dimension records.

get_inputs(quantum_data_id)

Return the data IDs of all regular inputs to a quantum.

iter_data_ids()

Iterate over the data IDs of all quanta for this task."

remove_quantum(data_id)

Remove a quantum from the graph.

Attributes Documentation

n_removed

The number of quanta that have been removed by this helper.

task_label

The label this task has been configured with.

task_node

The node for this task in the pipeline graph.

Methods Documentation

add_input(quantum_data_id: DataCoordinate, connection_name: str, dataset_data_id: DataCoordinate) None

Add a new input to a quantum.

Parameters:
quantum_data_idDataCoordinate

Data ID of the quantum to add an input to.

connection_namestr

Name of the connection (the task-internal name, not the butler dataset type name).

dataset_data_idDataCoordinate

Data ID of the input dataset. Must already exist in the graph as an input to a different quantum of this task, and must be a regular input, not a prerequisite input or init-input.

Notes

If two connections have the same dataset type, the current implementation assumes the set of datasets is the same for the two connections. This limitation may be removed in the future.

expand_quantum_data_id(data_id: DataCoordinate) DataCoordinate

Expand a quantum data ID to include implied values and dimension records.

Parameters:
quantum_data_idDataCoordinate

A data ID of a quantum already in the graph.

Returns:
expanded_data_idDataCoordinate

The same data ID, with implied values included and dimension records attached.

get_inputs(quantum_data_id: DataCoordinate) dict[str, list[lsst.daf.butler.dimensions._coordinate.DataCoordinate]]

Return the data IDs of all regular inputs to a quantum.

Parameters:
data_idDataCoordinate

Data ID of the quantum to get the inputs of.

Returns:
inputsdict [ str, list [ DataCoordinate ] ]

Data IDs of inputs, keyed by the connection name (the internal task name, not the dataset type name). This only contains regular inputs, not init-inputs or prerequisite inputs.

Notes

If two connections have the same dataset type, the current implementation assumes the set of datasets is the same for the two connections. This limitation may be removed in the future.

iter_data_ids() Iterator[DataCoordinate]

Iterate over the data IDs of all quanta for this task.”

Returns:
data_idsIterator [ DataCoordinate ]

Data IDs. These are minimal data IDs without dimension records or implied values; use expand_quantum_data_id to get a full data ID when needed.

remove_quantum(data_id: DataCoordinate) None

Remove a quantum from the graph.

Parameters:
data_idDataCoordinate

Data ID of the quantum to remove. All outputs will be removed as well.