-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIU-444: Add new Bash shell parsing approach. #309
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @awicenec, may you please review this PR when you have the time? |
|
||
# Replace inputs/outputs in command line with paths or data URLs | ||
cmd = droputils.replace_path_placeholders(cmd, fsInputs, fsOutputs) | ||
for key, value in keyargs.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set of instructions we discussed to produce replacement a la f-strings style:
>>> of = "my file"
>>> s = "dd {of}"
>>> eval('f"'+s+'"')
>> 'dd my file'
I believe the issue with this approach is we do not have the actual variable names specified; they are keys in the dictionary, so we would have to construct variables dynamically and then perform the eval
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awicenec to clarify - I think we can definitely replace the '%' with '{}' if you'd prefer that, so that it matches similar projects (e.g. Stimela); I just don't think we can do it with the eval
.
JIRA Ticket
LIU-444
Type
Problem/Issue
The current approach to managing BashShellApp command parsing is obfuscated and quite confusing. We both hard-code the port numbers of each in put in the bash command (e.g. "ls -l %i0 > %o0 ", where i0 is the 1st input/o0 is the 1st output) whilst also not having any knowledge of which port would be the first, second, third when translating.
It is also hard to understand how to perform redirection in the graph as we have a number of different redirection options. It would be great to replace this approach with a simplified way way of constructing the inputs/outputs, and the redirection.
Solution
This PR removes the redirection whilst replace all input/outputs with "%input_name%" options.
Here, %recursive% is a reference to the
recursive
parameter in the component (which is 'False').Checklist
Summary by Sourcery
Tests: