Closed
Description
How to replicate the behavior
py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype
Script/Workflow details
=================================== FAILURES ===================================
______________ TestSignalExtraction.test_signal_extract_no_shared ______________
[gw1] linux -- Python 3.6.6 /usr/bin/python3.6
self = <nipype.interfaces.tests.test_nilearn.TestSignalExtraction object at 0x7f6fe5545550>
def test_signal_extract_no_shared(self):
# run
iface.SignalExtraction(
in_file=self.filenames['in_file'],
label_files=self.filenames['label_files'],
class_labels=self.labels,
incl_shared_variance=False).run()
# assert
> self.assert_expected_output(self.labels, self.base_wanted)
/var/tmp/portage/sci-libs/nipype-1.1.7/work/nipype-1.1.7/nipype/interfaces/tests/test_nilearn.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <nipype.interfaces.tests.test_nilearn.TestSignalExtraction object at 0x7f6fe5545550>
labels = ['CSF', 'GrayMatter', 'WhiteMatter']
wanted = [[-2.33333, 2, 0.5], [0, -2, 0.5], [-0.3333333, -1, 2.5], [0, -2, 0.5], [-1.3333333, -5, 1]]
def assert_expected_output(self, labels, wanted):
with open(self.filenames['out_file'], 'r') as output:
got = [line.split() for line in output]
labels_got = got.pop(0) # remove header
assert labels_got == labels
assert len(got) == self.fake_fmri_data.shape[
3], 'num rows and num volumes'
# convert from string to float
got = [[float(num) for num in row] for row in got]
for i, time in enumerate(got):
assert len(labels) == len(time)
for j, segment in enumerate(time):
> npt.assert_almost_equal(segment, wanted[i][j], decimal=1)
E AssertionError:
E Arrays are not almost equal to 1 decimals
E ACTUAL: -2.0
E DESIRED: -2.33333
/var/tmp/portage/sci-libs/nipype-1.1.7/work/nipype-1.1.7/nipype/interfaces/tests/test_nilearn.py:169: AssertionError
____________ TestSignalExtraction.test_signal_extr_global_no_shared ____________
[gw6] linux -- Python 3.6.6 /usr/bin/python3.6
self = <nipype.interfaces.tests.test_nilearn.TestSignalExtraction object at 0x7fb3b1c865c0>
def test_signal_extr_global_no_shared(self):
# set up
wanted_global = [[-4. / 6], [-1. / 6], [3. / 6], [-1. / 6], [-7. / 6]]
for i, vals in enumerate(self.base_wanted):
wanted_global[i].extend(vals)
# run
iface.SignalExtraction(
in_file=self.filenames['in_file'],
label_files=self.filenames['label_files'],
class_labels=self.labels,
include_global=True,
incl_shared_variance=False).run()
# assert
> self.assert_expected_output(self.global_labels, wanted_global)
/var/tmp/portage/sci-libs/nipype-1.1.7/work/nipype-1.1.7/nipype/interfaces/tests/test_nilearn.py:89:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <nipype.interfaces.tests.test_nilearn.TestSignalExtraction object at 0x7fb3b1c865c0>
labels = ['GlobalSignal', 'CSF', 'GrayMatter', 'WhiteMatter']
wanted = [[-0.6666666666666666, -2.33333, 2, 0.5], [-0.16666666666666666, 0, -2, 0.5], [0.5, -0.3333333, -1, 2.5], [-0.16666666666666666, 0, -2, 0.5], [-1.1666666666666667, -1.3333333, -5, 1]]
def assert_expected_output(self, labels, wanted):
with open(self.filenames['out_file'], 'r') as output:
got = [line.split() for line in output]
labels_got = got.pop(0) # remove header
assert labels_got == labels
assert len(got) == self.fake_fmri_data.shape[
3], 'num rows and num volumes'
# convert from string to float
got = [[float(num) for num in row] for row in got]
for i, time in enumerate(got):
assert len(labels) == len(time)
for j, segment in enumerate(time):
> npt.assert_almost_equal(segment, wanted[i][j], decimal=1)
E AssertionError:
E Arrays are not almost equal to 1 decimals
E ACTUAL: 0.0
E DESIRED: -0.6666666666666666
/var/tmp/portage/sci-libs/nipype-1.1.7/work/nipype-1.1.7/nipype/interfaces/tests/test_nilearn.py:169: AssertionError
__________ TestSignalExtraction.test_signal_extr_4d_global_no_shared ___________
[gw6] linux -- Python 3.6.6 /usr/bin/python3.6
self = <nipype.interfaces.tests.test_nilearn.TestSignalExtraction object at 0x7fb3cc51eeb8>
def test_signal_extr_4d_global_no_shared(self):
# set up
wanted_global = [[3. / 8], [-3. / 8], [1. / 8], [-7. / 8], [-9. / 8]]
for i, vals in enumerate(self.fourd_wanted):
wanted_global[i].extend(vals)
# run & assert
self._test_4d_label(
wanted_global,
self.fake_4d_label_data,
include_global=True,
> incl_shared_variance=False)
/var/tmp/portage/sci-libs/nipype-1.1.7/work/nipype-1.1.7/nipype/interfaces/tests/test_nilearn.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/var/tmp/portage/sci-libs/nipype-1.1.7/work/nipype-1.1.7/nipype/interfaces/tests/test_nilearn.py:155: in _test_4d_label
self.assert_expected_output(wanted_labels, wanted)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <nipype.interfaces.tests.test_nilearn.TestSignalExtraction object at 0x7fb3cc51eeb8>
labels = ['GlobalSignal', 'CSF', 'GrayMatter', 'WhiteMatter']
wanted = [[0.375, -5.0652173913, -5.44565217391, 5.50543478261], [-0.375, -7.02173913043, 11.1847826087, -4.33152173913], [0.12...17, 21.2391304348, -4.57608695652], [-0.875, 5.19565217391, -3.66304347826, -1.51630434783], [-1.125, -12.0, 3.0, 0.5]]
def assert_expected_output(self, labels, wanted):
with open(self.filenames['out_file'], 'r') as output:
got = [line.split() for line in output]
labels_got = got.pop(0) # remove header
assert labels_got == labels
assert len(got) == self.fake_fmri_data.shape[
3], 'num rows and num volumes'
# convert from string to float
got = [[float(num) for num in row] for row in got]
for i, time in enumerate(got):
assert len(labels) == len(time)
for j, segment in enumerate(time):
> npt.assert_almost_equal(segment, wanted[i][j], decimal=1)
E AssertionError:
E Arrays are not almost equal to 1 decimals
E ACTUAL: 0.0
E DESIRED: 0.375
Platform details:
{'commit_hash': '%h',
'commit_source': 'archive substitution',
'networkx_version': '2.1',
'nibabel_version': '2.3.0',
'nipype_version': '1.1.7',
'numpy_version': '1.14.5',
'pkg_path': '/usr/lib64/python3.6/site-packages/nipype',
'scipy_version': '1.1.0',
'sys_executable': '/usr/lib/python-exec/python3.6/python',
'sys_platform': 'linux',
'sys_version': '3.6.6 (default, Oct 23 2018, 00:30:15) \n[GCC 7.3.0]',
'traits_version': '4.6.0'}
First level dep versions
* dependency graph for sci-libs/nipype-1.1.7
`-- sci-libs/nipype-1.1.7 ~amd64
`-- dev-python/future-0.16.0-r1 (dev-python/future) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/numpy-1.14.5 (dev-python/numpy) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/prov-1.5.0 (~dev-python/prov-1.5.0) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/setuptools-40.6.3 (dev-python/setuptools) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- sci-libs/nibabel-2.3.0 (sci-libs/nibabel) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/mock-2.0.0 (dev-python/mock) amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/pytest-4.0.2 (dev-python/pytest) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/pytest-cov-2.5.1-r2 (dev-python/pytest-cov) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/pytest-xdist-1.23.2 (dev-python/pytest-xdist) amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/configparser-3.5.0-r1 (dev-python/configparser) amd64 [python_targets_python2_7(-)? -python_single_target_python2_7(-)]
`-- dev-python/click-7.0 (>=dev-python/click-6.6) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/networkx-2.1 (dev-python/networkx) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/packaging-18.0 (dev-python/packaging) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/pydot-1.2.3 (dev-python/pydot) amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/pydotplus-2.0.2 (dev-python/pydotplus) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/pygraphviz-1.3.1 (dev-python/pygraphviz) amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/python-dateutil-2.7.5 (dev-python/python-dateutil) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/simplejson-3.16.0 (dev-python/simplejson) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-python/traits-4.6.0 (dev-python/traits) amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- sci-libs/scipy-1.1.0 (sci-libs/scipy) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- virtual/python-funcsigs-1 (virtual/python-funcsigs) amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
`-- dev-lang/python-2.7.15 (>=dev-lang/python-2.7.5-r2) amd64 [threads(+) sqlite]
`-- dev-lang/python-3.4.8-r1 (dev-lang/python) ~amd64 [threads(+) sqlite]
`-- dev-lang/python-3.5.5-r1 (dev-lang/python) ~amd64 [threads(+) sqlite]
`-- dev-lang/python-3.6.6 (dev-lang/python) ~amd64 [threads(+) sqlite]
`-- dev-lang/python-exec-2.4.6 (>=dev-lang/python-exec-2) ~amd64 [python_targets_python2_7(-)? python_targets_python3_4(-)? python_targets_python3_5(-)? python_targets_python3_6(-)? -python_single_target_python2_7(-) -python_single_target_python3_4(-) -python_single_target_python3_5(-) -python_single_target_python3_6(-)]
[ sci-libs/nipype-1.1.7 stats: packages (27), max depth (1) ]
Execution environment
Choose one
- My python environment outside container.
Metadata
Metadata
Assignees
Labels
No labels