Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-17398: Allow graph traversal for "split graphs" #81

Merged
merged 1 commit into from
Jan 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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