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

Handling input fields checking for Mandatory and Mutually exclusive fields #595

Merged
merged 8 commits into from
Dec 2, 2022

Conversation

ablachair
Copy link
Contributor

Types of changes

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

Summary

We identified a possible issue with Pydra task input fields checking.

Input fields can be marked as 'mandatory' as well as 'mutually exclusive'.
If

  1. field_A is mandatory
  2. field_B is mandatory
  3. field_A and field_B are 'mutually exclusive'

then only field_A or field_B is needed, not both.

Nipype follows this behavior, but it seems like check_fields_input_spec() of the Pydra engine (pydra/pydra/engine/specs.py) is checking those conditions sequentially, not concurrently.
Compared with _check_mandatory_inputs() (nipype/interfaces/base/core.py)

Note

The unit test might be misplaced. Should it go in test_shelltask_inputspec.py ?

Checklist

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

@codecov
Copy link

codecov bot commented Nov 17, 2022

Codecov Report

Base: 76.77% // Head: 76.79% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (5e0c249) compared to base (5bbb4a9).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #595      +/-   ##
==========================================
+ Coverage   76.77%   76.79%   +0.02%     
==========================================
  Files          19       19              
  Lines        4349     4353       +4     
  Branches     1193     1195       +2     
==========================================
+ Hits         3339     3343       +4     
  Misses        821      821              
  Partials      189      189              
Flag Coverage Δ
unittests 76.70% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
pydra/engine/specs.py 88.12% <100.00%> (+0.11%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ablachair
Copy link
Contributor Author

@djarecka
Copy link
Collaborator

djarecka commented Dec 1, 2022

@ablachair - thank you so much for the fix!
Perhaps you can indeed move the tests to test_shelltask_inputspec.py, but it's not as important.

Could you please add your name to zenodo file. We haven't kept any specific order, but just keep Satra Ghosh as the last one.

@djarecka
Copy link
Collaborator

djarecka commented Dec 2, 2022

I will merge it now, but please add yourself to zenodo when you have a chance

@djarecka djarecka merged commit 68cfa5d into nipype:master Dec 2, 2022
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