Skip to content

Commit 52e929c

Browse files
authored
Merge pull request #6 from nipype/develop
Commited auto-generated code with new syntax
2 parents 5bbb6df + 8359ed1 commit 52e929c

File tree

228 files changed

+155292
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+155292
-109
lines changed

.github/workflows/ci-cd.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ name: CI/CD
99
on:
1010
push:
1111
branches: [ main, develop ]
12-
tags: [ '*' ]
1312
pull_request:
1413
branches: [ main, develop ]
14+
release:
15+
types: [published]
1516
repository_dispatch:
16-
types: [create-release]
17+
types: [create-post-release]
18+
1719

1820
jobs:
1921
nipype-conv:
@@ -143,7 +145,7 @@ jobs:
143145
if: ${{ always() }}
144146
with:
145147
files: coverage.xml
146-
name: pydra-mriqc
148+
name: pydra-tasks-mriqc
147149

148150
deploy:
149151
needs: [test]

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,3 @@ dmypy.json
137137
# Mac garbarge
138138
.DS_store
139139

140-
/pydra

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = "pydra-mriqc"
20+
project = "pydra-tasks-mriqc"
2121
copyright = "2020, Xihe Xie"
2222
author = "Xihe Xie"
2323

nipype-auto-conv/generate.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from pathlib import Path
2+
from click.testing import CliRunner
3+
from nipype2pydra.cli import convert
4+
5+
6+
spec_dir = Path(__file__).parent / "specs"
7+
conv_dir = Path(__file__).parent.parent
8+
9+
runner = CliRunner()
10+
result = runner.invoke(
11+
convert,
12+
args=[str(spec_dir), str(conv_dir)],
13+
catch_exceptions=False,
14+
)

