Skip to content

Commit

Permalink
Remove double constraint in by_io/by_chronology
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbgn committed Jul 26, 2023
1 parent 6656b08 commit 9b7c6b9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions transforge/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ def chronology(self) -> Iterator[str]:
"""
# We can assume at this point that there will not be any cycles

assert self.by_io

visited: set[Variable] = set()
waiting: list[Variable] = list(self.outputs)
processing: deque[Variable] = deque()
Expand Down Expand Up @@ -351,10 +353,11 @@ def chronology(self) -> Iterator[str]:
# Connect the initial nodes (ie outputs)
if not self.after[current]:
assert current in self.outputs
if self.by_penultimate:
yield f"?workflow :output/:from? {current.n3()}."
else:
yield f"?workflow :output {current.n3()}."
assert self.by_io, ("the output node should have already "
"been constrained earlier")
yield from union(f"{current.n3()} :via",
self.operator.get(current, ()))
continue

# Write connections to previous nodes (ie ones that come after)
for c in self.after[current]:
Expand Down

0 comments on commit 9b7c6b9

Please sign in to comment.