Skip to content

Commit ad3d440

Browse files
committed
testing pickling of variance_threshold
1 parent f390bc6 commit ad3d440

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

nipype/workflows/rsfmri/fsl/resting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
from __future__ import (print_function, division, unicode_literals,
55
absolute_import)
6-
from builtins import str
76

87
from ....interfaces import fsl as fsl # fsl
98
from ....interfaces import utility as util # utility

nipype/workflows/rsfmri/fsl/tests/test_resting.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def setup_class(self, tmpdir):
7878
def test_create_resting_preproc(self, mock_node, mock_realign_wf):
7979
wflow = create_resting_preproc(base_dir=os.getcwd())
8080

81-
wflow.inputs.inputspec.num_noise_components = self.num_noise_components
81+
# wflow.inputs.inputspec.num_noise_components = self.num_noise_components
82+
wflow.inputs.compcor.variance_threshold = 0.15
8283
mask_in = wflow.get_node('threshold').inputs
8384
mask_in.out_file = self.in_filenames['mask_file']
8485
func_in = wflow.get_node('slicetimer').inputs
@@ -89,16 +90,17 @@ def test_create_resting_preproc(self, mock_node, mock_realign_wf):
8990
# assert
9091
expected_file = os.path.abspath(self.out_filenames['components_file'])
9192
with open(expected_file, 'r') as components_file:
92-
components_data = [line.split() for line in components_file]
93-
num_got_components = len(components_data)
94-
assert (num_got_components == self.num_noise_components
95-
or num_got_components == self.fake_data.shape[3])
96-
first_two = [row[:2] for row in components_data[1:]]
97-
assert first_two == [['-0.5172356654', '-0.6973053243'], [
98-
'0.2574722644', '0.1645270737'
99-
], ['-0.0806469590',
100-
'0.5156853779'], ['0.7187176051', '-0.3235820287'],
101-
['-0.3783072450', '0.3406749013']]
93+
components_data = [line.split()
94+
for line in components_file.read().splitlines()]
95+
num_got_components = len(components_data)
96+
assert (num_got_components == self.num_noise_components or
97+
num_got_components == self.fake_data.shape[3])
98+
first_two = [row[:2] for row in components_data[1:]]
99+
assert first_two == [['-0.5172356654', '-0.6973053243'],
100+
['0.2574722644', '0.1645270737'],
101+
['-0.0806469590', '0.5156853779'],
102+
['0.7187176051', '-0.3235820287'],
103+
['-0.3783072450', '0.3406749013']]
102104

103105
fake_data = np.array([[[[2, 4, 3, 9, 1], [3, 6, 4, 7, 4]],
104106
[[8, 3, 4, 6, 2], [4, 0, 4, 4, 2]]],

0 commit comments

Comments
 (0)