Skip to content

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

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

Closed
wants to merge 2 commits into 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

All modified and coverable lines are covered by tests ✅

Project coverage is 77.09%. Comparing base (ac06f8c) to head (3fe8f23).
Report is 1305 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #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.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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

@tclose
Copy link
Contributor

tclose commented Apr 2, 2025

I believe this is how the current main works now

@tclose tclose closed this Apr 29, 2025
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.

3 participants