From 9c74a67809f3b4abdf790573fcae15c9a6e5c92b Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 1 Nov 2013 09:14:17 -0400 Subject: [PATCH] ref: FILMGLS needs its own test because of api changes in FSL 5.0.5 --- nipype/interfaces/fsl/tests/test_FILMGLS.py | 51 ++++++++++++ .../interfaces/fsl/tests/test_auto_FILMGLS.py | 77 ------------------- 2 files changed, 51 insertions(+), 77 deletions(-) create mode 100644 nipype/interfaces/fsl/tests/test_FILMGLS.py delete mode 100644 nipype/interfaces/fsl/tests/test_auto_FILMGLS.py diff --git a/nipype/interfaces/fsl/tests/test_FILMGLS.py b/nipype/interfaces/fsl/tests/test_FILMGLS.py new file mode 100644 index 0000000000..ef194d8b80 --- /dev/null +++ b/nipype/interfaces/fsl/tests/test_FILMGLS.py @@ -0,0 +1,51 @@ +def test_filmgls(): + input_map = dict(args = dict(argstr='%s',), + autocorr_estimate_only = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='-ac',), + autocorr_noestimate = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='-noest',), + brightness_threshold = dict(argstr='-epith %d',), + design_file = dict(argstr='%s',), + environ = dict(usedefault=True,), + fit_armodel = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='-ar',), + full_data = dict(argstr='-v',), + ignore_exception = dict(usedefault=True,), + in_file = dict(mandatory=True,argstr='%s',), + mask_size = dict(argstr='-ms %d',), + multitaper_product = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='-mt %d',), + output_pwdata = dict(argstr='-output_pwdata',), + output_type = dict(), + results_dir = dict(usedefault=True,argstr='-rn %s',), + smooth_autocorr = dict(argstr='-sa',), + threshold = dict(argstr='%f',), + tukey_window = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='-tukey %d',), + use_pava = dict(argstr='-pava',), + ) + input_map2 = dict(args = dict(argstr='%s',), + autocorr_estimate_only = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='--ac',), + autocorr_noestimate = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='--noest',), + brightness_threshold = dict(argstr='--epith=%d',), + design_file = dict(argstr='--pd=%s',), + environ = dict(usedefault=True,), + fit_armodel = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='--ar',), + full_data = dict(argstr='-v',), + ignore_exception = dict(usedefault=True,), + in_file = dict(mandatory=True,argstr='--in=%s',), + mask_size = dict(argstr='--ms=%d',), + multitaper_product = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='--mt=%d',), + output_pwdata = dict(argstr='--outputPWdata',), + output_type = dict(), + results_dir = dict(argstr='--rn=%s',usedefault=True,), + smooth_autocorr = dict(argstr='--sa',), + terminal_output = dict(mandatory=True,), + threshold = dict(usedefault=True,argstr='--thr=%f',), + tukey_window = dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'],argstr='--tukey=%d',), + use_pava = dict(argstr='--pava',), + ) + instance = fsl.FILMGLS() + if isinstance(instance.inputs, fsl.FILMGLSInputSpec): + for key, metadata in input_map.items(): + for metakey, value in metadata.items(): + yield assert_equal, getattr(instance.inputs.traits()[key], metakey), value + else: + for key, metadata in input_map2.items(): + for metakey, value in metadata.items(): + yield assert_equal, getattr(instance.inputs.traits()[key], metakey), value diff --git a/nipype/interfaces/fsl/tests/test_auto_FILMGLS.py b/nipype/interfaces/fsl/tests/test_auto_FILMGLS.py deleted file mode 100644 index 18b23a33b1..0000000000 --- a/nipype/interfaces/fsl/tests/test_auto_FILMGLS.py +++ /dev/null @@ -1,77 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from nipype.testing import assert_equal -from nipype.interfaces.fsl.model import FILMGLS -def test_FILMGLS_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - output_pwdata=dict(argstr='--outputPWdata', - ), - fit_armodel=dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'], - argstr='--ar', - ), - smooth_autocorr=dict(argstr='--sa', - ), - results_dir=dict(argstr='--rn=%s', - usedefault=True, - ), - args=dict(argstr='%s', - ), - design_file=dict(position=-2, - argstr='--pd=%s', - ), - brightness_threshold=dict(argstr='--epith=%d', - ), - mask_size=dict(argstr='--ms=%d', - ), - tukey_window=dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'], - argstr='--tukey=%d', - ), - terminal_output=dict(mandatory=True, - nohash=True, - ), - environ=dict(nohash=True, - usedefault=True, - ), - multitaper_product=dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'], - argstr='--mt=%d', - ), - autocorr_estimate_only=dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'], - argstr='--ac', - ), - threshold=dict(usedefault=True, - position=-1, - argstr='--thr=%f', - ), - output_type=dict(), - autocorr_noestimate=dict(xor=['autocorr_estimate_only', 'fit_armodel', 'tukey_window', 'multitaper_product', 'use_pava', 'autocorr_noestimate'], - argstr='--noest', - ), - full_data=dict(argstr='-v', - ), - use_pava=dict(argstr='--pava', - ), - in_file=dict(position=-3, - mandatory=True, - argstr='--in=%s', - ), - ) - inputs = FILMGLS.input_spec() - - for key, metadata in input_map.items(): - for metakey, value in metadata.items(): - yield assert_equal, getattr(inputs.traits()[key], metakey), value -def test_FILMGLS_outputs(): - output_map = dict(corrections=dict(), - results_dir=dict(), - param_estimates=dict(), - dof_file=dict(), - logfile=dict(), - sigmasquareds=dict(), - residual4d=dict(), - ) - outputs = FILMGLS.output_spec() - - for key, metadata in output_map.items(): - for metakey, value in metadata.items(): - yield assert_equal, getattr(outputs.traits()[key], metakey), value