Skip to content

Commit

Permalink
chore: tidy for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Mar 7, 2024
1 parent 33b3ac1 commit 1c2834a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/dewret/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,16 @@ def from_result(result: StepReference) -> Workflow:
workflow.set_output(result)
return workflow

def set_output(self, output: "StepReference") -> None:
def set_output(self, output: StepReference) -> None:
"""Choose the output step.
Sets a step as being the output for the entire workflow.
Argument:
output: reference to the chosen step.
"""
if output.step.__workflow__ != self:
raise RuntimeError("Output must be from a step in this workflow.")
self.output = output


Expand Down
4 changes: 4 additions & 0 deletions tests/test_cwl.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Verify CWL output is OK."""

import yaml
from dewret.tasks import task, run
from dewret.renderers.cwl import render
Expand All @@ -11,6 +13,8 @@ def increment(num: int) -> int:

def test_cwl() -> None:
"""Check whether we can produce simple CWL.
Produces simplest possible CWL from a workflow.
"""
result = increment(num=3)
workflow = run(result)
Expand Down

0 comments on commit 1c2834a

Please sign in to comment.