nipype-auto-conv/specs/interfaces/derivatives_data_sink.yaml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Docs
77
# ----
8-
#
8+
#
99
task_name: DerivativesDataSink
1010
nipype_name: DerivativesDataSink
1111
nipype_module: mriqc.interfaces
@@ -15,11 +15,11 @@ inputs:
1515
rename:
1616
# dict[str, str] - fields to rename in the Pydra interface
1717
types:
18-
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
19-
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
20-
# from the nipype interface, but you may want to be more specific, particularly
21-
# for file types, where specifying the format also specifies the file that will be
22-
# passed to the field in the automatically generated unittests.
18+
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
19+
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
20+
# from the nipype interface, but you may want to be more specific, particularly
21+
# for file types, where specifying the format also specifies the file that will be
22+
# passed to the field in the automatically generated unittests.
2323
base_directory: generic/directory
2424
# type=directory|default='': Path to the base directory for storing data.
2525
in_file: generic/file+list-of
@@ -37,15 +37,15 @@ outputs:
3737
rename:
3838
# dict[str, str] - fields to rename in the Pydra interface
3939
types:
40-
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
41-
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
42-
# from the nipype interface, but you may want to be more specific, particularly
43-
# for file types, where specifying the format also specifies the file that will be
44-
# passed to the field in the automatically generated unittests.
40+
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
41+
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
42+
# from the nipype interface, but you may want to be more specific, particularly
43+
# for file types, where specifying the format also specifies the file that will be
44+
# passed to the field in the automatically generated unittests.
4545
out_file: generic/file+list-of
46-
# type=outputmultiobject:
46+
# type=outputmultiobject:
4747
out_meta: generic/file+list-of
48-
# type=outputmultiobject:
48+
# type=outputmultiobject:
4949
callables:
5050
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
5151
# to set to the `callable` attribute of output fields
@@ -54,38 +54,38 @@ outputs:
5454
requirements:
5555
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
5656
tests:
57-
- inputs:
58-
# dict[str, str] - values to provide to inputs fields in the task initialisation
59-
# (if not specified, will try to choose a sensible value)
60-
base_directory:
61-
# type=directory|default='': Path to the base directory for storing data.
62-
check_hdr:
63-
# type=bool|default=True: fix headers of NIfTI outputs
64-
compress:
65-
# type=inputmultiobject|default=[]: whether ``in_file`` should be compressed (True), uncompressed (False) or left unmodified (None, default).
66-
data_dtype:
67-
# type=str|default='': NumPy datatype to coerce NIfTI data to, or `source` tomatch the input file dtype
68-
dismiss_entities:
69-
# type=inputmultiobject|default=[]: a list entities that will not be propagated from the source file
70-
in_file:
71-
# type=inputmultiobject|default=[]: the object to be saved
72-
meta_dict:
73-
# type=dict|default={}: an input dictionary containing metadata
74-
source_file:
75-
# type=inputmultiobject|default=[]: the source file(s) to extract entities from
76-
imports:
77-
# list[nipype2pydra.task.base.explicitimport] - list import statements required by the test, with each list item
78-
# consisting of 'module', 'name', and optionally 'alias' keys
79-
expected_outputs:
80-
# dict[str, str] - expected values for selected outputs, noting that tests will typically
81-
# be terminated before they complete for time-saving reasons, and therefore
82-
# these values will be ignored, when running in CI
83-
timeout: 10
84-
# int - the value to set for the timeout in the generated test,
85-
# after which the test will be considered to have been initialised
86-
# successfully. Set to 0 to disable the timeout (warning, this could
87-
# lead to the unittests taking a very long time to complete)
88-
xfail: true
89-
# bool - whether the unittest is expected to fail or not. Set to false
90-
# when you are satisfied with the edits you have made to this file
57+
- inputs:
58+
# dict[str, str] - values to provide to inputs fields in the task initialisation
59+
# (if not specified, will try to choose a sensible value)
60+
base_directory:
61+
# type=directory|default='': Path to the base directory for storing data.
62+
check_hdr:
63+
# type=bool|default=True: fix headers of NIfTI outputs
64+
compress:
65+
# type=inputmultiobject|default=[]: whether ``in_file`` should be compressed (True), uncompressed (False) or left unmodified (None, default).
66+
data_dtype:
67+
# type=str|default='': NumPy datatype to coerce NIfTI data to, or `source` tomatch the input file dtype
68+
dismiss_entities:
69+
# type=inputmultiobject|default=[]: a list entities that will not be propagated from the source file
70+
in_file:
71+
# type=inputmultiobject|default=[]: the object to be saved
72+
meta_dict:
73+
# type=dict|default={}: an input dictionary containing metadata
74+
source_file:
75+
# type=inputmultiobject|default=[]: the source file(s) to extract entities from
76+
imports:
77+
# list[nipype2pydra.task.base.explicitimport] - list import statements required by the test, with each list item
78+
# consisting of 'module', 'name', and optionally 'alias' keys
79+
expected_outputs:
80+
# dict[str, str] - expected values for selected outputs, noting that tests will typically
81+
# be terminated before they complete for time-saving reasons, and therefore
82+
# these values will be ignored, when running in CI
83+
timeout: 10
84+
# int - the value to set for the timeout in the generated test,
85+
# after which the test will be considered to have been initialised
86+
# successfully. Set to 0 to disable the timeout (warning, this could
87+
# lead to the unittests taking a very long time to complete)
88+
xfail: true
89+
# bool - whether the unittest is expected to fail or not. Set to false
90+
# when you are satisfied with the edits you have made to this file
9191
doctests: []

nipype-auto-conv/specs/interfaces/iqm_file_sink.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,4 @@ tests:
9999
doctests: []
100100
find_replace:
101101
- [config\.loggers\.\w+\., logger.]
102+
- ["value=Undefined", "value=attrs.NOTHING"]

