Skip to content

Commit

Permalink
Merge pull request #396 from materialsproject/fix-flow_to_workflow-na…
Browse files Browse the repository at this point in the history
…me-type-err

Fix `TypeError` when passing name to `flow_to_workflow()`
  • Loading branch information
janosh authored Aug 14, 2023
2 parents 10aad48 + bb3d972 commit 0fbabf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/jobflow/managers/fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def flow_to_workflow(
fw = job_to_firework(job, store, parents=parents, parent_mapping=parent_mapping)
fireworks.append(fw)

return Workflow(fireworks, name=flow.name, **kwargs)
return Workflow(fireworks, name=kwargs.pop("name", flow.name), **kwargs)


def job_to_firework(
Expand Down
6 changes: 3 additions & 3 deletions tests/managers/test_fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def test_flow_to_workflow(
assert len(wf.fws) == 1
assert wf.fws[0].name == "func"

# test simple job no store
# test simple job no store with custom name
flow = simple_job()
wf = flow_to_workflow(flow)
wf = flow_to_workflow(flow, name="custom_name")

assert type(wf) == Workflow
assert wf.name == "Flow"
assert wf.name == "custom_name"
assert len(wf.fws) == 1
assert wf.fws[0].name == "func"

Expand Down

0 comments on commit 0fbabf3

Please sign in to comment.