Skip to content

bug for datagrabber #1915

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 3 commits into from
Feb 16, 2018
Merged

bug for datagrabber #1915

merged 3 commits into from
Feb 16, 2018

Conversation

anbai106
Copy link
Contributor

There are two other classes in the io.py file, they maybe have the same problem, if you think my change works, you can also change the other two classes.

@codecov-io
Copy link

codecov-io commented Mar 29, 2017

Codecov Report

Merging #1915 into master will increase coverage by 0.05%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1915      +/-   ##
==========================================
+ Coverage   67.43%   67.49%   +0.05%     
==========================================
  Files        1224     1225       +1     
  Lines       60187    60308     +121     
  Branches     8647     8649       +2     
==========================================
+ Hits        40590    40703     +113     
- Misses      18471    18489      +18     
+ Partials     1126     1116      -10
Flag Coverage Δ
#smoketests 51.27% <60%> (+0.57%) ⬆️
#unittests 65.45% <20%> (-0.01%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/io.py 50.46% <60%> (+0.03%) ⬆️
nipype/pipeline/plugins/multiproc.py 79.76% <0%> (-0.6%) ⬇️
examples/fmri_spm_nested.py 86.44% <0%> (ø)
nipype/interfaces/base/core.py 85.11% <0%> (+0.15%) ⬆️
nipype/pipeline/engine/utils.py 82.75% <0%> (+0.22%) ⬆️
nipype/utils/filemanip.py 75% <0%> (+0.96%) ⬆️
nipype/utils/config.py 66.29% <0%> (+1.65%) ⬆️

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 166e06c...b8eda2d. Read the comment docs.

@satra
Copy link
Member

satra commented May 3, 2017

@mgxd - could you please review this and make sure it functions as intended in the description for raise_on_empty?

@mgxd
Copy link
Member

mgxd commented May 4, 2017

@anbai106 maybe we can add a new input field drop_blank_outputs that performs this check on top of raise_on_empty.

@oesteban oesteban added this to the 0.14.1 milestone Jan 7, 2018
@mgxd
Copy link
Member

mgxd commented Jan 8, 2018

@anbai106 the behavior you want would require a new input for datagrabber - something along the lines of

...
        if self.inputs.drop_blank_outputs:
            outputs[key] = [x for x in outputs[key] if x is not None]
        else:
            if any([val is None for val in outputs[key]]):
                outputs[key] = []
...

this behavior will potentially return lists of different sizes, which is dangerous when working with mapnodes / iterables across runs - thus, better to make a new input rather than build off of raise_on_empty

(linking to related issue #1783)

This is very close to merge!

@effigies
Copy link
Member

Hi @anbai106, are you going to have time to finish this up, soon?

@anbai106
Copy link
Contributor Author

anbai106 commented Feb 15, 2018

@effigies sorry for the delay, not so familiar with git pull request, i hope now everything is OK (BTW, should I also add the new input field of drop_blank_outputs from @mgxd?? I did do that before the merge...).

@mgxd
Copy link
Member

mgxd commented Feb 15, 2018

@anbai106 we're just missing two things:

could add a new input for DataGrabber here?

class DataGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec):

and make the changes from the earlier comment?

If you don't find time, we could make the changes for you, if that would be easier. Thanks!

@anbai106
Copy link
Contributor Author

@mgxd , I am doing it now, if I make it wrong this time, you will be in charge of it, haha

@anbai106
Copy link
Contributor Author

@mgxd I corrected like you proposed and merge my branch into the master branch, can you check if everything is ok?

@mgxd
Copy link
Member

mgxd commented Feb 15, 2018

@anbai106 you'll have to git push your branch for us to see the changes

@effigies
Copy link
Member

Hi @anbai106, I think you merged into your own master branch, which isn't going to show up here. Try the following:

git remote add upstream git@github.com:nipy/nipype.git
git fetch upstream

This will make the official master branch available to you as upstream/master. Then we need to merge your current changes into the anbai branch, which is connected to this pull request.

git checkout anbai
git merge master

Finally, I would recommend merging the current master, just to update the tests, then push:

git merge upstream/master
git push

@effigies effigies modified the milestones: 0.14.1, 1.0.1 Feb 15, 2018
@anbai106
Copy link
Contributor Author

@effigies finally, I think it is done :)
Thanks for your help

@effigies
Copy link
Member

@anbai106 For some reason that latest version had some commit issues in it. I rebased your PR against the current master to remove the noise. Can you please check the diff and verify that it looks the way you intended?

@effigies
Copy link
Member

@mgxd I think this is ready, unless you need tests.

Copy link
Member

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @anbai106 @effigies

@mgxd mgxd merged commit 628bdd5 into nipy:master Feb 16, 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.

6 participants