Skip to content

Commit c46725b

Browse files
author
Vasu Jaganath
committed
Fix the duplicate outs bug
1 parent eb79a90 commit c46725b

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed

src/sophios/api/http/restapi.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,6 @@ async def compile_wf(request: Request) -> Json:
161161

162162
cwl_tree_run.pop('steps', None)
163163
cwl_tree_run['steps'] = cwl_tree_run.pop('steps_dict', None)
164-
165-
# currently there is a compiler bug where the output variables are duplicated
166-
# this is a workaround to remove the duplicates till the compiler is fixed
167-
for step in cwl_tree_run['steps']:
168-
169-
out_vars = cwl_tree_run['steps'][step]['out']
170-
out_vars_unique = list(set(out_vars))
171-
cwl_tree_run['steps'][step]['out'] = out_vars_unique
172164
compute_workflow: Json = {}
173165
compute_workflow = {
174166
"name": yaml_stem,

src/sophios/api/pythonapi.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -782,13 +782,6 @@ def get_cwl_workflow(self, args_dict: Dict[str, str] = {}) -> Json:
782782
sub_node_data = rose_tree.data
783783
cwl_ast = sub_node_data.compiled_cwl
784784

785-
# Copy samee's workaround for duplicate outs
786-
for step in cwl_ast['steps']:
787-
out_vars = step['out']
788-
out_vars_unique = list(set(out_vars))
789-
out_vars_unique.sort()
790-
step['out'] = out_vars_unique
791-
792785
yaml_inputs = sub_node_data.workflow_inputs_file
793786
workflow_json: Json = {}
794787
workflow_json = {

src/sophios/utils_cwl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def add_yamldict_keyval_out(steps_i: Yaml, step_key: str, strs: List[str]) -> Ya
9292
if steps_i:
9393
if 'out' in steps_i:
9494
new_strs = steps_i['out'] + strs
95+
new_strs = list(set(new_strs))
9596
new_keyvals = dict([(k, v) if k != 'out' else (k, new_strs) for k, v in steps_i.items()])
9697
else:
9798
new_keyvals = dict(list(steps_i.items()) + [('out', strs)])

tests/test_scattering_scaling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def test_scattering_scaling(minval: int = 100, maxval: int = 500, step: int = 100) -> None:
1414
"""Tests that execution time scales linearly with input array size"""
1515
# First compile the workflow
16-
cmd = ['sophios', '--yaml', 'examples/scattering_scaling.wic']
16+
cmd = ['sophios', '--yaml', 'examples/scattering_scaling.wic', '--generate_run_script']
1717
sub.run(cmd, check=True)
1818

1919
basedir = 'autogenerated'

0 commit comments

Comments
 (0)