Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 20, 2024
1 parent fdcf89d commit 15a2d59
Show file tree
Hide file tree
Showing 40 changed files with 768 additions and 768 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v3
- name: Revert version to most recent tag on upstream update
if: github.event_name == 'repository_dispatch'
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install build dependencies
Expand Down Expand Up @@ -53,8 +53,8 @@ jobs:
uses: actions/checkout@v3
- name: Revert version to most recent tag on upstream update
if: github.event_name == 'repository_dispatch'
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
- name: Download tasks converted from Nipype
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
- name: Download tasks converted from Nipype
uses: actions/download-artifact@v3
with:
name: converted-nipype
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
python -c "import fileformats.medimage_ants as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
python -c "import fileformats.extras.medimage_ants as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
fileformats-test:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Removed unnecessary tools to free space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Get Download cache Key
id: cache-key
run: echo "::set-output name=key::ants-linux-ubuntu22_amd64-7.4.1"
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- name: Revert version to most recent tag on upstream update
if: github.event_name == 'repository_dispatch'
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
- name: Download tasks converted from Nipype
- name: Download tasks converted from Nipype
uses: actions/download-artifact@v3
with:
name: converted-nipype
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -213,7 +213,7 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_FILEFORMATS_API_TOKEN }}
packages-dir: ./related-packages/fileformats/dist
packages-dir: ./related-packages/fileformats/dist

deploy-fileformats-extras:
needs: [deploy-fileformats]
Expand All @@ -222,7 +222,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -245,7 +245,7 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_FILEFORMATS_EXTRAS_API_TOKEN }}
packages-dir: ./related-packages/fileformats-extras/dist
packages-dir: ./related-packages/fileformats-extras/dist

deploy:
needs: [deploy-fileformats-extras]
Expand All @@ -255,7 +255,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
- name: Download tasks converted from Nipype
- name: Download tasks converted from Nipype
uses: actions/download-artifact@v3
with:
name: converted-nipype
Expand All @@ -268,7 +268,7 @@ jobs:
git checkout $TAG
git add -f pydra/tasks/ants/auto/_version.py
git commit -am"added auto-generated version to make new tag for package version"
git tag ${TAG}post${POST}
git tag ${TAG}post${POST}
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -297,9 +297,9 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}

# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets.
# Secrets are not accessible in the if: condition [0], so set an output variable [1]
# [0] https://github.community/t/16928
# [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
# [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Automatically generated tasks can be found in the `pydra.tasks.ants.auto` packag
These packages should be treated with extreme caution as they likely do not pass testing.
Generated tasks that have been edited and pass testing are imported into one or more of the
`pydra.tasks.ants.v*` packages, corresponding to the version of the ants toolkit
they are designed for.
they are designed for.

Tests
-----
Expand Down Expand Up @@ -158,6 +158,6 @@ in the ``inputs > types`` and ``outputs > types`` dicts of the YAML spec.

If the required file-type is not found implemented within fileformats, please see the `fileformats
docs <https://arcanaframework.github.io/fileformats/developer.html>`__ for instructions on how to define
new fileformat types, and see
new fileformat types, and see
`fileformats-medimage-extras <https://github.com/ArcanaFramework/fileformats-medimage-extras/blob/6c2dabe91e95687eebc2639bb6f034cf9595ecfc/fileformats/extras/medimage/nifti.py#L30-L48>`__
for an example on how to implement methods to generate sample data for them.
4 changes: 3 additions & 1 deletion nipype-auto-conv/generate
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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)
2 changes: 1 addition & 1 deletion nipype-auto-conv/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ fileformats-medimage >=0.4
fileformats-datascience >= 0.1
fileformats-medimage-ants
traits
nipype2pydra
nipype2pydra
16 changes: 8 additions & 8 deletions nipype-auto-conv/specs/affine_initializer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#
# Docs
# ----
#
#
# Initialize an affine transform (as in antsBrainExtraction.sh)
#
#
# >>> from nipype.interfaces.ants import AffineInitializer
# >>> init = AffineInitializer()
# >>> init.inputs.fixed_image = 'fixed1.nii'
# >>> init.inputs.moving_image = 'moving1.nii'
# >>> init.cmdline
# 'antsAffineInitializer 3 fixed1.nii moving1.nii transform.mat 15.000000 0.100000 0 10'
#
#
#
#
task_name: AffineInitializer
nipype_name: AffineInitializer
nipype_module: nipype.interfaces.ants.utils
Expand Down Expand Up @@ -98,8 +98,8 @@ tests:
# 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
# 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
Expand All @@ -120,8 +120,8 @@ tests:
# 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
# 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
Expand Down
14 changes: 7 additions & 7 deletions nipype-auto-conv/specs/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#
# Docs
# ----
#
#
# Calculate the optimal linear transform parameters for aligning two images.
#
#
# Examples
# --------
# >>> AI(
Expand All @@ -17,16 +17,16 @@
# ... ).cmdline
# 'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1]
# -o initialization.mat -p 0 -s [20,0.12] -t Affine[0.1] -v 0'
#
#
# >>> AI(fixed_image='structural.nii',
# ... moving_image='epi.nii',
# ... metric=('Mattes', 32, 'Regular', 1),
# ... search_grid=(12, (1, 1, 1)),
# ... ).cmdline
# 'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1]
# -o initialization.mat -p 0 -s [20,0.12] -g [12.0,1x1x1] -t Affine[0.1] -v 0'
#
#
#
#
task_name: AI
nipype_name: AI
nipype_module: nipype.interfaces.ants.utils
Expand Down Expand Up @@ -123,8 +123,8 @@ tests:
# 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
# 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
Expand Down
Loading

0 comments on commit 15a2d59

Please sign in to comment.