Skip to content

Commit 57ae05f

Browse files
committed
Merge pull request #1171 from satra/fix/setup
fix: cleaned up setup and several tests
2 parents 934cfcd + 1ac0f0c commit 57ae05f

File tree

58 files changed

+256
-916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+256
-916
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ include doc/documentation.zip
1010
include nipype/COMMIT_INFO.txt
1111

1212
recursive-include doc *
13-
recursive-include matlabscripts *
1413
recursive-include tools *

nipype/algorithms/setup.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

nipype/algorithms/tests/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:

nipype/algorithms/tests/test_mesh_ops.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
from shutil import rmtree
77
from tempfile import mkdtemp
88

9-
from nipype.testing import (assert_equal, assert_raises, skipif,
9+
from nipype.testing import (assert_equal, skipif,
1010
assert_almost_equal, example_data)
1111

1212
import numpy as np
13-
import nibabel as nb
14-
import nipype.testing as nit
1513

1614
from nipype.algorithms import mesh as m
1715

nipype/algorithms/tests/test_overlap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
from shutil import rmtree
88
from tempfile import mkdtemp
99

10-
from nipype.testing import (assert_equal, assert_raises,
11-
assert_almost_equal, example_data)
10+
from nipype.testing import (example_data)
1211

1312
import numpy as np
14-
import nibabel as nb
1513

1614

1715
def test_overlap():
@@ -25,6 +23,7 @@ def check_close(val1, val2):
2523
in1 = example_data('segmentation0.nii.gz')
2624
in2 = example_data('segmentation1.nii.gz')
2725

26+
cwd = os.getcwd()
2827
os.chdir(tempdir)
2928
overlap = Overlap()
3029
overlap.inputs.volume1 = in1
@@ -48,4 +47,5 @@ def check_close(val1, val2):
4847
yield (check_close, res.outputs.roi_voldiff,
4948
np.array([0.0063086, -0.0025506, 0.0]))
5049

50+
os.chdir(cwd)
5151
rmtree(tempdir)

nipype/algorithms/tests/test_rapidart.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
3-
from nipype.testing import (assert_equal, assert_false, assert_true,
4-
assert_almost_equal)
5-
import nipype.algorithms.rapidart as ra
6-
from nipype.interfaces.base import Bunch
73
import numpy as np
84

5+
from ...testing import (assert_equal, assert_false, assert_true,
6+
assert_almost_equal)
7+
from .. import rapidart as ra
8+
from ...interfaces.base import Bunch
9+
910

1011
def test_ad_init():
1112
ad = ra.ArtifactDetect(use_differences=[True, False])

nipype/algorithms/tests/test_splitmerge.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import os
54
from shutil import rmtree
65
from tempfile import mkdtemp
76
from nipype.testing import (assert_equal, example_data)
@@ -11,6 +10,9 @@ def test_split_and_merge():
1110
import numpy as np
1211
import nibabel as nb
1312
import os.path as op
13+
import os
14+
cwd = os.getcwd()
15+
1416
from nipype.algorithms.misc import split_rois, merge_rois
1517
tmpdir = mkdtemp()
1618

@@ -21,7 +23,6 @@ def test_split_and_merge():
2123

2224
dwshape = (mskdata.shape[0], mskdata.shape[1], mskdata.shape[2], 6)
2325
dwdata = np.random.normal(size=dwshape)
24-
2526
os.chdir(tmpdir)
2627
nb.Nifti1Image(dwdata.astype(np.float32),
2728
aff, None).to_filename(dwfile)
@@ -30,8 +31,8 @@ def test_split_and_merge():
3031
merged = merge_rois(resdw, resid, in_mask)
3132
dwmerged = nb.load(merged).get_data()
3233

33-
dwmasked = np.zeros_like(dwdata)
3434
dwmasked = dwdata * mskdata[:, :, :, np.newaxis]
35+
os.chdir(cwd)
3536
rmtree(tmpdir)
3637

3738
yield assert_equal, np.allclose(dwmasked, dwmerged), True

nipype/caching/tests/__init__.py

Whitespace-only changes.

nipype/caching/tests/test_memory.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
from nose.tools import assert_equal
88

9-
from nipype.caching import Memory
10-
from nipype.pipeline.tests.test_engine import TestInterface
11-
from nipype.utils.config import NipypeConfig
12-
config = NipypeConfig()
9+
from .. import Memory
10+
from ...pipeline.tests.test_engine import TestInterface
11+
12+
from ... import config
1313
config.set_default_config()
1414

1515
nb_runs = 0

nipype/external/setup.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)