nipype-auto-conv/specs/interfaces/synth_strip.yaml

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Docs
77
# ----
8-
#
8+
#
99
task_name: SynthStrip
1010
nipype_name: SynthStrip
1111
nipype_module: mriqc.interfaces.synthstrip
@@ -15,11 +15,11 @@ inputs:
1515
rename:
1616
# dict[str, str] - fields to rename in the Pydra interface
1717
types:
18-
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
19-
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
20-
# from the nipype interface, but you may want to be more specific, particularly
21-
# for file types, where specifying the format also specifies the file that will be
22-
# passed to the field in the automatically generated unittests.
18+
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
19+
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
20+
# from the nipype interface, but you may want to be more specific, particularly
21+
# for file types, where specifying the format also specifies the file that will be
22+
# passed to the field in the automatically generated unittests.
2323
in_file: generic/file
2424
# type=file|default=<undefined>: Input image to be brain extracted
2525
model: generic/file
@@ -34,18 +34,20 @@ inputs:
3434
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
3535
# to set as the `default` method of input fields
3636
metadata:
37+
in_file:
38+
copyfile: true
3739
# dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1)
3840
outputs:
3941
omit:
4042
# list[str] - fields to omit from the Pydra interface
4143
rename:
4244
# dict[str, str] - fields to rename in the Pydra interface
4345
types:
44-
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
45-
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
46-
# from the nipype interface, but you may want to be more specific, particularly
47-
# for file types, where specifying the format also specifies the file that will be
48-
# passed to the field in the automatically generated unittests.
46+
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
47+
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
48+
# from the nipype interface, but you may want to be more specific, particularly
49+
# for file types, where specifying the format also specifies the file that will be
50+
# passed to the field in the automatically generated unittests.
4951
out_file: generic/file
5052
# type=file: brain-extracted image
5153
# type=file|default=<undefined>: store brain-extracted input to file
@@ -60,42 +62,42 @@ outputs:
6062
requirements:
6163
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
6264
tests:
63-
- inputs:
64-
# dict[str, str] - values to provide to inputs fields in the task initialisation
65-
# (if not specified, will try to choose a sensible value)
66-
in_file:
67-
# type=file|default=<undefined>: Input image to be brain extracted
68-
use_gpu:
69-
# type=bool|default=False: Use GPU
70-
model:
71-
# type=file|default=<undefined>: file containing model's weights
72-
border_mm:
73-
# type=int|default=1: Mask border threshold in mm
74-
out_file:
75-
# type=file: brain-extracted image
76-
# type=file|default=<undefined>: store brain-extracted input to file
77-
out_mask:
78-
# type=file: brain mask
79-
# type=file|default=<undefined>: store brainmask to file
80-
num_threads:
81-
# type=int|default=0: Number of threads
82-
args:
83-
# type=str|default='': Additional parameters to the command
84-
environ:
85-
# type=dict|default={}: Environment variables
86-
imports:
87-
# list[nipype2pydra.task.base.explicitimport] - list import statements required by the test, with each list item
88-
# consisting of 'module', 'name', and optionally 'alias' keys
89-
expected_outputs:
90-
# dict[str, str] - expected values for selected outputs, noting that tests will typically
91-
# be terminated before they complete for time-saving reasons, and therefore
92-
# these values will be ignored, when running in CI
93-
timeout: 10
94-
# int - the value to set for the timeout in the generated test,
95-
# after which the test will be considered to have been initialised
96-
# successfully. Set to 0 to disable the timeout (warning, this could
97-
# lead to the unittests taking a very long time to complete)
98-
xfail: true
99-
# bool - whether the unittest is expected to fail or not. Set to false
100-
# when you are satisfied with the edits you have made to this file
65+
- inputs:
66+
# dict[str, str] - values to provide to inputs fields in the task initialisation
67+
# (if not specified, will try to choose a sensible value)
68+
in_file:
69+
# type=file|default=<undefined>: Input image to be brain extracted
70+
use_gpu:
71+
# type=bool|default=False: Use GPU
72+
model:
73+
# type=file|default=<undefined>: file containing model's weights
74+
border_mm:
75+
# type=int|default=1: Mask border threshold in mm
76+
out_file:
77+
# type=file: brain-extracted image
78+
# type=file|default=<undefined>: store brain-extracted input to file
79+
out_mask:
80+
# type=file: brain mask
81+
# type=file|default=<undefined>: store brainmask to file
82+
num_threads:
83+
# type=int|default=0: Number of threads
84+
args:
85+
# type=str|default='': Additional parameters to the command
86+
environ:
87+
# type=dict|default={}: Environment variables
88+
imports:
89+
# list[nipype2pydra.task.base.explicitimport] - list import statements required by the test, with each list item
90+
# consisting of 'module', 'name', and optionally 'alias' keys
91+
expected_outputs:
92+
# dict[str, str] - expected values for selected outputs, noting that tests will typically
93+
# be terminated before they complete for time-saving reasons, and therefore
94+
# these values will be ignored, when running in CI
95+
timeout: 10
96+
# int - the value to set for the timeout in the generated test,
97+
# after which the test will be considered to have been initialised
98+
# successfully. Set to 0 to disable the timeout (warning, this could
99+
# lead to the unittests taking a very long time to complete)
100+
xfail: true
101+
# bool - whether the unittest is expected to fail or not. Set to false
102+
# when you are satisfied with the edits you have made to this file
101103
doctests: []

