Skip to content

Commit f46de3e

Browse files
author
Vasu Jaganath
committed
remove old cwl_inline_runtag update functions
1 parent c46725b commit f46de3e

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

src/sophios/plugins.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -165,37 +165,6 @@ def cwl_update_outputs_optional(cwl: Cwl) -> Cwl:
165165
return cwl_mod
166166

167167

168-
def cwl_update_inline_runtag(cwl: Cwl, path: Path, relative_run_path: bool) -> Cwl:
169-
"""Updates 'run' tag with inline content
170-
171-
Args:
172-
cwl (Cwl): A CWL Workflow
173-
path (Path): The directory in which to read files from
174-
relative_run_path (bool): Controls whether to use subdirectories or just one directory
175-
Returns:
176-
Cwl: A CWL Workflow with inline run (if any)
177-
"""
178-
cwl_mod = copy.deepcopy(cwl)
179-
for step in cwl_mod['steps']:
180-
runtag_orig = step.get('run', '')
181-
match runtag_orig:
182-
case str():
183-
if runtag_orig.endswith('.cwl'):
184-
if relative_run_path:
185-
yml_path = Path.cwd() / path / runtag_orig
186-
else:
187-
yml_path = Path(runtag_orig) # Assume absolute path in the runtag
188-
with open(yml_path, mode='r', encoding='utf-8') as f:
189-
runtag_raw = yaml.safe_load(f.read())
190-
# local $namespace and $schema tag shouldn't be in inline cwl steps
191-
runtag_raw.pop('$namespaces', None)
192-
runtag_raw.pop('$schemas', None)
193-
step['run'] = runtag_raw
194-
case _:
195-
pass # We only care if the runtag is a cwl filepath
196-
return cwl_mod
197-
198-
199168
Client = Union[docker.DockerClient, podman.PodmanClient] # type: ignore
200169

201170

@@ -265,30 +234,6 @@ def remove_entrypoints_podman() -> None:
265234
remove_entrypoints(client, podman.domain.images_build.BuildMixin())
266235

267236

268-
def cwl_update_inline_runtag_rosetree(rose_tree: RoseTree, path: Path, relative_run_path: bool) -> RoseTree:
269-
"""Inlines the compiled CWL files runtag
270-
271-
Args:
272-
rose_tree (RoseTree): The data associated with compiled subworkflows
273-
path (Path): The directory in which to read files from
274-
relative_run_path (bool): Controls whether to use subdirectories or just one directory.
275-
Returns:
276-
RoseTree: rose_tree with inline cwl runtag
277-
"""
278-
n_d: NodeData = rose_tree.data
279-
if n_d.compiled_cwl['class'] == 'Workflow':
280-
outputs_cwl_inline_runtag = cwl_update_inline_runtag(n_d.compiled_cwl, path, relative_run_path)
281-
else:
282-
outputs_cwl_inline_runtag = n_d.compiled_cwl
283-
284-
sub_trees_path = [cwl_update_inline_runtag_rosetree(sub_rose_tree, path, relative_run_path) for
285-
sub_rose_tree in rose_tree.sub_trees]
286-
node_data_path = NodeData(n_d.namespaces, n_d.name, n_d.yml, outputs_cwl_inline_runtag, n_d.tool,
287-
n_d.workflow_inputs_file, n_d.explicit_edge_defs, n_d.explicit_edge_calls,
288-
n_d.graph, n_d.inputs_workflow, n_d.step_name_1)
289-
return RoseTree(node_data_path, sub_trees_path)
290-
291-
292237
def cwl_update_outputs_optional_rosetree(rose_tree: RoseTree) -> RoseTree:
293238
"""Updates outputs optional for every CWL CommandLineTool
294239

0 commit comments

Comments
 (0)