Skip to content

Commit 3613214

Browse files
committed
tests.py enhancement
1 parent 493db61 commit 3613214

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

python/mia_processes_3.0/tests.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,25 @@ class Smooth(Process):
3434
default_factory=lambda: [6., 6., 6.],
3535
doc='fwhm description')
3636

37-
data_type: int = field(default_factory=lambda: 0,
38-
optional=True,
37+
data_type: int = field(optional=True,
38+
#default_factory=lambda: 0,
39+
# we prefer default for immutable and default factury for mutable
40+
default=0,
3941
doc='data_type')
4042

4143
implicit_masking: bool = field(optional=True,
42-
default_factory=lambda: False,
44+
#default_factory=lambda: False,
45+
default=True,
4346
doc='implicit_masking description')
4447

4548
out_prefix: str = field(optional=True,
46-
default_factory=lambda: 's',
49+
#default_factory=lambda: 's',
50+
default='s',
4751
doc='out_prefix description')
4852

4953

5054
output_directory: Directory = field(optional=False,
55+
write=True,
5156
userlevel=1,
5257
#default_factory=lambda: 's',
5358
#doc='out_prefix description')
@@ -59,9 +64,6 @@ class Smooth(Process):
5964
#et devrait etre rempli a la fin de execute() parce que la il n'est pas
6065
#du tout utilise
6166

62-
capsul = Capsul()
63-
process = capsul.executable('nipype.interfaces.spm.preprocess.Smooth')
64-
6567
def execute(self, context):
6668
# with open(self.input) as f:
6769
# content = f.read()
@@ -74,6 +76,10 @@ def execute(self, context):
7476
# print('self.data_type: ', self.data_type)
7577
# print('self.implicit_masking: ', self.implicit_masking)
7678
# print('self.out_prefix: ', self.out_prefix)
79+
80+
capsul = Capsul()
81+
self.process = capsul.executable('nipype.interfaces.spm.preprocess.Smooth')
82+
7783
self.process.in_files = self.in_files
7884
self.process.fwhm= self.fwhm
7985
self.process.data_type = self.data_type
@@ -117,6 +123,7 @@ def execute(self, context):
117123

118124
smooth.in_files = ['/home/econdami/Desktop/Data_tests_capsulV3/raw/alej170316-IRM_Fonct._+_perfusion-2016-03-17_08-34-44-1-T1_3D_SENSE-T1TFE-00-04-25.000.nii']
119125
smooth.output_directory = '/home/econdami/Desktop/Data_tests_capsulV3/derived'
126+
smooth.out_prefix = 'toto_'
120127

121128

122129
#c.engine().config.local ###### pas bon

0 commit comments

Comments
 (0)