TaskSubset

class lsst.pipe.base.pipeline_graph.TaskSubset(parent_xgraph: DiGraph, label: str, members: set[str], description: str, step_definitions: StepDefinitions)

Bases: MutableSet[str]

A specialized set that represents a labeled subset of the tasks in a pipeline graph.

Instances of this class should never be constructed directly; they should only be accessed via the PipelineGraph.task_subsets attribute and created by the PipelineGraph.add_task_subset method.

Parameters:
parent_xgraphnetworkx.DiGraph

Parent networkx graph that this subgraph is part of.

labelstr

Label associated with this subset of the pipeline.

membersset [ str ]

Labels of the tasks that are members of this subset.

descriptionstr, optional

Description string associated with this labeled subset.

step_definitionsStepDefinitions

Information about special ‘step’ subsets that partition the pipeline.

Notes

Iteration order is arbitrary, even when the parent pipeline graph is ordered (there is no guarantee that an ordering of the tasks in the graph implies a consistent ordering of subsets).

Attributes Summary

description

Description string associated with this labeled subset.

dimensions

The dimensions that can be used to split up this subset's quanta into independent groups.

is_step

Whether this subset is a step.

label

Label associated with this subset of the pipeline.

Methods Summary

add(value)

Add a new task to this subset.

clear()

This is slow (creates N new iterators!) but effective.

discard(value)

Remove a task from the subset if it is present.

isdisjoint(other)

Return True if two sets have a null intersection.

pop()

Return the popped value.

remove(value)

Remove an element.

Attributes Documentation

description

Description string associated with this labeled subset.

dimensions

The dimensions that can be used to split up this subset’s quanta into independent groups.

This is only available if is_step is True and only if the pipeline graph has been resolved.

is_step

Whether this subset is a step.

label

Label associated with this subset of the pipeline.

Methods Documentation

add(value: str) None

Add a new task to this subset.

Parameters:
valuestr

Label for the task. Must already be present in the parent pipeline graph.

clear()

This is slow (creates N new iterators!) but effective.

discard(value: str) None

Remove a task from the subset if it is present.

Parameters:
valuestr

Label for the task. Must already be present in the parent pipeline graph.

isdisjoint(other)

Return True if two sets have a null intersection.

pop()

Return the popped value. Raise KeyError if empty.

remove(value)

Remove an element. If not a member, raise a KeyError.