From 0b2ed9d2dd73091ba0b18c9c81815b6717fcbfc6 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Sun, 17 Mar 2024 17:54:24 +1100 Subject: [PATCH 1/3] fixed up identification of fileformats from unittests --- .../task/nipype/afni/afn_ito_nifti.yaml | 2 +- example-specs/task/nipype/afni/cat.yaml | 4 +- .../task/nipype/afni/cat_matvec.yaml | 2 +- .../task/nipype/afni/center_mass.yaml | 2 +- .../task/nipype/afni/deconvolve.yaml | 2 +- example-specs/task/nipype/afni/dot.yaml | 2 +- example-specs/task/nipype/afni/eval.yaml | 6 +- example-specs/task/nipype/afni/fim.yaml | 2 +- .../task/nipype/afni/one_d_tool_py.yaml | 6 +- example-specs/task/nipype/afni/qwarp.yaml | 6 +- .../task/nipype/afni/qwarp_plus_minus.yaml | 2 +- example-specs/task/nipype/afni/remlfit.yaml | 2 +- example-specs/task/nipype/afni/retroicor.yaml | 4 +- .../task/nipype/afni/synthesize.yaml | 2 +- example-specs/task/nipype/afni/t_corr_1d.yaml | 2 +- .../task/nipype/afni/t_corr_map.yaml | 2 +- example-specs/task/nipype/afni/volreg.yaml | 4 +- .../task/nipype/freesurfer/paint.yaml | 2 +- .../nipype/freesurfer/robust_template.yaml | 438 +++++++++--------- nipype2pydra/pkg_gen/__init__.py | 45 +- 20 files changed, 276 insertions(+), 261 deletions(-) diff --git a/example-specs/task/nipype/afni/afn_ito_nifti.yaml b/example-specs/task/nipype/afni/afn_ito_nifti.yaml index 37cce29d..fe003269 100644 --- a/example-specs/task/nipype/afni/afn_ito_nifti.yaml +++ b/example-specs/task/nipype/afni/afn_ito_nifti.yaml @@ -36,7 +36,7 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - in_file: medimage-afni/threed + in_file: medimage-afni/three-d # type=file|default=: input file to 3dAFNItoNIFTI out_file: Path # type=file: output file diff --git a/example-specs/task/nipype/afni/cat.yaml b/example-specs/task/nipype/afni/cat.yaml index c59ee780..31eb9a2a 100644 --- a/example-specs/task/nipype/afni/cat.yaml +++ b/example-specs/task/nipype/afni/cat.yaml @@ -38,7 +38,7 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - in_files: medimage-afni/oned+list-of + in_files: medimage-afni/one-d+list-of # type=list|default=[]: out_file: Path # type=file: output file @@ -59,7 +59,7 @@ outputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - out_file: medimage-afni/oned + out_file: medimage-afni/one-d # type=file: output file # type=file|default='catout.1d': output (concatenated) file name callables: diff --git a/example-specs/task/nipype/afni/cat_matvec.yaml b/example-specs/task/nipype/afni/cat_matvec.yaml index 678b5673..d9ad9fb9 100644 --- a/example-specs/task/nipype/afni/cat_matvec.yaml +++ b/example-specs/task/nipype/afni/cat_matvec.yaml @@ -54,7 +54,7 @@ outputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - out_file: medimage-afni/oned + out_file: medimage-afni/one-d # type=file: output file # type=file|default=: File to write concattenated matvecs to callables: diff --git a/example-specs/task/nipype/afni/center_mass.yaml b/example-specs/task/nipype/afni/center_mass.yaml index 4a4cb0b6..35e82749 100644 --- a/example-specs/task/nipype/afni/center_mass.yaml +++ b/example-specs/task/nipype/afni/center_mass.yaml @@ -91,7 +91,7 @@ tests: automask: # type=bool|default=False: Generate the mask automatically set_cm: - # type=tuple|default=(, , ): After computing the center of mass, set the origin fields in the header so that the center of mass will be at (x,y,z) in DICOM coords. + # type=tuple|default=(, , ): After computing the center of mass, set the origin fields in the header so that the center of mass will be at (x,y,z) in DICOM coords. local_ijk: # type=bool|default=False: Output values as (i,j,k) in local orientation roi_vals: diff --git a/example-specs/task/nipype/afni/deconvolve.yaml b/example-specs/task/nipype/afni/deconvolve.yaml index 97d640a0..b30709b9 100644 --- a/example-specs/task/nipype/afni/deconvolve.yaml +++ b/example-specs/task/nipype/afni/deconvolve.yaml @@ -81,7 +81,7 @@ outputs: # type=file|default=: output statistics file reml_script: generic/file # type=file: automatically generated script to run 3dREMLfit - x1D: medimage-afni/oned + x1D: medimage-afni/one-d # type=file: save out X matrix # type=file|default=: specify name for saved X matrix callables: diff --git a/example-specs/task/nipype/afni/dot.yaml b/example-specs/task/nipype/afni/dot.yaml index aed68950..25211895 100644 --- a/example-specs/task/nipype/afni/dot.yaml +++ b/example-specs/task/nipype/afni/dot.yaml @@ -85,7 +85,7 @@ tests: mask: # type=file|default=: Use this dataset as a mask mrange: - # type=tuple|default=(, ): Means to further restrict the voxels from 'mset' so thatonly those mask values within this range (inclusive) willbe used. + # type=tuple|default=(, ): Means to further restrict the voxels from 'mset' so thatonly those mask values within this range (inclusive) willbe used. demean: # type=bool|default=False: Remove the mean from each volume prior to computing the correlation docor: diff --git a/example-specs/task/nipype/afni/eval.yaml b/example-specs/task/nipype/afni/eval.yaml index 98089057..2396f10e 100644 --- a/example-specs/task/nipype/afni/eval.yaml +++ b/example-specs/task/nipype/afni/eval.yaml @@ -39,9 +39,9 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - in_file_a: medimage-afni/oned + in_file_a: medimage-afni/one-d # type=file|default=: input file to 1deval - in_file_b: medimage-afni/oned + in_file_b: medimage-afni/one-d # type=file|default=: operand file to 1deval in_file_c: generic/file # type=file|default=: operand file to 1deval @@ -66,7 +66,7 @@ outputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - out_file: medimage-afni/oned + out_file: medimage-afni/one-d # type=file: output file # type=file|default=: output image file name callables: diff --git a/example-specs/task/nipype/afni/fim.yaml b/example-specs/task/nipype/afni/fim.yaml index a483114b..53c43538 100644 --- a/example-specs/task/nipype/afni/fim.yaml +++ b/example-specs/task/nipype/afni/fim.yaml @@ -39,7 +39,7 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - ideal_file: medimage-afni/oned + ideal_file: medimage-afni/one-d # type=file|default=: ideal time series file name in_file: medimage/nifti1 # type=file|default=: input file to 3dfim+ diff --git a/example-specs/task/nipype/afni/one_d_tool_py.yaml b/example-specs/task/nipype/afni/one_d_tool_py.yaml index c29ab55c..d7ae5324 100644 --- a/example-specs/task/nipype/afni/one_d_tool_py.yaml +++ b/example-specs/task/nipype/afni/one_d_tool_py.yaml @@ -31,7 +31,7 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - in_file: medimage-afni/oned + in_file: medimage-afni/one-d # type=file|default=: input file to OneDTool out_file: Path # type=file: output of 1D_tool.py @@ -54,7 +54,7 @@ outputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - out_file: medimage-afni/oned + out_file: medimage-afni/one-d # type=file: output of 1D_tool.py # type=file|default=: write the current 1D data to FILE callables: @@ -82,7 +82,7 @@ tests: show_censor_count: # type=bool|default=False: display the total number of censored TRs Note : if input is a valid xmat.1D dataset, then the count will come from the header. Otherwise the input is assumed to be a binary censorfile, and zeros are simply counted. censor_motion: - # type=tuple|default=(, ): Tuple of motion limit and outfile prefix. need to also set set_nruns -r set_run_lengths + # type=tuple|default=(, ): Tuple of motion limit and outfile prefix. need to also set set_nruns -r set_run_lengths censor_prev_TR: # type=bool|default=False: for each censored TR, also censor previous show_trs_uncensored: diff --git a/example-specs/task/nipype/afni/qwarp.yaml b/example-specs/task/nipype/afni/qwarp.yaml index 5106cb0b..f04d886b 100644 --- a/example-specs/task/nipype/afni/qwarp.yaml +++ b/example-specs/task/nipype/afni/qwarp.yaml @@ -109,13 +109,13 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - base_file: medimage/nifti1 + base_file: medimage/nifti1,medimage/nifti-gz # type=file|default=: Base image (opposite phase encoding direction than source image). emask: generic/file # type=file|default=: Here, 'ee' is a dataset to specify a mask of voxelsto EXCLUDE from the analysis -- all voxels in 'ee'that are NONZERO will not be used in the alignment.The base image always automasked -- the emask isextra, to indicate voxels you definitely DON'T wantincluded in the matching process, even if they areinside the brain. gridlist: generic/file # type=file|default=: This option provides an alternate way to specify the patch grid sizes used in the warp optimization process. 'gl' is a 1D file with a list of patches to use -- in most cases, you will want to use it in the following form: ``-gridlist '1D: 0 151 101 75 51'`` * Here, a 0 patch size means the global domain. Patch sizes otherwise should be odd integers >= 5. * If you use the '0' patch size again after the first position, you will actually get an iteration at the size of the default patch level 1, where the patch sizes are 75% of the volume dimension. There is no way to force the program to literally repeat the sui generis step of lev=0. - in_file: medimage/nifti1 + in_file: medimage/nifti1,medimage/nifti-gz # type=file|default=: Source image (opposite phase encoding direction than base image). iniwarp: medimage-afni/head+list-of # type=list|default=[]: A dataset with an initial nonlinear warp to use. * If this option is not used, the initial warp is the identity. * You can specify a catenation of warps (in quotes) here, as in program 3dNwarpApply. * As a special case, if you just input an affine matrix in a .1D file, that will work also -- it is treated as giving the initial warp via the string "IDENT(base_dataset) matrix_file.aff12.1D". * You CANNOT use this option with -duplo !! * -iniwarp is usually used with -inilev to re-start 3dQwarp from a previous stopping point. @@ -193,7 +193,7 @@ tests: wball: # type=list|default=[]: "``-wball x y z r f`` Enhance automatic weight from '-useweight' by a factor of 1+f\*Gaussian(FWHM=r) centered in the base image at DICOM coordinates (x,y,z) and with radius 'r'. The goal of this option is to try and make the alignment better in a specific part of the brain. Example: -wball 0 14 6 30 40 to emphasize the thalamic area (in MNI/Talairach space). * The 'r' parameter must be positive! * The 'f' parameter must be between 1 and 100 (inclusive). * '-wball' does nothing if you input your own weight with the '-weight' option. * '-wball' does change the binary weight created by the '-noweight' option. * You can only use '-wball' once in a run of 3dQwarp. **The effect of '-wball' is not dramatic.** The example above makes the average brain image across a collection of subjects a little sharper in the thalamic area, which might have some small value. If you care enough about alignment to use '-wball', then you should examine the results from 3dQwarp for each subject, to see if the alignments are good enough for your purposes. wmask: - # type=tuple|default=(, ): Similar to '-wball', but here, you provide a dataset 'ws' that indicates where to increase the weight. * The 'ws' dataset must be on the same 3D grid as the base dataset. * 'ws' is treated as a mask -- it only matters where it is nonzero -- otherwise, the values inside are not used. * After 'ws' comes the factor 'f' by which to increase the automatically computed weight. Where 'ws' is nonzero, the weighting will be multiplied by (1+f). * As with '-wball', the factor 'f' should be between 1 and 100. + # type=tuple|default=(, ): Similar to '-wball', but here, you provide a dataset 'ws' that indicates where to increase the weight. * The 'ws' dataset must be on the same 3D grid as the base dataset. * 'ws' is treated as a mask -- it only matters where it is nonzero -- otherwise, the values inside are not used. * After 'ws' comes the factor 'f' by which to increase the automatically computed weight. Where 'ws' is nonzero, the weighting will be multiplied by (1+f). * As with '-wball', the factor 'f' should be between 1 and 100. out_weight_file: # type=file|default=: Write the weight volume to disk as a dataset blur: diff --git a/example-specs/task/nipype/afni/qwarp_plus_minus.yaml b/example-specs/task/nipype/afni/qwarp_plus_minus.yaml index 0014b8f0..f01c13cf 100644 --- a/example-specs/task/nipype/afni/qwarp_plus_minus.yaml +++ b/example-specs/task/nipype/afni/qwarp_plus_minus.yaml @@ -129,7 +129,7 @@ tests: wball: # type=list|default=[]: "``-wball x y z r f`` Enhance automatic weight from '-useweight' by a factor of 1+f\*Gaussian(FWHM=r) centered in the base image at DICOM coordinates (x,y,z) and with radius 'r'. The goal of this option is to try and make the alignment better in a specific part of the brain. Example: -wball 0 14 6 30 40 to emphasize the thalamic area (in MNI/Talairach space). * The 'r' parameter must be positive! * The 'f' parameter must be between 1 and 100 (inclusive). * '-wball' does nothing if you input your own weight with the '-weight' option. * '-wball' does change the binary weight created by the '-noweight' option. * You can only use '-wball' once in a run of 3dQwarp. **The effect of '-wball' is not dramatic.** The example above makes the average brain image across a collection of subjects a little sharper in the thalamic area, which might have some small value. If you care enough about alignment to use '-wball', then you should examine the results from 3dQwarp for each subject, to see if the alignments are good enough for your purposes. wmask: - # type=tuple|default=(, ): Similar to '-wball', but here, you provide a dataset 'ws' that indicates where to increase the weight. * The 'ws' dataset must be on the same 3D grid as the base dataset. * 'ws' is treated as a mask -- it only matters where it is nonzero -- otherwise, the values inside are not used. * After 'ws' comes the factor 'f' by which to increase the automatically computed weight. Where 'ws' is nonzero, the weighting will be multiplied by (1+f). * As with '-wball', the factor 'f' should be between 1 and 100. + # type=tuple|default=(, ): Similar to '-wball', but here, you provide a dataset 'ws' that indicates where to increase the weight. * The 'ws' dataset must be on the same 3D grid as the base dataset. * 'ws' is treated as a mask -- it only matters where it is nonzero -- otherwise, the values inside are not used. * After 'ws' comes the factor 'f' by which to increase the automatically computed weight. Where 'ws' is nonzero, the weighting will be multiplied by (1+f). * As with '-wball', the factor 'f' should be between 1 and 100. out_weight_file: # type=file|default=: Write the weight volume to disk as a dataset blur: diff --git a/example-specs/task/nipype/afni/remlfit.yaml b/example-specs/task/nipype/afni/remlfit.yaml index 4f00a7b3..64cc639b 100644 --- a/example-specs/task/nipype/afni/remlfit.yaml +++ b/example-specs/task/nipype/afni/remlfit.yaml @@ -60,7 +60,7 @@ inputs: # type=file|default=: filename of 3D mask dataset; only data time series from within the mask will be analyzed; results for voxels outside the mask will be set to zero. matim: generic/file # type=file|default=: read a standard file as the matrix. You can use only Col as a name in GLTs with these nonstandard matrix input methods, since the other names come from the 'matrix' file. These mutually exclusive options are ignored if 'matrix' is used. - matrix: medimage-afni/oned + matrix: medimage-afni/one-d # type=file|default=: the design matrix file, which should have been output from Deconvolve via the 'x1D' option obeta: Path # type=file: dataset for beta weights from the OLSQ estimation (if generated) diff --git a/example-specs/task/nipype/afni/retroicor.yaml b/example-specs/task/nipype/afni/retroicor.yaml index de9f2f1a..b724cc68 100644 --- a/example-specs/task/nipype/afni/retroicor.yaml +++ b/example-specs/task/nipype/afni/retroicor.yaml @@ -52,7 +52,7 @@ inputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - card: medimage-afni/oned + card: medimage-afni/one-d # type=file|default=: 1D cardiac data file for cardiac correction cardphase: generic/file # type=file|default=: Filename for 1D cardiac phase output @@ -61,7 +61,7 @@ inputs: out_file: Path # type=file: output file # type=file|default=: output image file name - resp: medimage-afni/oned + resp: medimage-afni/one-d # type=file|default=: 1D respiratory waveform data for correction respphase: generic/file # type=file|default=: Filename for 1D resp phase output diff --git a/example-specs/task/nipype/afni/synthesize.yaml b/example-specs/task/nipype/afni/synthesize.yaml index 874088d4..246cc1e0 100644 --- a/example-specs/task/nipype/afni/synthesize.yaml +++ b/example-specs/task/nipype/afni/synthesize.yaml @@ -40,7 +40,7 @@ inputs: # passed to the field in the automatically generated unittests. cbucket: medimage/nifti1 # type=file|default=: Read the dataset output from 3dDeconvolve via the '-cbucket' option. - matrix: medimage-afni/oned + matrix: medimage-afni/one-d # type=file|default=: Read the matrix output from 3dDeconvolve via the '-x1D' option. out_file: Path # type=file: output file diff --git a/example-specs/task/nipype/afni/t_corr_1d.yaml b/example-specs/task/nipype/afni/t_corr_1d.yaml index d173bc3d..1e91c8c8 100644 --- a/example-specs/task/nipype/afni/t_corr_1d.yaml +++ b/example-specs/task/nipype/afni/t_corr_1d.yaml @@ -39,7 +39,7 @@ inputs: # type=file|default=: output filename prefix xset: medimage/nifti1 # type=file|default=: 3d+time dataset input - y_1d: medimage-afni/oned + y_1d: medimage-afni/one-d # type=file|default=: 1D time series file input callable_defaults: # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` diff --git a/example-specs/task/nipype/afni/t_corr_map.yaml b/example-specs/task/nipype/afni/t_corr_map.yaml index 9f0b1508..65e3a897 100644 --- a/example-specs/task/nipype/afni/t_corr_map.yaml +++ b/example-specs/task/nipype/afni/t_corr_map.yaml @@ -164,7 +164,7 @@ tests: polort: # type=int|default=0: bandpass: - # type=tuple|default=(, ): + # type=tuple|default=(, ): regress_out_timeseries: # type=file|default=: blur_fwhm: diff --git a/example-specs/task/nipype/afni/volreg.yaml b/example-specs/task/nipype/afni/volreg.yaml index 8cab1e9f..bc003cc9 100644 --- a/example-specs/task/nipype/afni/volreg.yaml +++ b/example-specs/task/nipype/afni/volreg.yaml @@ -86,10 +86,10 @@ outputs: md1d_file: generic/file # type=file: max displacement info file # type=file|default=: max displacement output file - oned_file: medimage-afni/oned + oned_file: medimage-afni/one-d # type=file: movement parameters info file # type=file|default=: 1D movement parameters output file - oned_matrix_save: medimage-afni/oned + oned_matrix_save: medimage-afni/one-d # type=file: matrix transformation from base to input # type=file|default=: Save the matrix transformation out_file: medimage-afni/r1 diff --git a/example-specs/task/nipype/freesurfer/paint.yaml b/example-specs/task/nipype/freesurfer/paint.yaml index 13450840..37638240 100644 --- a/example-specs/task/nipype/freesurfer/paint.yaml +++ b/example-specs/task/nipype/freesurfer/paint.yaml @@ -62,7 +62,7 @@ outputs: # from the nipype interface, but you may want to be more specific, particularly # for file types, where specifying the format also specifies the file that will be # passed to the field in the automatically generated unittests. - out_file: medimage-freesurfer/avg_curv + out_file: generic/file # type=file: File containing a surface-worth of per-vertex values, saved in 'curvature' format. # type=file|default=: File containing a surface-worth of per-vertex values, saved in 'curvature' format. callables: diff --git a/example-specs/task/nipype/freesurfer/robust_template.yaml b/example-specs/task/nipype/freesurfer/robust_template.yaml index 14d42b67..55609f66 100644 --- a/example-specs/task/nipype/freesurfer/robust_template.yaml +++ b/example-specs/task/nipype/freesurfer/robust_template.yaml @@ -6,7 +6,7 @@ # Docs # ---- # construct an unbiased robust template for longitudinal volumes -# +# # Examples # -------- # >>> from nipype.interfaces.freesurfer import RobustTemplate @@ -23,26 +23,26 @@ # >>> template.inputs.out_file = 'T1.nii' # >>> template.cmdline #doctest: # 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template T1.nii --subsample 200' -# +# # >>> template.inputs.transform_outputs = ['structural.lta', # ... 'functional.lta'] # >>> template.inputs.scaled_intensity_outputs = ['structural-iscale.txt', # ... 'functional-iscale.txt'] # >>> template.cmdline #doctest: +ELLIPSIS # 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template T1.nii --iscaleout .../structural-iscale.txt .../functional-iscale.txt --subsample 200 --lta .../structural.lta .../functional.lta' -# +# # >>> template.inputs.transform_outputs = True # >>> template.inputs.scaled_intensity_outputs = True # >>> template.cmdline #doctest: +ELLIPSIS # 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template T1.nii --iscaleout .../is1.txt .../is2.txt --subsample 200 --lta .../tp1.lta .../tp2.lta' -# +# # >>> template.run() #doctest: +SKIP -# +# # References # ---------- # [https://surfer.nmr.mgh.harvard.edu/fswiki/mri_robust_template] -# -# +# +# task_name: RobustTemplate nipype_name: RobustTemplate nipype_module: nipype.interfaces.freesurfer.longitudinal @@ -52,11 +52,11 @@ inputs: rename: # dict[str, str] - fields to rename in the Pydra interface types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # from the nipype interface, but you may want to be more specific, particularly - # for file types, where specifying the format also specifies the file that will be - # passed to the field in the automatically generated unittests. + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # from the nipype interface, but you may want to be more specific, particularly + # for file types, where specifying the format also specifies the file that will be + # passed to the field in the automatically generated unittests. in_files: medimage/nifti1+list-of # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template in_intensity_scales: generic/file+list-of @@ -79,11 +79,11 @@ outputs: rename: # dict[str, str] - fields to rename in the Pydra interface types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # from the nipype interface, but you may want to be more specific, particularly - # for file types, where specifying the format also specifies the file that will be - # passed to the field in the automatically generated unittests. + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # from the nipype interface, but you may want to be more specific, particularly + # for file types, where specifying the format also specifies the file that will be + # passed to the field in the automatically generated unittests. out_file: medimage/nifti1 # type=file: output template volume (final mean/median image) # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) @@ -101,206 +101,206 @@ outputs: requirements: # dict[str, list[str]] - input fields that are required to be provided for the output field to be present tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - in_files: - # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template - out_file: - # type=file: output template volume (final mean/median image) - # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) - auto_detect_sensitivity: - # type=bool|default=False: auto-detect good sensitivity (recommended for head or full brain scans) - outlier_sensitivity: - # type=float|default=0.0: set outlier sensitivity manually (e.g. "--sat 4.685" ). Higher values mean less sensitivity. - transform_outputs: - # type=outputmultiobject: output xform files from moving to template - # type=traitcompound|default=[None]: output xforms to template (for each input) - intensity_scaling: - # type=bool|default=False: allow also intensity scaling (default off) - scaled_intensity_outputs: - # type=outputmultiobject: output final intensity scales - # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) - subsample_threshold: - # type=int|default=0: subsample if dim > # on all axes (default no subs.) - average_metric: - # type=enum|default='median'|allowed['mean','median']: construct template from: 0 Mean, 1 Median (default) - initial_timepoint: - # type=int|default=0: use TP# for spacial init (default random), 0: no init - fixed_timepoint: - # type=bool|default=False: map everything to init TP# (init TP is not resampled) - no_iteration: - # type=bool|default=False: do not iterate, just create first template - initial_transforms: - # type=inputmultiobject|default=[]: use initial transforms (lta) on source - in_intensity_scales: - # type=inputmultiobject|default=[]: use initial intensity scales - num_threads: - # type=int|default=0: allows for specifying more threads - subjects_dir: - # type=directory|default=: subjects directory - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - in_files: - # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template - auto_detect_sensitivity: 'True' - # type=bool|default=False: auto-detect good sensitivity (recommended for head or full brain scans) - average_metric: '"mean"' - # type=enum|default='median'|allowed['mean','median']: construct template from: 0 Mean, 1 Median (default) - initial_timepoint: '1' - # type=int|default=0: use TP# for spacial init (default random), 0: no init - fixed_timepoint: 'True' - # type=bool|default=False: map everything to init TP# (init TP is not resampled) - no_iteration: 'True' - # type=bool|default=False: do not iterate, just create first template - subsample_threshold: '200' - # type=int|default=0: subsample if dim > # on all axes (default no subs.) - out_file: '"T1.nii"' - # type=file: output template volume (final mean/median image) - # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - transform_outputs: '["structural.lta","functional.lta"]' - # type=outputmultiobject: output xform files from moving to template - # type=traitcompound|default=[None]: output xforms to template (for each input) - scaled_intensity_outputs: '["structural-iscale.txt","functional-iscale.txt"]' - # type=outputmultiobject: output final intensity scales - # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - transform_outputs: 'True' - # type=outputmultiobject: output xform files from moving to template - # type=traitcompound|default=[None]: output xforms to template (for each input) - scaled_intensity_outputs: 'True' - # type=outputmultiobject: output final intensity scales - # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + in_files: + # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template + out_file: + # type=file: output template volume (final mean/median image) + # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) + auto_detect_sensitivity: + # type=bool|default=False: auto-detect good sensitivity (recommended for head or full brain scans) + outlier_sensitivity: + # type=float|default=0.0: set outlier sensitivity manually (e.g. "--sat 4.685" ). Higher values mean less sensitivity. + transform_outputs: + # type=outputmultiobject: output xform files from moving to template + # type=traitcompound|default=[None]: output xforms to template (for each input) + intensity_scaling: + # type=bool|default=False: allow also intensity scaling (default off) + scaled_intensity_outputs: + # type=outputmultiobject: output final intensity scales + # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) + subsample_threshold: + # type=int|default=0: subsample if dim > # on all axes (default no subs.) + average_metric: + # type=enum|default='median'|allowed['mean','median']: construct template from: 0 Mean, 1 Median (default) + initial_timepoint: + # type=int|default=0: use TP# for spacial init (default random), 0: no init + fixed_timepoint: + # type=bool|default=False: map everything to init TP# (init TP is not resampled) + no_iteration: + # type=bool|default=False: do not iterate, just create first template + initial_transforms: + # type=inputmultiobject|default=[]: use initial transforms (lta) on source + in_intensity_scales: + # type=inputmultiobject|default=[]: use initial intensity scales + num_threads: + # type=int|default=0: allows for specifying more threads + subjects_dir: + # type=directory|default=: subjects directory + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + in_files: + # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template + auto_detect_sensitivity: "True" + # type=bool|default=False: auto-detect good sensitivity (recommended for head or full brain scans) + average_metric: '"mean"' + # type=enum|default='median'|allowed['mean','median']: construct template from: 0 Mean, 1 Median (default) + initial_timepoint: "1" + # type=int|default=0: use TP# for spacial init (default random), 0: no init + fixed_timepoint: "True" + # type=bool|default=False: map everything to init TP# (init TP is not resampled) + no_iteration: "True" + # type=bool|default=False: do not iterate, just create first template + subsample_threshold: "200" + # type=int|default=0: subsample if dim > # on all axes (default no subs.) + out_file: '"T1.nii"' + # type=file: output template volume (final mean/median image) + # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + transform_outputs: '["structural.lta","functional.lta"]' + # type=outputmultiobject: output xform files from moving to template + # type=traitcompound|default=[None]: output xforms to template (for each input) + scaled_intensity_outputs: '["structural-iscale.txt","functional-iscale.txt"]' + # type=outputmultiobject: output final intensity scales + # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + transform_outputs: "True" + # type=outputmultiobject: output xform files from moving to template + # type=traitcompound|default=[None]: output xforms to template (for each input) + scaled_intensity_outputs: "True" + # type=outputmultiobject: output final intensity scales + # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file doctests: -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - in_files: - # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template - auto_detect_sensitivity: 'True' - # type=bool|default=False: auto-detect good sensitivity (recommended for head or full brain scans) - average_metric: '"mean"' - # type=enum|default='median'|allowed['mean','median']: construct template from: 0 Mean, 1 Median (default) - initial_timepoint: '1' - # type=int|default=0: use TP# for spacial init (default random), 0: no init - fixed_timepoint: 'True' - # type=bool|default=False: map everything to init TP# (init TP is not resampled) - no_iteration: 'True' - # type=bool|default=False: do not iterate, just create first template - subsample_threshold: '200' - # type=int|default=0: subsample if dim > # on all axes (default no subs.) - out_file: '"T1.nii"' - # type=file: output template volume (final mean/median image) - # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - transform_outputs: '["structural.lta","functional.lta"]' - # type=outputmultiobject: output xform files from moving to template - # type=traitcompound|default=[None]: output xforms to template (for each input) - scaled_intensity_outputs: '["structural-iscale.txt","functional-iscale.txt"]' - # type=outputmultiobject: output final intensity scales - # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - transform_outputs: 'True' - # type=outputmultiobject: output xform files from moving to template - # type=traitcompound|default=[None]: output xforms to template (for each input) - scaled_intensity_outputs: 'True' - # type=outputmultiobject: output final intensity scales - # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + in_files: + # type=inputmultiobject|default=[]: input movable volumes to be aligned to common mean/median template + auto_detect_sensitivity: "True" + # type=bool|default=False: auto-detect good sensitivity (recommended for head or full brain scans) + average_metric: '"mean"' + # type=enum|default='median'|allowed['mean','median']: construct template from: 0 Mean, 1 Median (default) + initial_timepoint: "1" + # type=int|default=0: use TP# for spacial init (default random), 0: no init + fixed_timepoint: "True" + # type=bool|default=False: map everything to init TP# (init TP is not resampled) + no_iteration: "True" + # type=bool|default=False: do not iterate, just create first template + subsample_threshold: "200" + # type=int|default=0: subsample if dim > # on all axes (default no subs.) + out_file: '"T1.nii"' + # type=file: output template volume (final mean/median image) + # type=file|default='mri_robust_template_out.mgz': output template volume (final mean/median image) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + transform_outputs: '["structural.lta","functional.lta"]' + # type=outputmultiobject: output xform files from moving to template + # type=traitcompound|default=[None]: output xforms to template (for each input) + scaled_intensity_outputs: '["structural-iscale.txt","functional-iscale.txt"]' + # type=outputmultiobject: output final intensity scales + # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + transform_outputs: "True" + # type=outputmultiobject: output xform files from moving to template + # type=traitcompound|default=[None]: output xforms to template (for each input) + scaled_intensity_outputs: "True" + # type=outputmultiobject: output final intensity scales + # type=traitcompound|default=[None]: final intensity scales (will activate --iscale) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype2pydra/pkg_gen/__init__.py b/nipype2pydra/pkg_gen/__init__.py index dfb411e0..eeeaba6e 100644 --- a/nipype2pydra/pkg_gen/__init__.py +++ b/nipype2pydra/pkg_gen/__init__.py @@ -47,27 +47,30 @@ def ext2format_name(ext: str) -> str: - return escape_leading_digits(ext[1:]).capitalize() + return escape_leading_digits(ext[1:]) def escape_leading_digits(name: str) -> str: for k, v in ESCAPE_DIGITS.items(): if name.startswith(k): - name = v + name[1:] - return name - return name + escaped_name = v + if len(name) > 1: + escaped_name += name[1].upper() + escaped_name += name[2:] + return escaped_name + return name.capitalize() ESCAPE_DIGITS = { - "1": "one", - "2": "two", - "3": "three", - "4": "four", - "5": "five", - "6": "six", - "7": "seven", - "8": "eight", - "9": "nine", + "1": "One", + "2": "Two", + "3": "Three", + "4": "Four", + "5": "Five", + "6": "Six", + "7": "Seven", + "8": "Eight", + "9": "Nine", } @@ -429,7 +432,11 @@ def guess_type(fspath): return File possible_formats = [] for frmt in fileformats.core.FileSet.all_formats: - if not frmt.ext or None in frmt.alternate_exts: + if ( + not frmt.ext + or None in frmt.alternate_exts + or "-" in frmt.namespace + ): continue if frmt.matching_exts(fspath): possible_formats.append(frmt) @@ -483,10 +490,18 @@ def combine_types(type_, prev_type): as_list = True type_ = ty.get_args(type_)[0] both_classes = inspect.isclass(type_) and inspect.isclass(prev_type) - if both_classes and issubclass(type_, prev_type): + if type_ == prev_type: + combined = type_ + elif both_classes and issubclass(type_, prev_type): combined = type_ elif both_classes and issubclass(prev_type, type_): combined = prev_type + elif ( + isinstance(type_, str) + and prev_type is File + and type_.startswith("fileformats.") + ): + combined = type_ else: if ty.get_origin(prev_type) is ty.Union: prev_types = ty.get_args(prev_type) From 2cedffaf096150eaa9c059ae3c10b65abb1471a1 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 18 Mar 2024 10:02:00 +1100 Subject: [PATCH 2/3] added version imports to fileformats packages --- nipype2pydra/pkg_gen/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nipype2pydra/pkg_gen/__init__.py b/nipype2pydra/pkg_gen/__init__.py index eeeaba6e..cf3d6e14 100644 --- a/nipype2pydra/pkg_gen/__init__.py +++ b/nipype2pydra/pkg_gen/__init__.py @@ -689,7 +689,7 @@ def copy_ignore(_, names): continue with open(fspath) as f: contents = f.read() - contents = re.sub(r"(? Date: Mon, 18 Mar 2024 10:17:26 +1100 Subject: [PATCH 3/3] added missing imports to autogenerated conftest --- nipype2pydra/task/base.py | 17 ++++++++++++++--- .../afni/fileformats/medimage_afni/__init__.py | 4 ++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/nipype2pydra/task/base.py b/nipype2pydra/task/base.py index a8aab4ad..736aff0a 100644 --- a/nipype2pydra/task/base.py +++ b/nipype2pydra/task/base.py @@ -157,6 +157,7 @@ class InputsConverter(SpecConverter): metadata: dict[str, dict[str, Any]], optional additional metadata to set on any of the input fields (e.g. out_file: position: 1) """ + callable_defaults: ty.Dict[str, str] = attrs.field( factory=dict, converter=default_if_none(factory=dict), # type: ignore @@ -403,7 +404,8 @@ class BaseTaskConverter(metaclass=ABCMeta): converter=from_dict_to_outputs, ) callables_module: ModuleType = attrs.field( - converter=import_module_from_path, default=None, + converter=import_module_from_path, + default=None, ) tests: ty.List[TestGenerator] = attrs.field( # type: ignore factory=list, converter=from_list_to_tests @@ -838,7 +840,9 @@ def write_tests(self, filename_test, input_fields, nonstd_types, run=False): else: assert len(field) == 3 # Attempt to pick a sensible value for field - trait = self.nipype_interface.input_spec.class_traits()[nm] + trait = self.nipype_interface.input_spec.class_traits()[ + nm + ] if isinstance(trait, traits.trait_types.Enum): value = trait.values[0] elif isinstance(trait, traits.trait_types.Range): @@ -868,7 +872,10 @@ def write_tests(self, filename_test, input_fields, nonstd_types, run=False): imports = self.construct_imports( nonstd_types, spec_str, - base={"import pytest", "from nipype2pydra.testing import PassAfterTimeoutWorker"}, + base={ + "import pytest", + "from nipype2pydra.testing import PassAfterTimeoutWorker", + }, ) spec_str = "\n".join(imports) + "\n\n" + spec_str @@ -946,6 +953,10 @@ def create_doctests(self, input_fields, nonstd_types): CONFTEST = """ # For debugging in IDE's don't catch raised exceptions and let the IDE # break at it +import os +import pytest + + if os.getenv("_PYTEST_RAISE", "0") != "0": @pytest.hookimpl(tryfirst=True) diff --git a/required-fileformats/afni/fileformats/medimage_afni/__init__.py b/required-fileformats/afni/fileformats/medimage_afni/__init__.py index c3c838d1..bce6551a 100644 --- a/required-fileformats/afni/fileformats/medimage_afni/__init__.py +++ b/required-fileformats/afni/fileformats/medimage_afni/__init__.py @@ -1,13 +1,13 @@ from fileformats.generic import File -class Oned(File): +class OneD(File): ext = ".1D" alternate_exts = (".1d",) binary = True -class Threed(File): +class ThreeD(File): ext = ".3D" binary = True