Skip to content

debugging running tests #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c97e489
debugging running tests
tclose May 29, 2024
caee1bc
fixing defaults for function interfaces
tclose May 29, 2024
5e8da87
set mandatory to False when there is a valid default
tclose May 29, 2024
843a83a
added support for _format_arg and _parse_inputs methods
tclose May 31, 2024
07700f2
debugging reworked _list_outputs handling
tclose May 31, 2024
985ab46
handled super methods properly
tclose May 31, 2024
1bcc2ec
added callables to outputs
tclose Jun 1, 2024
68e09c7
touching up format_arg super handling
tclose Jun 1, 2024
b550966
handling special super methods
tclose Jun 1, 2024
28659bc
fixed handling of super methods, added supported for aggregate_output…
tclose Jun 1, 2024
1e92a40
debugged changes so that all packages build successfully again
tclose Jun 1, 2024
63a4077
finally got all packages to convert again!
tclose Jun 1, 2024
0aa80aa
debugging updates to conversions to handle function task super methods
tclose Jun 2, 2024
3591c7b
all packages build again after refactor
tclose Jun 2, 2024
23ebaa4
moved constants to bottom of file just in case they rely on a local f…
tclose Jun 2, 2024
dc3214f
disabled return dict unwrapping (used in _list_outputs) by default. A…
tclose Jun 3, 2024
0cac4cd
added option to explicitly route connections from/to explicit inputs …
tclose Jun 3, 2024
955e6c8
debugged workflows and spatial normalisation monster interface
tclose Jun 3, 2024
abf3551
unwrapped super methods in shell helper methods
tclose Jun 3, 2024
8c696fd
debugging mriqc/niworkflows conversions
tclose Jun 7, 2024
3d0e218
debugging switch to class-symbols
tclose Jul 5, 2024
596f5ff
debugging class symbol detection
tclose Jul 23, 2024
96274bf
converting to generate new syntax
tclose Apr 4, 2025
f5b078a
updated worker from serial to debug
tclose Apr 8, 2025
f49482e
updated locations in generated imports
tclose Apr 9, 2025
b952dde
removed stray reference to serial worker
tclose Apr 15, 2025
83f2bf6
updated to use get_fields instead of task_fields (old function name)
tclose May 13, 2025
8ddebc3
updated yaml specs
tclose May 29, 2025
8d723b8
commented out mriqc dep
tclose May 29, 2025
5992a20
debugging interface conversions
tclose May 29, 2025
78690fc
fixed up handling of union types
tclose Jun 1, 2025
ae60b07
Got python and shell interface conversions to work for new syntax
tclose Jun 22, 2025
a4c92ad
fixed up the inclusion of local functions and classes
tclose Jun 22, 2025
c4eae3b
dropped special "ported" module name from output dir clearance
tclose Jun 23, 2025
f0b03f2
debugging mriqc and qsmxt conversions
tclose Jun 26, 2025
6f36cf2
Merge pull request #24 from nipype/new-syntax
tclose Jul 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 20 additions & 27 deletions example-specs/interface/nipype/afni/a_boverlap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
# Docs
# ----
# Output (to screen) is a count of various things about how
# the automasks of datasets A and B overlap or don't overlap.
# the automasks of datasets A and B overlap or don't overlap.
#
# For complete details, see the `3dABoverlap Documentation.
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dABoverlap.html>`_
# For complete details, see the `3dABoverlap Documentation.
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dABoverlap.html>`_
#
# Examples
# --------
# >>> from nipype.interfaces import afni
# >>> aboverlap = afni.ABoverlap()
# >>> aboverlap.inputs.in_file_a = 'functional.nii'
# >>> aboverlap.inputs.in_file_b = 'structural.nii'
# >>> aboverlap.inputs.out_file = 'out.mask_ae_overlap.txt'
# >>> aboverlap.cmdline
# '3dABoverlap functional.nii structural.nii |& tee out.mask_ae_overlap.txt'
# >>> res = aboverlap.run() # doctest: +SKIP
#
# Examples
# --------
# >>> from nipype.interfaces import afni
# >>> aboverlap = afni.ABoverlap()
# >>> aboverlap.inputs.in_file_a = 'functional.nii'
# >>> aboverlap.inputs.in_file_b = 'structural.nii'
# >>> aboverlap.inputs.out_file = 'out.mask_ae_overlap.txt'
# >>> aboverlap.cmdline
# '3dABoverlap functional.nii structural.nii |& tee out.mask_ae_overlap.txt'
# >>> res = aboverlap.run() # doctest: +SKIP
#
#
task_name: ABoverlap
nipype_name: ABoverlap
nipype_module: nipype.interfaces.afni.utils
Expand All @@ -39,11 +39,8 @@ inputs:
# passed to the field in the automatically generated unittests.
in_file_a: medimage/nifti1
# type=file|default=<undefined>: input file A
in_file_b: medimage/nifti1
in_file_b: generic/file
# type=file|default=<undefined>: input file B
out_file: Path
# type=file: output file
# type=file|default=<undefined>: collect output to a file
callable_defaults:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set as the `default` method of input fields
Expand All @@ -67,7 +64,7 @@ outputs:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set to the `callable` attribute of output fields
templates:
# dict[str, str] - `output_file_template` values to be provided to output fields
# dict[str, str] - `path_template` values to be provided to output fields
requirements:
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
tests:
Expand Down Expand Up @@ -96,7 +93,7 @@ tests:
environ:
# type=dict|default={}: Environment variables
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Expand All @@ -115,13 +112,11 @@ tests:
# (if not specified, will try to choose a sensible value)
in_file_a:
# type=file|default=<undefined>: input file A
in_file_b:
# type=file|default=<undefined>: input file B
out_file: ' "out.mask_ae_overlap.txt"'
# type=file: output file
# type=file|default=<undefined>: collect output to a file
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Expand All @@ -136,21 +131,19 @@ tests:
# 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: 3dABoverlap functional.nii structural.nii |& tee out.mask_ae_overlap.txt
- 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_file_a: '"functional.nii"'
# type=file|default=<undefined>: input file A
in_file_b: '"structural.nii"'
# type=file|default=<undefined>: input file B
out_file: ' "out.mask_ae_overlap.txt"'
# type=file: output file
# type=file|default=<undefined>: collect output to a file
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
49 changes: 20 additions & 29 deletions example-specs/interface/nipype/afni/afn_ito_nifti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
# Docs
# ----
# Converts AFNI format files to NIFTI format. This can also convert 2D or
# 1D data, which you can numpy.squeeze() to remove extra dimensions.
# 1D data, which you can numpy.squeeze() to remove extra dimensions.
#
# For complete details, see the `3dAFNItoNIFTI Documentation.
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAFNItoNIFTI.html>`_
# For complete details, see the `3dAFNItoNIFTI Documentation.
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAFNItoNIFTI.html>`_
#
# Examples
# --------
# >>> from nipype.interfaces import afni
# >>> a2n = afni.AFNItoNIFTI()
# >>> a2n.inputs.in_file = 'afni_output.3D'
# >>> a2n.inputs.out_file = 'afni_output.nii'
# >>> a2n.cmdline
# '3dAFNItoNIFTI -prefix afni_output.nii afni_output.3D'
# >>> res = a2n.run() # doctest: +SKIP
#
# Examples
# --------
# >>> from nipype.interfaces import afni
# >>> a2n = afni.AFNItoNIFTI()
# >>> a2n.inputs.in_file = 'afni_output.3D'
# >>> a2n.inputs.out_file = 'afni_output.nii'
# >>> a2n.cmdline
# '3dAFNItoNIFTI -prefix afni_output.nii afni_output.3D'
# >>> res = a2n.run() # doctest: +SKIP
#
#
task_name: AFNItoNIFTI
nipype_name: AFNItoNIFTI
nipype_module: nipype.interfaces.afni.utils
Expand All @@ -36,11 +36,8 @@ 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/three-d
in_file: fileformats.medimage_afni.ThreeD
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
out_file: Path
# type=file: output file
# type=file|default=<undefined>: output image file name
callable_defaults:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set as the `default` method of input fields
Expand All @@ -57,14 +54,14 @@ 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/nifti1
out_file: generic/file
# type=file: output file
# type=file|default=<undefined>: output image file name
callables:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set to the `callable` attribute of output fields
templates:
# dict[str, str] - `output_file_template` values to be provided to output fields
# dict[str, str] - `path_template` values to be provided to output fields
requirements:
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
tests:
Expand Down Expand Up @@ -93,7 +90,7 @@ tests:
environ:
# type=dict|default={}: Environment variables
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Expand All @@ -112,11 +109,8 @@ tests:
# (if not specified, will try to choose a sensible value)
in_file:
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
out_file: ' "afni_output.nii"'
# type=file: output file
# type=file|default=<undefined>: output image file name
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Expand All @@ -131,19 +125,16 @@ tests:
# 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: 3dAFNItoNIFTI -prefix afni_output.nii afni_output.3D
- 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_file: '"afni_output.3D"'
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
out_file: ' "afni_output.nii"'
# type=file: output file
# type=file|default=<undefined>: output image file name
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
104 changes: 46 additions & 58 deletions example-specs/interface/nipype/afni/align_epi_anat_py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,55 @@
# ----
# Align EPI to anatomical datasets or vice versa.
#
# This Python script computes the alignment between two datasets, typically
# an EPI and an anatomical structural dataset, and applies the resulting
# transformation to one or the other to bring them into alignment.
# This Python script computes the alignment between two datasets, typically
# an EPI and an anatomical structural dataset, and applies the resulting
# transformation to one or the other to bring them into alignment.
#
# This script computes the transforms needed to align EPI and
# anatomical datasets using a cost function designed for this purpose. The
# script combines multiple transformations, thereby minimizing the amount of
# interpolation applied to the data.
# This script computes the transforms needed to align EPI and
# anatomical datasets using a cost function designed for this purpose. The
# script combines multiple transformations, thereby minimizing the amount of
# interpolation applied to the data.
#
# Basic Usage::
# Basic Usage::
#
# align_epi_anat.py -anat anat+orig -epi epi+orig -epi_base 5
# align_epi_anat.py -anat anat+orig -epi epi+orig -epi_base 5
#
# The user must provide :abbr:`EPI (echo-planar imaging)` and anatomical datasets
# and specify the EPI sub-brick to use as a base in the alignment.
# The user must provide :abbr:`EPI (echo-planar imaging)` and anatomical datasets
# and specify the EPI sub-brick to use as a base in the alignment.
#
# Internally, the script always aligns the anatomical to the EPI dataset,
# and the resulting transformation is saved to a 1D file.
# As a user option, the inverse of this transformation may be applied to the
# EPI dataset in order to align it to the anatomical data instead.
# Internally, the script always aligns the anatomical to the EPI dataset,
# and the resulting transformation is saved to a 1D file.
# As a user option, the inverse of this transformation may be applied to the
# EPI dataset in order to align it to the anatomical data instead.
#
# This program generates several kinds of output in the form of datasets
# and transformation matrices which can be applied to other datasets if
# needed. Time-series volume registration, oblique data transformations and
# Talairach (standard template) transformations will be combined as needed
# and requested (with options to turn on and off each of the steps) in
# order to create the aligned datasets.
# This program generates several kinds of output in the form of datasets
# and transformation matrices which can be applied to other datasets if
# needed. Time-series volume registration, oblique data transformations and
# Talairach (standard template) transformations will be combined as needed
# and requested (with options to turn on and off each of the steps) in
# order to create the aligned datasets.
#
# Examples
# --------
# >>> from nipype.interfaces import afni
# >>> al_ea = afni.AlignEpiAnatPy()
# >>> al_ea.inputs.anat = "structural.nii"
# >>> al_ea.inputs.in_file = "functional.nii"
# >>> al_ea.inputs.epi_base = 0
# >>> al_ea.inputs.epi_strip = '3dAutomask'
# >>> al_ea.inputs.volreg = 'off'
# >>> al_ea.inputs.tshift = 'off'
# >>> al_ea.inputs.save_skullstrip = True
# >>> al_ea.cmdline # doctest: +ELLIPSIS
# 'python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
# >>> res = allineate.run() # doctest: +SKIP
# Examples
# --------
# >>> from nipype.interfaces import afni
# >>> al_ea = afni.AlignEpiAnatPy()
# >>> al_ea.inputs.anat = "structural.nii"
# >>> al_ea.inputs.in_file = "functional.nii"
# >>> al_ea.inputs.epi_base = 0
# >>> al_ea.inputs.epi_strip = '3dAutomask'
# >>> al_ea.inputs.volreg = 'off'
# >>> al_ea.inputs.tshift = 'off'
# >>> al_ea.inputs.save_skullstrip = True
# >>> al_ea.cmdline # doctest: +ELLIPSIS
# 'python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
# >>> res = al_ea.run() # doctest: +SKIP
#
# See Also
# --------
# For complete details, see the `align_epi_anat.py documentation.
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/align_epi_anat.py.html>`__.
#
# See Also
# --------
# For complete details, see the `align_epi_anat.py documentation.
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/align_epi_anat.py.html>`__.
#
#
task_name: AlignEpiAnatPy
nipype_name: AlignEpiAnatPy
nipype_module: nipype.interfaces.afni.preprocess
Expand All @@ -72,7 +72,7 @@ inputs:
# passed to the field in the automatically generated unittests.
anat: medimage/nifti1
# type=file|default=<undefined>: name of structural dataset
in_file: medimage/nifti1
in_file: generic/file
# type=file|default=<undefined>: EPI dataset to align
callable_defaults:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
Expand Down Expand Up @@ -114,7 +114,7 @@ outputs:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set to the `callable` attribute of output fields
templates:
# dict[str, str] - `output_file_template` values to be provided to output fields
# dict[str, str] - `path_template` values to be provided to output fields
requirements:
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
tests:
Expand Down Expand Up @@ -150,7 +150,7 @@ tests:
environ:
# type=dict|default={}: Environment variables
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Expand All @@ -169,20 +169,14 @@ tests:
# (if not specified, will try to choose a sensible value)
anat:
# type=file|default=<undefined>: name of structural dataset
in_file:
# type=file|default=<undefined>: EPI dataset to align
epi_base: '0'
# type=traitcompound|default=None: the epi base used in alignmentshould be one of (0/mean/median/max/subbrick#)
epi_strip: '"3dAutomask"'
# type=enum|default='3dSkullStrip'|allowed['3dAutomask','3dSkullStrip','None']: method to mask brain in EPI datashould be one of[3dSkullStrip]/3dAutomask/None)
volreg: '"off"'
# type=enum|default='on'|allowed['off','on']: do volume registration on EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
tshift: '"off"'
# type=enum|default='on'|allowed['off','on']: do time shifting of EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
save_skullstrip: 'True'
# type=bool|default=False: save skull-stripped (not aligned)
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Expand All @@ -197,28 +191,22 @@ tests:
# 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: python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off
- 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.
anat: '"structural.nii"'
# type=file|default=<undefined>: name of structural dataset
in_file: '"functional.nii"'
# type=file|default=<undefined>: EPI dataset to align
epi_base: '0'
# type=traitcompound|default=None: the epi base used in alignmentshould be one of (0/mean/median/max/subbrick#)
epi_strip: '"3dAutomask"'
# type=enum|default='3dSkullStrip'|allowed['3dAutomask','3dSkullStrip','None']: method to mask brain in EPI datashould be one of[3dSkullStrip]/3dAutomask/None)
volreg: '"off"'
# type=enum|default='on'|allowed['off','on']: do volume registration on EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
tshift: '"off"'
# type=enum|default='on'|allowed['off','on']: do time shifting of EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
save_skullstrip: 'True'
# type=bool|default=False: save skull-stripped (not aligned)
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
# list[nipype2pydra.statements.imports.explicitimport] - 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
Loading
Loading