From 795e17167ab6ebc4b1681b08593097342b019a6b Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Thu, 9 Apr 2020 16:30:52 -0400 Subject: [PATCH 1/2] Run with Linear plugin when n_procs is None --- lyman/frontend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lyman/frontend.py b/lyman/frontend.py index e44fb36..a40acb8 100644 --- a/lyman/frontend.py +++ b/lyman/frontend.py @@ -447,7 +447,10 @@ def execute(wf, args, info): else: # TODO expose other nipype plugins as a command-line parameter - plugin, plugin_args = "MultiProc", {"n_procs": args.n_procs} + if args.n_procs == 1: + plugin, plugin_args = "Linear", {} + else: + plugin, plugin_args = "MultiProc", {"n_procs": args.n_procs} res = wf.run(plugin, plugin_args) # After successful completion of the workflow, optionally delete the From 7efb189abf094f48aff70cc5ea5e108cae6bf4d1 Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Thu, 9 Apr 2020 16:31:47 -0400 Subject: [PATCH 2/2] Define types for tuple input/output traits --- lyman/workflows/preproc.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lyman/workflows/preproc.py b/lyman/workflows/preproc.py index f1db023..70deed7 100644 --- a/lyman/workflows/preproc.py +++ b/lyman/workflows/preproc.py @@ -503,14 +503,14 @@ def write_time_series_gif(self, runtime, img, fname, title=None): class SessionInput(LymanInterface): class input_spec(TraitedSpec): - session = traits.Tuple() + session = traits.Tuple(traits.Str(), traits.Str()) data_dir = traits.Directory(exists=True) proc_dir = traits.Directory(exists=True) fm_template = traits.Str() phase_encoding = traits.Either("ap", "pa") class output_spec(TraitedSpec): - session_tuple = traits.Tuple() + session_tuple = traits.Tuple(traits.Str(), traits.Str()) subject = traits.Str() session = traits.Str() fm_file = traits.File(exists=True) @@ -596,7 +596,7 @@ def _run_interface(self, runtime): class RunInput(LymanInterface, TimeSeriesGIF): class input_spec(TraitedSpec): - run = traits.Tuple() + run = traits.Tuple(traits.Str(), traits.Str(), traits.Str()) data_dir = traits.Directory(exists=True) proc_dir = traits.Directory(exists=True) experiment = traits.Str() @@ -605,7 +605,7 @@ class input_spec(TraitedSpec): crop_frames = traits.Int(0, usedefault=True) class output_spec(TraitedSpec): - run_tuple = traits.Tuple() + run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str()) subject = traits.Str() session = traits.Str() run = traits.Str() @@ -725,7 +725,7 @@ class input_spec(TraitedSpec): warp_files = traits.List(traits.File(exists=True)) jacobian_files = traits.List(traits.File(Exists=True)) phase_encoding = traits.List(traits.Str) - session_tuple = traits.Tuple() + session_tuple = traits.Tuple(traits.Str(), traits.Str()) class output_spec(TraitedSpec): raw_file = traits.File(exists=True) @@ -896,7 +896,7 @@ class FinalizeTimeseries(LymanInterface, TimeSeriesGIF): class input_spec(TraitedSpec): experiment = traits.Str() - run_tuple = traits.Tuple() + run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str()) anat_file = traits.File(exists=True) in_files = traits.List(traits.File(exists=True)) seg_file = traits.File(exists=True) @@ -1038,7 +1038,7 @@ class FinalizeTemplate(LymanInterface): class input_spec(TraitedSpec): experiment = traits.Str() - session_tuple = traits.Tuple() + session_tuple = traits.Tuple(traits.Str(), traits.Str()) in_files = traits.List(traits.File(exists=True)) seg_file = traits.File(exists=True) anat_file = traits.File(exists=True) @@ -1170,7 +1170,7 @@ class RealignmentReport(LymanInterface): class input_spec(TraitedSpec): target_file = traits.File(exists=True) realign_params = traits.File(exists=True) - run_tuple = traits.Tuple() + run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str()) class output_spec(TraitedSpec): params_plot = traits.File(exists=True) @@ -1237,7 +1237,7 @@ class AnatRegReport(LymanInterface): class input_spec(TraitedSpec): subject_id = traits.Str() - session_tuple = traits.Tuple() + session_tuple = traits.Tuple(traits.Str(), traits.Str()) data_dir = traits.Directory(exists=True) in_file = traits.File(exists=True) cost_file = traits.File(exists=True) @@ -1279,7 +1279,7 @@ def _run_interface(self, runtime): class CoregGIF(LymanInterface): class input_spec(TraitedSpec): - run_tuple = traits.Tuple() + run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str()) in_file = traits.File(exists=True) ref_file = traits.File(exists=True) out_file = traits.File()