QuantumGraph

class lsst.pipe.base.QuantumGraph(iterable=None)

Bases: list

QuantumGraph is a sequence of QuantumGraphTaskNodes objects.

Typically the order of the tasks in the list will be the same as the order of tasks in a pipeline (obviously depends on the code which constructs graph).

Parameters
iterableiterable of QuantumGraphTaskNodes, optional

Initial sequence of per-task nodes.

Methods Summary

append($self, object, /)

Append object to the end of the list.

clear($self, /)

Remove all items from list.

copy($self, /)

Return a shallow copy of the list.

count($self, value, /)

Return number of occurrences of value.

countQuanta()

Return total count of quanta in a graph.

extend($self, iterable, /)

Extend list by appending elements from the iterable.

index($self, value[, start, stop])

Return first index of value.

insert($self, index, object, /)

Insert object before index.

pop($self[, index])

Remove and return item at index (default last).

quanta()

Iterator over quanta in a graph.

quantaAsQgraph()

Iterator over quanta in a graph.

remove($self, value, /)

Remove first occurrence of value.

reverse($self, /)

Reverse IN PLACE.

sort($self, /, *[, key, reverse])

Stable sort IN PLACE.

traverse()

Return topologically ordered Quanta and their dependencies.

Methods Documentation

append($self, object, /)

Append object to the end of the list.

clear($self, /)

Remove all items from list.

copy($self, /)

Return a shallow copy of the list.

count($self, value, /)

Return number of occurrences of value.

countQuanta()

Return total count of quanta in a graph.

Returns
countint

Number of quanta in a graph.

extend($self, iterable, /)

Extend list by appending elements from the iterable.

index($self, value, start=0, stop=sys.maxsize, /)

Return first index of value.

Raises ValueError if the value is not present.

insert($self, index, object, /)

Insert object before index.

pop($self, index=-1, /)

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

quanta()

Iterator over quanta in a graph.

Quanta are returned in unspecified order.

Yields
taskDefTaskDef

Task definition for a Quantum.

quantumQuantum

Single quantum.

quantaAsQgraph()

Iterator over quanta in a graph.

QuantumGraph containing individual quanta are returned.

Yields
graphQuantumGraph
remove($self, value, /)

Remove first occurrence of value.

Raises ValueError if the value is not present.

reverse($self, /)

Reverse IN PLACE.

sort($self, /, *, key=None, reverse=False)

Stable sort IN PLACE.

traverse()

Return topologically ordered Quanta and their dependencies.

This method iterates over all Quanta in topological order, enumerating them during iteration. Returned QuantumIterData object contains Quantum instance, its index and the index of all its prerequsites (Quanta that produce inputs for this Quantum): - the index values are generated by an iteration of a

QuantumGraph, and are not intrinsic to the QuantumGraph

  • during iteration, each ID will appear in index before it ever appears in dependencies.

Yields
quantumDataQuantumIterData