Skip to content

FIX: Prevent double-collapsing of nested lists by OutputMultiObject #2673

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 5 commits into from
Aug 2, 2018

Conversation

effigies
Copy link
Member

@effigies effigies commented Aug 2, 2018

Summary

The saving/loading of results in Node causes an OutputMultiObject that looks like [[x]] to be collapsed twice into x, as opposed to the expected [x].

This PR detects collapses by performing a clone_traits(), which also collapses such traits, and wraps those values in a list.

Fixes #2670.

List of changes proposed in this PR (pull-request)

  • Create a _protect_collapses helper function that mimics trait_get, but re-wraps collapsing traits in lists before returning the values.

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@effigies effigies requested review from oesteban and satra August 2, 2018 16:40
Cloned traits are a subset of the original.
@effigies effigies changed the title FIX: Identify collapsing traits and wrap in list [WIP] FIX: Identify collapsing traits and wrap in list Aug 2, 2018
@effigies
Copy link
Member Author

effigies commented Aug 2, 2018

While this seems to resolve the reading of result.outputs, the "Execution Outputs" in the report are still off...

FIX: Improve collapse detection to correctly handle numpy arrays

FIX: Uncollapse before modifying paths when loading results
@codecov-io
Copy link

codecov-io commented Aug 2, 2018

Codecov Report

Merging #2673 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2673      +/-   ##
==========================================
- Coverage   67.62%   67.61%   -0.01%     
==========================================
  Files         340      340              
  Lines       43056    43076      +20     
  Branches     5329     5333       +4     
==========================================
+ Hits        29116    29127      +11     
- Misses      13238    13246       +8     
- Partials      702      703       +1
Flag Coverage Δ
#smoketests 50.55% <100%> (+0.03%) ⬆️
#unittests 65.07% <100%> (-0.02%) ⬇️
Impacted Files Coverage Δ
nipype/pipeline/engine/utils.py 82.64% <100%> (+0.39%) ⬆️
nipype/pipeline/plugins/legacymultiproc.py 55.95% <0%> (-5.36%) ⬇️

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 69dce12...c50839e. Read the comment docs.

@effigies effigies changed the title [WIP] FIX: Identify collapsing traits and wrap in list FIX: Identify collapsing traits and wrap in list Aug 2, 2018
@effigies
Copy link
Member Author

effigies commented Aug 2, 2018

@oesteban This is passing if you have a few minutes for review.

@oesteban
Copy link
Contributor

oesteban commented Aug 2, 2018

I was at it right now :)

@effigies effigies changed the title FIX: Identify collapsing traits and wrap in list FIX: Prevent double-collapsing of nested lists by OutputMultiObject Aug 2, 2018
@effigies
Copy link
Member Author

effigies commented Aug 2, 2018

Thanks.

@effigies effigies merged commit 91fbcce into nipy:master Aug 2, 2018
@effigies effigies deleted the fix/double_squash branch August 2, 2018 22:11
@effigies effigies added this to the 1.1.2 milestone Aug 30, 2018
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