Skip to content

Commit

Permalink
Merge pull request #81 from lsst/tickets/DM-17398
Browse files Browse the repository at this point in the history
DM-17398: Allow graph traversal for "split graphs"
  • Loading branch information
andy-slac committed Jan 23, 2019
2 parents 0a7b887 + cc44b0d commit 79c42fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion python/lsst/pipe/base/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,17 @@ def orderedTaskNodes(graph):
# if data exists in butler then `id` is not None
if dataRef.id is None:
key = (dataRef.datasetType.name, DataId(dataRef.dataId))
prereq.append(outputs[key])
try:
prereq.append(outputs[key])
except KeyError:
# The Quantum that makes our inputs is not in the graph,
# this could happen if we run on a "split graph" which is
# usually just one quantum. Check for number of Quanta
# in a graph and ignore error if it's just one.
# TODO: This code has to be removed or replaced with
# something more generic
if not (len(self) == 1 and len(self[0].quanta) == 1):
raise

# Update `outputs` with this quantum outputs
for dataRef in chain.from_iterable(quantum.outputs.values()):
Expand Down

0 comments on commit 79c42fc

Please sign in to comment.