TaskSubset

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

Bases: MutableSet[str]

A specialized set that represents a labeles 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.

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.

label

Label associated with this subset of the pipeline.

Methods Summary

add(task_label)

Add a new task to this subset.

clear()

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

discard(task_label)

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.

label

Label associated with this subset of the pipeline.

Methods Documentation

add(task_label: str) None

Add a new task to this subset.

Parameters:
task_labelstr

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

clear()

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

discard(task_label: str) None

Remove a task from the subset if it is present.

Parameters:
task_labelstr

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.