8000 Handling input fields checking for Mandatory and Mutually exclusive fields by ablachair · Pull Request #595 · nipype/pydra · GitHub
[go: up one dir, main page]

Skip to content

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

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

Merged
merged 8 commits into from
Dec 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check if input is in exlusion list before testing it
  • Loading branch information
ablachair committed Nov 17, 2022
commit a2da63c27f64b93de5d0f1b0d0a091d7b183f787
3 changes: 2 additions & 1 deletion pydra/engine/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def check_fields_input_spec(self):
if getattr(self, fld.name) is attr.NOTHING:
if mdata.get("mandatory"):
# checking if the mandatory field is provided elsewhere in the xor list
alreday_populated = [getattr(self, el) for el in mdata["xor"] if (getattr(self, el) is not attr.NOTHING)]
in_exclusion_list = mdata.get("xor") is not None
alreday_populated = in_exclusion_list and [getattr(self, el) for el in mdata["xor"] if (getattr(self, el) is not attr.NOTHING)]
if alreday_populated: #another input satisfies mandatory attribute via xor condition
continue
else:
Expand Down
0