Skip to content

ENH: Minimize the number of calls to _load_results when populating inputs #3075

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 2 commits into from
Nov 11, 2019

Conversation

oesteban
Copy link
Contributor

@oesteban oesteban commented Oct 11, 2019

This PR attempts to alleviate #3014 by opening the result file of a source node only once when that node feeds into several inputs of the node collecting inputs. Before these changes, a call to _load_results was issued for every input field that needed to collect its inputs from a past node. Now, all the inputs coming from the same node are put together and the _load_results function is called just once.

The PR also modifies the manner the AttributeErrors (#3014) were handled to make it easier to spot whether an error occurred while loading results araises when gathering the inputs of a node-to-be-run or elsewhere.

…g inputs

This PR attempts to alleviate nipy#3014 by opening the result file of a
source node only once when that node feeds into several inputs of the
node collecting inputs.
Before these changes, a call to ``_load_results`` was issued for every
input field that needed to collect its inputs from a past node.
Now, all the inputs comming from the same node are put together and the
``_load_results`` function is called just once.

The PR also modifies the manner the ``AttributeError``s (nipy#3014) were handled
to make it easier to spot whether an error occured while loading results
araises when gathering the inputs of a node-to-be-run or elsewhere.
@oesteban oesteban requested review from satra and effigies October 11, 2019 21:45
@codecov
Copy link

codecov bot commented Oct 13, 2019

Codecov Report

Merging #3075 into master will decrease coverage by 3.63%.
The diff coverage is 73.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3075      +/-   ##
==========================================
- Coverage   68.19%   64.56%   -3.64%     
==========================================
  Files         297      295       -2     
  Lines       39770    39691      -79     
  Branches     5209     5202       -7     
==========================================
- Hits        27122    25627    -1495     
- Misses      11939    13018    +1079     
- Partials      709     1046     +337
Flag Coverage Δ
#smoketests ?
#unittests 64.56% <73.07%> (-0.88%) ⬇️
Impacted Files Coverage Δ
nipype/pipeline/engine/nodes.py 76.55% <73.07%> (-7%) ⬇️
nipype/interfaces/nilearn.py 40% <0%> (-56.67%) ⬇️
nipype/workflows/__init__.py 47.05% <0%> (-52.95%) ⬇️
nipype/utils/spm_docs.py 25.92% <0%> (-44.45%) ⬇️
nipype/interfaces/freesurfer/base.py 46.61% <0%> (-32.21%) ⬇️
nipype/utils/logger.py 59.7% <0%> (-29.86%) ⬇️
nipype/algorithms/rapidart.py 35% <0%> (-29.42%) ⬇️
nipype/interfaces/spm/base.py 57.94% <0%> (-29.14%) ⬇️
nipype/utils/provenance.py 55.73% <0%> (-28.35%) ⬇️
nipype/interfaces/fsl/model.py 55.26% <0%> (-25.35%) ⬇️
... and 39 more

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 57f1569...2e5436d. Read the comment docs.

Copy link
Member

@satra satra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oesteban
Copy link
Contributor Author

I'm going to give it a quick try locally with fMRIPrep before merging in.

@satra satra merged commit e43e401 into nipy:master Nov 11, 2019
@effigies effigies added this to the 1.3.0 milestone Jan 6, 2020
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