Skip to content

Commit

Permalink
Merge pull request #8 from nipype/develop
Browse files Browse the repository at this point in the history
Switched the latest package version to drop micro/patch component
  • Loading branch information
tclose authored Mar 25, 2024
2 parents fee0faf + b84cbe5 commit 94409b0
Show file tree
Hide file tree
Showing 80 changed files with 214 additions and 260 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Run automatic Nipype > Pydra conversion
run: ./nipype-auto-conv/generate

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: converted-nipype
path: pydra/tasks/afni/auto
Expand All @@ -65,7 +65,7 @@ jobs:
run: git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')

- name: Download tasks converted from Nipype
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: converted-nipype
path: pydra/tasks/afni/auto
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
sudo bash OS_notes.linux_ubuntu_22_64_a_admin.txt 2>&1 | tee o.ubuntu_22_a.txt
- name: Download tasks converted from Nipype
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: converted-nipype
path: pydra/tasks/afni/auto
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
run: git checkout ${{ steps.latest_tag.outputs.TAG }}

- name: Download tasks converted from Nipype
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: converted-nipype
path: pydra/tasks/afni/auto
Expand All @@ -298,12 +298,10 @@ jobs:
- name: Strip auto package from gitignore so it is included in package
run: |
sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore
cat .gitignore
- name: Install task package to calculate post-release tag
run: |
pip install "./related-packages/fileformats" "./related-packages/fileformats-extras" ".[test]"
tree /opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/pydra/
- name: Generate post-release tag based on Nipype and Nipype2Pydra versions
id: post_release_tag
Expand Down Expand Up @@ -334,7 +332,7 @@ jobs:
- name: Check distributions
run: twine check dist/*

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: distributions
path: dist/
Expand Down
9 changes: 7 additions & 2 deletions nipype-auto-conv/generate
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from warnings import warn
from pathlib import Path
import shutil
from importlib import import_module
from tqdm import tqdm
import yaml
import nipype
import nipype2pydra.utils
Expand Down Expand Up @@ -36,7 +37,9 @@ if auto_dir.exists():
shutil.rmtree(auto_dir)

all_interfaces = []
for fspath in sorted(SPECS_DIR.glob("**/*.yaml")):
for fspath in tqdm(
sorted(SPECS_DIR.glob("**/*.yaml")), "converting interfaces from Nipype to Pydra"
):
with open(fspath) as f:
spec = yaml.load(f, Loader=yaml.SafeLoader)

