43
43
# Soma-base import
44
44
from soma .controller .trait_utils import relax_exists_constraint
45
45
from soma .utils .weak_proxy import get_ref
46
- from traits .trait_base import Undefined
47
46
48
47
# Populse_MIA imports
49
48
from populse_mia .data_manager .project import COLLECTION_CURRENT
@@ -208,7 +207,7 @@ def complete_attributes_with_database(self, process_inputs={}):
208
207
return attributes
209
208
210
209
@staticmethod
211
- def complete_nipype_common (process ):
210
+ def complete_nipype_common (process , output_dir = True ):
212
211
"""
213
212
Set Nipype parameters for SPM. This is used both on
214
213
:class:`NipypeProcess` and :class:`ProcessMIA` instances which have the
@@ -217,6 +216,8 @@ def complete_nipype_common(process):
217
216
Parameters
218
217
----------
219
218
process: a process
219
+ output_dir: a boolean. If False, the output_directory attribute value
220
+ is not initialised
220
221
221
222
"""
222
223
@@ -243,13 +244,20 @@ def complete_nipype_common(process):
243
244
process .project = project
244
245
245
246
# set output_directory
246
- if process .trait (
247
- "output_directory"
248
- ) and process .output_directory in (None , Undefined , "" ):
247
+ out_dir = None
248
+ if process .trait ("output_directory" ):
249
249
out_dir = os .path .abspath (
250
250
os .path .join (project .folder , "data" , "derived_data" )
251
251
)
252
252
253
+ else :
254
+ print (
255
+ "populse_mia.user_interface.pipeline_manager."
256
+ "MiaProcessCompletionEngine.complete_nipype_common:"
257
+ "\n - The output_directory trait does not exist!)"
258
+ )
259
+
260
+ if output_dir is True and out_dir is not None :
253
261
# ensure this output_directory exists since it is not
254
262
# actually an output but an input, and thus it is supposed
255
263
# to exist in Capsul.
@@ -511,7 +519,9 @@ def complete_parameters_mia(self, process_inputs={}):
511
519
print ("value:" , repr (value ))
512
520
traceback .print_exc ()
513
521
514
- MIAProcessCompletionEngine .complete_nipype_common (process )
522
+ MIAProcessCompletionEngine .complete_nipype_common (
523
+ process , output_dir = False
524
+ )
515
525
516
526
def get_attribute_values (self ):
517
527
"""Re-route to underlying fallback engine."""
0 commit comments