Skip to content

Conversation

@simleo
Copy link
Collaborator

@simleo simleo commented Jun 16, 2023

Fixes #49

In the case of inline tools, the value of the run attribute for a step is not a string that points to a tool definition, but the tool definition itself. This breaks the old code. The fix is based on "normalizing" the dictionary output by get_workflow so that it has separate entries for the tools, as it does when tools come from separate documents: for each step s, s.run is replaced with the tool's id and the tool is stored in the dictionary (indexed by its fragment part).

In CWL 1.0 this works out of the box, because IDs are consistent with each other: an inline tool has an id like 'file:///.../packed.cwl#main/rev/bb642334-0fc4-4f98-93e4-846da100367e' and its parameters have ids like 'file:///.../packed.cwl#main/rev/bb642334-0fc4-4f98-93e4-846da100367e/rev_in'.

In CWL 1.1 and 1.2, inline tool ids are like '_:d7f3025e-b6de-487b-8727-98f1649dd739' but parameter ids are like 'file:///home/simleo/git/runcrate/tests/data/revsort-inline-cwl1.2-run-1/workflow/packed.cwl#main/rev/run/rev_in', i.e., like in CWL 1.0 but with the fixed string "rev" replacing the UUID. If the tool id is left unchanged, the code fails to match parameter values from activities with formal parameters. To make it work, I've added a line that replaces the tool id with the step id + "/run", so it's consistent with the parameter ids.

@simleo simleo merged commit 61b2e01 into ResearchObject:main Jun 16, 2023
@simleo simleo deleted the inline_tools branch June 16, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'CommandLineTool' object has no attribute 'rsplit'

1 participant