Skip to content

Commit

Permalink
Merge pull request #103 from lsst/tickets/DM-21390
Browse files Browse the repository at this point in the history
DM-21390: Add a show option to examine a qgraph
  • Loading branch information
hsinfang committed Oct 11, 2019
2 parents 85d95c9 + 8a5464a commit e99a47f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/lsst/pipe/base/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ def quanta(self):
for quantum in taskNodes.quanta:
yield taskDef, quantum

def quantaAsQgraph(self):
"""Iterator over quanta in a graph.
QuantumGraph containing individual quanta are returned.
Yields
------
graph : `QuantumGraph`
"""
for taskDef, quantum in self.quanta():
node = QuantumGraphTaskNodes(taskDef, [quantum],
quantum.initInputs, quantum.outputs)
graph = QuantumGraph([node])
yield graph

def countQuanta(self):
"""Return total count of quanta in a graph.
Expand Down

0 comments on commit e99a47f

Please sign in to comment.