Skip to content
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

changing template formatting when value (or default) is False #561

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

djarecka
Copy link
Collaborator

@djarecka djarecka commented Aug 6, 2022

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Summary

when output use template to create the output path and value is False the field should not be used in the cmdline, it was inconsistent

Checklist

  • I have added tests to cover my changes (if necessary)
  • I have updated documentation (if necessary)

@codecov
Copy link

codecov bot commented Aug 6, 2022

Codecov Report

Merging #561 (3fe8f23) into master (ac06f8c) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #561      +/-   ##
==========================================
- Coverage   77.13%   77.09%   -0.04%     
==========================================
  Files          20       20              
  Lines        4316     4322       +6     
  Branches     1212     1215       +3     
==========================================
+ Hits         3329     3332       +3     
- Misses        799      802       +3     
  Partials      188      188              
Flag Coverage Δ
unittests 77.00% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pydra/engine/helpers.py 80.00% <100.00%> (-0.62%) ⬇️
pydra/engine/helpers_file.py 78.85% <100.00%> (ø)
pydra/engine/specs.py 88.64% <100.00%> (+0.05%) ⬆️
pydra/engine/task.py 86.85% <100.00%> (+0.08%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

…ld function to get a specific field from a spec
@djarecka
Copy link
Collaborator Author

djarecka commented Aug 8, 2022

@yibeichan - this is the fix for the template, I was trying this on the example of FNIRT, but you can try on your example if you want and let me know if this makes sense

@yibeichan
Copy link
Collaborator

@djarecka thank you! so I create a local branch for pydra, used your code. then run pytest in pydra-fsl on cluster.py, but my task.cmdline still changed after task.run(). Here is my cluster.py https://github.com/yibeichan/pydra-fsl/blob/wip-yc-convert/pydra/tasks/fsl/model/cluster.py; here is the test https://github.com/yibeichan/pydra-fsl/blob/wip-yc-convert/pydra/tasks/fsl/model/tests/test_run_cluster.py

@@ -1170,6 +1172,8 @@ def test_shell_cmd_inputs_template_6():
executable="executable", input_spec=my_input_spec, inpA="inpA", outA=False
)
assert shelly.cmdline == "executable inpA"
# checking of the command is the same
assert shelly.cmdline == "executable inpA"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djarecka isn't line 1176 the same as the line 1174? shouldn't we add something like shelly.run() between 1174 and 1176?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I realized that the run wasn't an issue when we were checking this last week, simply repeating cmdline was giving a new result, it was a bug... That's why I added this to the test...

@djarecka
Copy link
Collaborator Author

djarecka commented Aug 8, 2022

thanks, I will check your tests

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.

2 participants