Expand Down Expand Up @@ -70,7 +73,9 @@ post_release = (nipype_version + nipype2pydra_version).replace(".", "")
"""
)

auto_init += "\n\n__all__ = [\n" + "\n".join(f" \"{i}\"," for i in all_interfaces) + "\n]\n"
auto_init += (
"\n\n__all__ = [\n" + "\n".join(f' "{i}",' for i in all_interfaces) + "\n]\n"
)

with open(PKG_ROOT / "pydra" / "tasks" / PKG_NAME / "auto" / "__init__.py", "w") as f:
f.write(auto_init)
1 change: 1 addition & 0 deletions nipype-auto-conv/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
black
attrs>=22.1.0
nipype
tqdm
pydra
PyYAML>=6.0
fileformats >=0.8
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/a_boverlap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ doctests:
# 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:
in_file_a: '"functional.nii"'
# type=file|default=<undefined>: input file A
in_file_b:
in_file_b: '"structural.nii"'
# type=file|default=<undefined>: input file B
out_file: ' "out.mask_ae_overlap.txt"'
# type=file: output file
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/afn_ito_nifti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ doctests:
# 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:
in_file: '"afni_output.3D"'
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
out_file: ' "afni_output.nii"'
# type=file: output file
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/align_epi_anat_py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ doctests:
# 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:
anat: '"structural.nii"'
# type=file|default=<undefined>: name of structural dataset
in_file:
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#)
Expand Down
12 changes: 6 additions & 6 deletions nipype-auto-conv/specs/allineate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dAllineate
out_file: '"functional_allineate.nii"'
# type=file: output image file name
# type=file|default=<undefined>: output file from 3dAllineate
in_matrix:
in_matrix: '"cmatrix.mat"'
# type=file|default=<undefined>: matrix to align input file
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
Expand All @@ -349,9 +349,9 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dAllineate
reference:
reference: '"structural.nii"'
# type=file|default=<undefined>: file to be used as reference, the first volume will be used if not given the reference will be the first volume of in_file.
allcostx: '"out.allcostX.txt"'
# type=file: Compute and print ALL available cost functionals for the un-warped inputs
Expand All @@ -367,9 +367,9 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dAllineate
reference:
reference: '"structural.nii"'
# type=file|default=<undefined>: file to be used as reference, the first volume will be used if not given the reference will be the first volume of in_file.
nwarp_fixmot: '["X", "Y"]'
# type=list|default=[]: To fix motion along directions.
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/auto_tcorrelate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: timeseries x space (volume or surface) file
polort: '-1'
# type=int|default=0: Remove polynomical trend of order m or -1 for no detrending
eta2: 'True'
# type=bool|default=False: eta^2 similarity
mask:
mask: '"mask.nii"'
# type=file|default=<undefined>: mask of voxels
mask_only_targets: 'True'
# type=bool|default=False: use mask only on targets voxels
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/auto_tlrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ doctests:
# 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:
in_file: '"structural.nii"'
# type=file|default=<undefined>: Original anatomical volume (+orig).The skull is removed by this scriptunless instructed otherwise (-no_ss).
no_ss: 'True'
# type=bool|default=False: Do not strip skull of input data set (because skull has already been removed or because template still has the skull) NOTE: The ``-no_ss`` option is not all that optional. Here is a table of when you should and should not use ``-no_ss`` +------------------+------------+---------------+ | Dataset | Template | +==================+============+===============+ | | w/ skull | wo/ skull | +------------------+------------+---------------+ | WITH skull | ``-no_ss`` | xxx | +------------------+------------+---------------+ | WITHOUT skull | No Cigar | ``-no_ss`` | +------------------+------------+---------------+ Template means: Your template of choice Dset. means: Your anatomical dataset ``-no_ss`` means: Skull stripping should not be attempted on Dset xxx means: Don't put anything, the script will strip Dset No Cigar means: Don't try that combination, it makes no sense.
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/autobox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ doctests:
# 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:
in_file: '"structural.nii"'
# type=file|default=<undefined>: input file
padding: '5'
# type=int|default=0: Number of extra voxels to pad on each side of box
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/automask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dAutomask
dilate: '1'
# type=int|default=0: dilate the mask outwards
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/axialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3daxialize
out_file: '"axialized.nii"'
# type=file: output file
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/bandpass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dBandpass
highpass: '0.005'
# type=float|default=0.0: highpass
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/blur_in_mask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dSkullStrip
mask:
mask: '"mask.nii"'
# type=file|default=<undefined>: Mask dataset, if desired. Blurring will occur only within the mask. Voxels NOT in the mask will be set to zero in the output.
fwhm: '5.0'
# type=float|default=0.0: fwhm kernel size
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/blur_to_fwhm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ doctests:
# 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:
in_file: '"epi.nii"'
# type=file|default=<undefined>: The dataset that will be smoothed
fwhm: '2.5'
# type=float|default=0.0: Blur until the 3D FWHM reaches this value (in mm)
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/brick_stat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dmaskave
mask:
mask: '"skeleton_mask.nii.gz"'
# type=file|default=<undefined>: -mask dset = use dset as mask to include/exclude voxels
min: 'True'
# type=bool|default=False: print the minimum value in dataset
Expand Down
6 changes: 3 additions & 3 deletions nipype-auto-conv/specs/calc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ doctests:
# 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:
in_file_a: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dcalc
in_file_b:
in_file_b: '"functional2.nii"'
# type=file|default=<undefined>: operand file to 3dcalc
expr: '"a*b"'
# type=str|default='': expr
Expand All @@ -218,7 +218,7 @@ doctests:
# 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:
in_file_a: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dcalc
expr: '"1"'
# type=str|default='': expr
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/cat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ doctests:
# '.mock()' method of the corresponding class is used instead.
sel: '"''[0,2]''"'
# type=str|default='': Apply the same column/row selection string to all filenames on the command line.
in_files:
in_files: '["f1.1D", "f2.1D"]'
# type=list|default=[]:
out_file: '"catout.1d"'
# type=file: output file
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/center_mass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ doctests:
# 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:
in_file: '"structural.nii"'
# type=file|default=<undefined>: input file to 3dCM
cm_file: '"cm.txt"'
# type=file: file with the center of mass coordinates
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/clip_level.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ doctests:
# 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:
in_file: '"anatomical.nii"'
# type=file|default=<undefined>: input file to 3dClipLevel
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/convert_dset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ doctests:
# 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:
in_file: '"lh.pial_converted.gii"'
# type=file|default=<undefined>: input file to ConvertDset
out_type: '"niml_asc"'
# type=enum|default='niml'|allowed['1D','1Dp','1Dpt','gii','gii_asc','gii_b64','gii_b64gz','niml','niml_asc','niml_bi']: output type
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dcopy
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/deconvolve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ doctests:
# 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:
in_files: '["functional.nii", "functional2.nii"]'
# type=inputmultiobject|default=[]: filenames of 3D+time input datasets. More than one filename can be given and the datasets will be auto-catenated in time. You can input a 1D time series file here, but the time axis should run along the ROW direction, not the COLUMN direction as in the 'input1D' option.
out_file: '"output.nii"'
# type=file: output statistics file
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/degree_centrality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dDegreeCentrality
mask:
mask: '"mask.nii"'
# type=file|default=<undefined>: mask file to mask input data
sparsity: '1 # keep the top one percent of connections'
# type=float|default=0.0: only take the top percent of connections
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/despike.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dDespike
imports:
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/detrend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dDetrend
args: '"-polort 2"'
# type=str|default='': Additional parameters to the command
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/dot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ doctests:
# 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:
in_files: '["functional.nii[0]", "structural.nii"]'
# type=list|default=[]: list of input files, possibly with subbrick selectors
dodice: "True"
# type=bool|default=False: Return the Dice coefficient (the Sorensen-Dice index).
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/ecm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dECM
mask:
mask: '"mask.nii"'
# type=file|default=<undefined>: mask file to mask input data
sparsity: '0.1 # keep top 0.1% of connections'
# type=float|default=0.0: only take the top percent of connections
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/edge_3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ doctests:
# 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:
in_file: '"functional.nii"'
# type=file|default=<undefined>: input file to 3dedge3
out_file: '"edges.nii"'
# type=file: output file
Expand Down
Loading

0 comments on commit 94409b0

Please sign in to comment.