Skip to content

Commit 460f691

Browse files
committed
move nipype config file to entrypoint, fix test_spm #1538
1 parent b7750cc commit 460f691

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ MAINTAINER Stanford Center for Reproducible Neuroscience <crn.poldracklab@gmail.
3131

3232
# Preparations
3333
RUN ln -snf /bin/bash /bin/sh
34-
WORKDIR /root
35-
36-
RUN mkdir -p .nipype && \
37-
echo '[logging]' > .nipype/nipype.cfg && \
38-
echo 'workflow_level = DEBUG' >> .nipype/nipype.cfg && \
39-
echo 'interface_level = DEBUG' >> .nipype/nipype.cfg && \
40-
echo 'filemanip_level = DEBUG' >> .nipype/nipype.cfg
4134

4235
# Install this branch's code
4336
WORKDIR /root/src

docker/circleci/run_builddocs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ source activate nipypetests-2.7
77
mkdir -p /scratch/docs
88
set -o pipefail && cd /root/src/nipype/doc && make html 2>&1 | tee /scratch/builddoc.log
99
cp -r /root/src/nipype/doc/_build/html/* /scratch/docs/
10-
chmod 755 -R /scratch/docs
11-
chmod 755 /scratch/builddoc.log
10+
chmod 775 -R /scratch/docs
11+
chmod 775 /scratch/builddoc.log
1212
cat /scratch/builddoc.log && if grep -q "ERROR" /scratch/builddoc.log; then false; else true; fi

docker/circleci/run_examples.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@
22
for i in /etc/profile.d/*.sh; do
33
source $i
44
done
5+
6+
mkdir -p /root/.nipype
7+
echo '[logging]' > /root/.nipype/nipype.cfg
8+
echo 'workflow_level = DEBUG' >> /root/.nipype/nipype.cfg
9+
echo 'interface_level = DEBUG' >> /root/.nipype/nipype.cfg
10+
echo 'filemanip_level = DEBUG' >> /root/.nipype/nipype.cfg
11+
512
source activate nipypetests-2.7
613
python /root/src/nipype/tools/run_examples.py $@

examples/test_spm.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import os.path as op
1010

1111

12+
def _get_first(inlist):
13+
if isinstance(inlist, (list, tuple)):
14+
return inlist[0]
15+
return inlist
1216

1317
def test_spm(name='test_spm_3d'):
1418
"""
@@ -18,8 +22,8 @@ def test_spm(name='test_spm_3d'):
1822
workflow = pe.Workflow(name=name)
1923

2024
inputnode = pe.Node(niu.IdentityInterface(fields=['in_data']), name='inputnode')
21-
dgr = pe.Node(nio.DataGrabber(template="feeds/data/fmri.nii.gz", outfields=['out_file']),
22-
name='datasource')
25+
dgr = pe.Node(nio.DataGrabber(template="feeds/data/fmri.nii.gz", outfields=['out_file'],
26+
sort_filelist=False), name='datasource')
2327

2428
stc = pe.Node(spm.SliceTiming(
2529
num_slices=21, time_repetition=1.0, time_acquisition=2. - 2. / 32,
@@ -33,12 +37,12 @@ def test_spm(name='test_spm_3d'):
3337
if name == 'test_spm_3d':
3438
split = pe.Node(fsl.Split(dimension="t", output_type="NIFTI"), name="split")
3539
workflow.connect([
36-
(dgr, split, [('out_file', 'in_file')]),
40+
(dgr, split, [(('out_file', _get_first), 'in_file')]),
3741
(split, stc, [("out_files", "in_files")])])
3842
elif name == 'test_spm_4d':
3943
gunzip = pe.Node(Gunzip(), name="gunzip")
4044
workflow.connect([
41-
(dgr, gunzip, [('out_file', 'in_file')]),
45+
(dgr, gunzip, [(('out_file', _get_first), 'in_file')]),
4246
(gunzip, stc, [("out_file", "in_files")])
4347
])
4448
else:

0 commit comments

Comments
 (0)