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

Prevent recursive attr->dict conversion of FunctionTask inputs #503

Merged
merged 5 commits into from
Oct 20, 2021

Conversation

tclose
Copy link
Contributor

@tclose tclose commented Oct 13, 2021

Acknowledgment

  • [ x ] I acknowledge that this contribution will be available under the Apache 2 license.

Types of changes

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Summary

Sets recurse=False in all calls to attr.asdict to allow "attrs" classes to be passed as
task inputs (which are otherwise also converted to dicts.

Checklist

  • [ x ] All tests passing
  • [ x ] I have added tests to cover my changes
  • [ n/a ] I have updated documentation (if necessary)
  • [ x ] My code follows the code style of this project
    (we are using black: you can pip install pre-commit,
    run pre-commit install in the pydra directory
    and black will be run automatically with each commit)

…unction

task to allow objects to be passed as inputs to functions (i.e. without being
converted into dicts
@codecov
Copy link

codecov bot commented Oct 13, 2021

Codecov Report

Merging #503 (e61f2cb) into master (eb70454) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #503   +/-   ##
=======================================
  Coverage   83.04%   83.04%           
=======================================
  Files          20       20           
  Lines        4046     4046           
  Branches     1118     1118           
=======================================
  Hits         3360     3360           
  Misses        491      491           
  Partials      195      195           
Flag Coverage Δ
unittests 82.97% <100.00%> (ø)

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

Impacted Files Coverage Δ
pydra/engine/audit.py 88.88% <100.00%> (ø)
pydra/engine/core.py 89.28% <100.00%> (ø)
pydra/engine/helpers.py 79.57% <100.00%> (ø)
pydra/engine/helpers_file.py 80.48% <100.00%> (ø)
pydra/engine/helpers_state.py 90.00% <100.00%> (ø)
pydra/engine/specs.py 88.13% <100.00%> (ø)
pydra/engine/task.py 87.85% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb70454...e61f2cb. Read the comment docs.

@tclose tclose marked this pull request as ready for review October 13, 2021 05:24
@tclose tclose force-pushed the asdict_no_recurse branch from b6b2e1e to 2ea1af3 Compare October 14, 2021 22:09
@djarecka
Copy link
Collaborator

lgtm, didn't think about it.

planning to add anything more? if not, we can merge it

@tclose
Copy link
Contributor Author

tclose commented Oct 17, 2021

No, that is all for this PR (I have already done a global search and replace for asdict). Please go ahead with the merge :)

@djarecka djarecka merged commit dd00a74 into nipype:master Oct 20, 2021
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