nipype-auto-conv/specs/package.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ config_params:
2222
varname: config.environment
2323
type: struct
2424
module: mriqc
25+
inputs_entities:
26+
varname: config.workflow.inputs_entities
27+
type: struct
28+
module: mriqc
2529
omit_functions:
2630
- nipype.external.due.BibTeX
2731
omit_classes:
@@ -35,6 +39,12 @@ omit_constants:
3539
import_translations:
3640
- [nireports, pydra.tasks.nireports]
3741
- [niworkflows, pydra.tasks.niworkflows]
42+
import_find_replace:
43+
- ["from \\.\\. import config, logging", ""]
44+
- ["_ReadDWIMetadataOutputSpec,", ""]
45+
- ["from pydra.tasks.mriqc.nipype_ports.interfaces import utility as niu", ""]
46+
- ["\\s+config,(\\s+)fname_presuffix,", "\\1fname_presuffix,"]
47+
- ["from pydra.tasks.io.auto import add_traits\n", ""]
3848
find_replace:
3949
- [config\.loggers\.\w+\., logger.]
4050
- [config.to_filename\(\), ""]
@@ -55,9 +65,6 @@ find_replace:
5565
# - ["\\bdict\\[", "ty.Dict["]
5666
omit_modules:
5767
- "mriqc.config"
58-
import_find_replace:
59-
- ["from \\.\\. import config, logging", ""]
60-
- ["_ReadDWIMetadataOutputSpec,", ""]
61-
- ["from pydra.tasks.mriqc.nipype_ports.interfaces import utility as niu", ""]
6268
copy_packages:
6369
- mriqc.data
70+
- mriqc.synthstrip

nipype-auto-conv/specs/workflows/mriqc.workflows.anatomical.base.anat_qc_workflow.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ nipype_name: anat_qc_workflow
66
nipype_module: mriqc.workflows.anatomical.base
77
# Name of the node that is to be considered the input of the workflow, i.e. its outputs will be the inputs of the workflow
88
input_node: inputnode
9+
inputs:
10+
in_file:
11+
type: medimage/t1w+nifti-gz-x
12+
modality:
13+
type: field/text
14+
connections:
15+
- [norm, modality]
916
# name of the workflow variable that is returned
1017
workflow_variable: workflow
1118
# the names of the nested workflows that are defined in other modules and need to be imported
@@ -21,3 +28,8 @@ find_replace:
2128
"# fmt: off\\n\\s*workflow.set_output\\(\\[\\('iqmswf_measures', workflow.iqmswf.lzout.measures\\)\\]\\)",
2229
"",
2330
]
31+
- [
32+
"modality=workflow.lzin.modality,(\\s+)name=\"norm\"",
33+
"modality=workflow.lzin.modality,\\1name=\"spatial_norm\"",
34+
]
35+
- ["workflow\\.norm\\b", "workflow.spatial_norm"]

nipype-auto-conv/specs/workflows/mriqc.workflows.shared.synthstrip_wf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ find_replace:
1313
- ["config = NipypeConfig\\(\\)", ""]
1414
- ["iflogger = logging.getLogger\\(\"nipype.interface\"\\)", ""]
1515
- ["logging = Logging\\(config\\)", ""]
16+
- ["save_bias=True", "bias_image=True"]
1617
# name of the workflow variable that is returned
1718
workflow_variable: workflow
1819
# the names of the nested workflows that are defined in other modules and need to be imported

0 commit comments

Comments
 (0)