From 62eb2c92108bf7a4896bae058ba85d0aabfea538 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Sun, 13 Aug 2023 17:25:51 -0700 Subject: [PATCH 1/2] fix TypeError when passing name to flow_to_workflow() --- src/jobflow/managers/fireworks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobflow/managers/fireworks.py b/src/jobflow/managers/fireworks.py index 69f8de75..d1a24c7c 100644 --- a/src/jobflow/managers/fireworks.py +++ b/src/jobflow/managers/fireworks.py @@ -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( From bb3d972b2e30daf1ea949301f98ffeffb0bac39b Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Sun, 13 Aug 2023 17:26:19 -0700 Subject: [PATCH 2/2] test flow_to_workflow() with custom name --- tests/managers/test_fireworks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/managers/test_fireworks.py b/tests/managers/test_fireworks.py index 4821d239..74154f54 100644 --- a/tests/managers/test_fireworks.py +++ b/tests/managers/test_fireworks.py @@ -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"