Skip to content

fix: MNIBiasCorrection smart out_file #1806

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 22 commits into from
Feb 27, 2017
Merged

fix: MNIBiasCorrection smart out_file #1806

merged 22 commits into from
Feb 27, 2017

Conversation

mgxd
Copy link
Member

@mgxd mgxd commented Feb 10, 2017

@mgxd mgxd changed the title fix: make outvol mandatory fix: make MNIBiasCorrection outvol mandatory Feb 10, 2017
@codecov-io
Copy link

codecov-io commented Feb 10, 2017

Codecov Report

Merging #1806 into master will decrease coverage by -0.07%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #1806      +/-   ##
==========================================
- Coverage   73.09%   73.03%   -0.07%     
==========================================
  Files        1064     1064              
  Lines       53322    53329       +7     
==========================================
- Hits        38978    38947      -31     
- Misses      14344    14382      +38
Flag Coverage Δ
#unittests 73.03% <66.66%> (-0.07%)
Impacted Files Coverage Δ
nipype/interfaces/freesurfer/preprocess.py 68.15% <100%> (+0.19%)
...ype/interfaces/freesurfer/tests/test_preprocess.py 91.83% <63.63%> (-8.17%)
nipype/utils/tests/test_filemanip.py 80.54% <ø> (-12.67%)
nipype/init.py 65.62% <ø> (-3.13%)
nipype/utils/tests/test_cmd.py 95.65% <ø> (-2.9%)
nipype/pipeline/plugins/multiproc.py 75.41% <ø> (-1.68%)
nipype/interfaces/utility/wrappers.py 88.77% <ø> (-1.03%)
nipype/interfaces/tests/test_runtime_profiler.py 43.57% <ø> (-0.56%)
nipype/utils/filemanip.py 86.81% <ø> (-0.37%)

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 1a93a17...da1bd76. Read the comment docs.


# test raising error with only partial mandatory args present
mni.inputs.in_file = filelist[0] #mgz
with pytest.raises(ValueError): mni.run()
Copy link
Member

Choose a reason for hiding this comment

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

this shouldn't raise an error. the point of having name_source and template is to autogenerate an out_file name. if that's not happening sth is broken.

also you shouldn't have to call run() for testing this. just, mni.cmdline

@mgxd mgxd changed the title fix: make MNIBiasCorrection outvol mandatory fix: MNIBiasCorrection smart out_file Feb 14, 2017
@@ -1528,7 +1528,7 @@ class MNIBiasCorrection(FSCommand):
output_spec = MNIBiasCorrectionOutputSpec

def _list_outputs(self):
outputs = self._outputs().get()
outputs = self._output_spec().get()
Copy link
Member

Choose a reason for hiding this comment

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

this shouldn't need to be the case. what is failing with _outputs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since most other interfaces are using outputspec - I wanted to test. I can revert this

@@ -1468,7 +1468,7 @@ class MNIBiasCorrectionInputSpec(FSTraitedSpec):
in_file = File(exists=True, mandatory=True, argstr="--i %s",
desc="input volume. Input can be any format accepted by mri_convert.")
# optional
out_file = File(argstr="--o %s", name_source=['in_file'], genfile=True,
out_file = File(argstr="--o %s", name_source=['in_file'],
Copy link
Member

Choose a reason for hiding this comment

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

why is genfile=True removed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had added it in a previous test, but the out_file was still not being found

@@ -1467,11 +1476,11 @@ class MNIBiasCorrectionInputSpec(FSTraitedSpec):
# mandatory
in_file = File(exists=True, mandatory=True, argstr="--i %s",
desc="input volume. Input can be any format accepted by mri_convert.")
out_file = File(argstr="--o %s", name_source=['in_file'],
# optional
out_file = File(argstr="--o %s", name_source=['in_file'], genfile=True,
Copy link
Member

Choose a reason for hiding this comment

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

genfile=True is not required. could you also merge with master?

@satra
Copy link
Member

satra commented Feb 16, 2017

@oesteban - it seems like the docker container is being built every time. should that be happening?

@satra
Copy link
Member

satra commented Feb 17, 2017

@oesteban - docker build error:

Step 26 : RUN conda config --add channels conda-forge --add channels intel &&     chmod +x /usr/local/miniconda/bin/* &&     conda config --set always_yes yes --set changeps1 no &&     conda update -q conda &&     chmod +x /usr/local/miniconda/bin/* &&     conda install -y mkl=2017.0.1                      numpy=1.11.2                      scipy=0.18.1                      scikit-learn=0.17.1                      matplotlib=1.5.3                      pandas=0.19.0                      libxml2=2.9.4                      libxslt=1.1.29                      traits=4.6.0                      psutil=5.0.1                      icu=58.1
 ---> Using cache
 ---> c388f2e830be
Step 27 : RUN sed -i 's/\(backend *: \).*$/\1Agg/g' /usr/local/miniconda/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc &&     python -c "from matplotlib import font_manager"
 ---> Running in 9f8f187d6533
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named matplotlib

@oesteban
Copy link
Contributor

For some reason I don't know, conda update is doing some funky stuff with the permissions. Matplotlib is installed but then permissions are too restrictive. @chrisfilo and I had to add this line for that very reason. That error happened before with the python 2.7 build. I'll fix that now

oesteban added a commit to oesteban/nipype that referenced this pull request Feb 17, 2017
@oesteban
Copy link
Contributor

Ok, now it is fixed: https://circleci.com/gh/oesteban/nipype/454 (to be merged within #1825)

@mgxd
Copy link
Member Author

mgxd commented Feb 27, 2017

@satra this is all set

@satra satra merged commit 1188b50 into nipy:master Feb 27, 2017
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.

4 participants