From 3f2aebc1850c26d59583b3228d26ca6b02e13198 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 18 Mar 2024 14:48:07 +1100 Subject: [PATCH 01/13] updated generate_sample_*_data functions to SampleFileGenerator syntax --- .../extras/medimage_afni/__init__.py | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py index d0706d5..be8dab4 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py @@ -2,7 +2,7 @@ from pathlib import Path import typing as ty from random import Random -from fileformats.core import FileSet +from fileformats.core import FileSet, SampleFileGenerator from fileformats.medimage_afni import ( OneD, Head, @@ -16,9 +16,7 @@ @FileSet.generate_sample_data.register def gen_sample_oned_data( oned: OneD, - dest_dir: Path, - seed: ty.Union[int, Random] = 0, - stem: ty.Optional[str] = None, + generator: SampleFileGenerator, ) -> ty.Iterable[Path]: raise NotImplementedError @@ -36,9 +34,7 @@ def gen_sample_head_data( @FileSet.generate_sample_data.register def gen_sample_all1_data( all1: All1, - dest_dir: Path, - seed: ty.Union[int, Random] = 0, - stem: ty.Optional[str] = None, + generator: SampleFileGenerator, ) -> ty.Iterable[Path]: raise NotImplementedError @@ -46,9 +42,7 @@ def gen_sample_all1_data( @FileSet.generate_sample_data.register def gen_sample_r1_data( r1: R1, - dest_dir: Path, - seed: ty.Union[int, Random] = 0, - stem: ty.Optional[str] = None, + generator: SampleFileGenerator, ) -> ty.Iterable[Path]: raise NotImplementedError @@ -56,9 +50,7 @@ def gen_sample_r1_data( @FileSet.generate_sample_data.register def gen_sample_threed_data( threed: ThreeD, - dest_dir: Path, - seed: ty.Union[int, Random] = 0, - stem: ty.Optional[str] = None, + generator: SampleFileGenerator, ) -> ty.Iterable[Path]: raise NotImplementedError @@ -66,8 +58,6 @@ def gen_sample_threed_data( @FileSet.generate_sample_data.register def gen_sample_dset_data( dset: Dset, - dest_dir: Path, - seed: ty.Union[int, Random] = 0, - stem: ty.Optional[str] = None, + generator: SampleFileGenerator, ) -> ty.Iterable[Path]: raise NotImplementedError From da71ed82495767577edc20b83ecbc3b8095b9043 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 18 Mar 2024 14:50:58 +1100 Subject: [PATCH 02/13] fixed up fileformats-test GHA job --- .github/workflows/ci-cd.yaml | 3 +- .github/workflows/fileformats-ci-cd.yaml | 132 ----------------------- 2 files changed, 1 insertion(+), 134 deletions(-) delete mode 100644 .github/workflows/fileformats-ci-cd.yaml diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d92217b..d4729f7 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -107,8 +107,7 @@ jobs: python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" - name: Test fileformats with pytest run: | - cd ./fileformats - pytest -sv --cov fileformats.medimage_afni --cov fileformats.extras.medimage_afni --cov-report xml . + pytest ./related-packages -sv --cov fileformats.medimage_afni --cov fileformats.extras.medimage_afni --cov-report xml . test: needs: [nipype-conv, fileformats-test] diff --git a/.github/workflows/fileformats-ci-cd.yaml b/.github/workflows/fileformats-ci-cd.yaml deleted file mode 100644 index 2485df2..0000000 --- a/.github/workflows/fileformats-ci-cd.yaml +++ /dev/null @@ -1,132 +0,0 @@ -name: CI/CD - -on: - push: - branches: [ main, develop ] - pull_request: - branches: [ main, develop ] - release: - types: [published] - -defaults: - run: - shell: bash - -jobs: - test: - strategy: - matrix: - os: [ubuntu-latest] - python-version: ["3.8", "3.12"] - fail-fast: false - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Unset header - # checkout@v2 adds a header that makes branch protection report errors - # because the Github action bot is not a collaborator on the repo - run: git config --local --unset http.https://github.com/.extraheader - - name: Fetch tags - run: git fetch --prune --unshallow - - name: Disable etelemetry - run: echo "NO_ET=TRUE" >> $GITHUB_ENV - - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Update build tools - run: python3 -m pip install --upgrade pip - - name: Install Package - run: python3 -m pip install -e related-packages/fileformats[test] -e related-packages/fileformats-extras[test] - - name: Pytest - run: pytest -vvs --cov fileformats.medimage_afni --cov-config .coveragerc --cov-report xml . - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - - build: - needs: [test] - runs-on: ubuntu-latest - strategy: - matrix: - pkg: - - ["main", "related-packages/fileformats"] - - ["extras", "related-packages/fileformats-extras"] - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Unset header - # checkout@v2 adds a header that makes branch protection report errors - # because the Github action bot is not a collaborator on the repo - run: git config --local --unset http.https://github.com/.extraheader - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - - name: Install build tools - run: python3 -m pip install build twine - - name: Build source and wheel distributions - run: python3 -m build ${{ matrix.pkg[1] }} - - name: Check distributions - run: twine check ${{ matrix.pkg[1] }}/dist/* - - uses: actions/upload-artifact@v3 - with: - name: built-${{ matrix.pkg[0] }} - path: ${{ matrix.pkg[1] }}/dist - - deploy: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Download build - uses: actions/download-artifact@v3 - with: - name: built-main - path: dist - - name: Check for PyPI token on tag - id: deployable - if: github.event_name == 'release' - env: - PYPI_API_TOKEN: "${{ secrets.FILEFORMATS_PYPI_API_TOKEN }}" - run: if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi - - name: Upload to PyPI - if: steps.deployable.outputs.DEPLOY - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.FILEFORMATS_PYPI_API_TOKEN }} - - deploy-extras: - needs: [build, deploy] - runs-on: ubuntu-latest - steps: - - name: Download build - uses: actions/download-artifact@v3 - with: - name: built-extras - path: dist - - name: Check for PyPI token on tag - id: deployable - if: github.event_name == 'release' - env: - EXTRAS_PYPI_API_TOKEN: "${{ secrets.FILEFORMATS_EXTRAS_PYPI_API_TOKEN }}" - run: if [ -n "$EXTRAS_PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi - - name: Upload to PyPI - if: steps.deployable.outputs.DEPLOY - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.FILEFORMATS_EXTRAS_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 From 886effc566ff176c72e603964e5de380e9a8c43e Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 18 Mar 2024 15:34:12 +1100 Subject: [PATCH 03/13] added tests to fileformats package --- .../tests/test_generate_sample_data.py | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py new file mode 100644 index 0000000..82b81d3 --- /dev/null +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py @@ -0,0 +1,39 @@ +import pytest +from fileformats.medimage_afni import ( + OneD, + ThreeD, + R1, + All1, + Dset, + Head, +) + + +@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +def test_generate_sample_oned_data(): + assert isinstance(OneD.sample(), OneD) + + +@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +def test_generate_sample_threed_data(): + assert isinstance(ThreeD.sample(), ThreeD) + + +@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +def test_generate_sample_r1_data(): + assert isinstance(R1.sample(), R1) + + +@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +def test_generate_sample_all1_data(): + assert isinstance(All1.sample(), All1) + + +@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +def test_generate_sample_dset_data(): + assert isinstance(Dset.sample(), Dset) + + +@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +def test_generate_sample_head_data(): + assert isinstance(Head.sample(), Head) From 1495637cbf1ebcfeb71c42befaf7b5a660fc4e92 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 18 Mar 2024 16:42:40 +1100 Subject: [PATCH 04/13] removed "raises" kwarg from xfails --- .../medimage_afni/tests/test_generate_sample_data.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py index 82b81d3..398d689 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py @@ -9,31 +9,31 @@ ) -@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +@pytest.xfail(reason="generate_sample_data not implemented") def test_generate_sample_oned_data(): assert isinstance(OneD.sample(), OneD) -@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +@pytest.xfail(reason="generate_sample_data not implemented") def test_generate_sample_threed_data(): assert isinstance(ThreeD.sample(), ThreeD) -@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +@pytest.xfail(reason="generate_sample_data not implemented") def test_generate_sample_r1_data(): assert isinstance(R1.sample(), R1) -@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +@pytest.xfail(reason="generate_sample_data not implemented") def test_generate_sample_all1_data(): assert isinstance(All1.sample(), All1) -@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +@pytest.xfail(reason="generate_sample_data not implemented") def test_generate_sample_dset_data(): assert isinstance(Dset.sample(), Dset) -@pytest.xfail(reason="generate_sample_data not implemented", raises=NotImplementedError) +@pytest.xfail(reason="generate_sample_data not implemented") def test_generate_sample_head_data(): assert isinstance(Head.sample(), Head) From cd044b26903da7b2cdebfa70ffc157626cb118ef Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 18 Mar 2024 17:17:23 +1100 Subject: [PATCH 05/13] fixed xfail --- .../medimage_afni/tests/test_generate_sample_data.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py index 398d689..17f8621 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/tests/test_generate_sample_data.py @@ -9,31 +9,31 @@ ) -@pytest.xfail(reason="generate_sample_data not implemented") +@pytest.mark.xfail(reason="generate_sample_data not implemented") def test_generate_sample_oned_data(): assert isinstance(OneD.sample(), OneD) -@pytest.xfail(reason="generate_sample_data not implemented") +@pytest.mark.xfail(reason="generate_sample_data not implemented") def test_generate_sample_threed_data(): assert isinstance(ThreeD.sample(), ThreeD) -@pytest.xfail(reason="generate_sample_data not implemented") +@pytest.mark.xfail(reason="generate_sample_data not implemented") def test_generate_sample_r1_data(): assert isinstance(R1.sample(), R1) -@pytest.xfail(reason="generate_sample_data not implemented") +@pytest.mark.xfail(reason="generate_sample_data not implemented") def test_generate_sample_all1_data(): assert isinstance(All1.sample(), All1) -@pytest.xfail(reason="generate_sample_data not implemented") +@pytest.mark.xfail(reason="generate_sample_data not implemented") def test_generate_sample_dset_data(): assert isinstance(Dset.sample(), Dset) -@pytest.xfail(reason="generate_sample_data not implemented") +@pytest.mark.xfail(reason="generate_sample_data not implemented") def test_generate_sample_head_data(): assert isinstance(Head.sample(), Head) From 84828908286083baf88ccd1658856b6ec8b443d2 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 08:18:09 +1100 Subject: [PATCH 06/13] fixed signature of one of the generate sample data methods --- .../fileformats/extras/medimage_afni/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py index be8dab4..389bf4b 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py @@ -24,9 +24,7 @@ def gen_sample_oned_data( @FileSet.generate_sample_data.register def gen_sample_head_data( head: Head, - dest_dir: Path, - seed: ty.Union[int, Random] = 0, - stem: ty.Optional[str] = None, + generator: SampleFileGenerator, ) -> ty.Iterable[Path]: raise NotImplementedError From 7a148a3de04c004051eff3ef72ad2b88c7ca24fb Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 08:26:18 +1100 Subject: [PATCH 07/13] fixed up Afni installation --- .github/workflows/ci-cd.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d4729f7..07b8d1d 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -123,31 +123,29 @@ jobs: - name: Get Download cache Key id: cache-key run: echo "::set-output name=key::afni-linux-ubuntu22_amd64-7.4.1" - - name: Cache FreeSurfer + - name: Cache AFNI uses: actions/cache@v2 with: path: $HOME/downloads/afni key: ${{ steps.cache-key.outputs.key }} restore-keys: | afni-linux-ubuntu22_amd64-7.4.1 - - name: Download FreeSurfer + - name: Download AFNI if: steps.cache-key.outputs.key != steps.cache-hit.outputs.key run: | mkdir -p $HOME/downloads/afni curl -s -o $HOME/downloads/afni/afni-linux-ubuntu22_amd64-7.4.1.tar.gz https://surfer.nmr.mgh.harvard.edu/pub/dist/afni/7.4.1/afni-linux-ubuntu22_amd64-7.4.1.tar.gz shell: bash - - name: Install Freesurfer - env: - FREESURFER_LICENCE: ${{ secrets.FREESURFER_LICENCE }} + - name: Install AFNI run: | pushd $HOME/downloads/afni tar -zxpf afni-linux-ubuntu22_amd64-7.4.1.tar.gz mv afni $HOME/ popd - export FREESURFER_HOME=$HOME/afni - source $FREESURFER_HOME/SetUpFreeSurfer.sh - echo $FREESURFER_LICENCE > $FREESURFER_HOME/license.txt - export PATH=$FREESURFER_HOME/bin:$PATH + pushd $HOME/afni + sudo OS_notes.linux_ubuntu_22_64_a_admin.txt 2>&1 | tee o.ubuntu_22_a.txt + echo "$HOME/afni" >> $GITHUB_PATH + afni_system_check.py -check_all - uses: actions/checkout@v3 - name: Revert version to most recent tag on upstream update if: github.event_name == 'repository_dispatch' From 94e1c68596856e8fc483d4c7e9a7c6beeb0d05a2 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 08:47:39 +1100 Subject: [PATCH 08/13] fixing afni install in gha --- .github/workflows/ci-cd.yaml | 52 +++++++++++++++--------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 07b8d1d..9c7a7d2 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -114,67 +114,59 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ['3.8'] # '3.11' + python-version: ['3.8', '3.11'] steps: + - name: Removed unnecessary tools to free space run: | sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Get Download cache Key - id: cache-key - run: echo "::set-output name=key::afni-linux-ubuntu22_amd64-7.4.1" - - name: Cache AFNI - uses: actions/cache@v2 - with: - path: $HOME/downloads/afni - key: ${{ steps.cache-key.outputs.key }} - restore-keys: | - afni-linux-ubuntu22_amd64-7.4.1 - - name: Download AFNI - if: steps.cache-key.outputs.key != steps.cache-hit.outputs.key - run: | - mkdir -p $HOME/downloads/afni - curl -s -o $HOME/downloads/afni/afni-linux-ubuntu22_amd64-7.4.1.tar.gz https://surfer.nmr.mgh.harvard.edu/pub/dist/afni/7.4.1/afni-linux-ubuntu22_amd64-7.4.1.tar.gz - shell: bash - - name: Install AFNI - run: | - pushd $HOME/downloads/afni - tar -zxpf afni-linux-ubuntu22_amd64-7.4.1.tar.gz - mv afni $HOME/ - popd - pushd $HOME/afni - sudo OS_notes.linux_ubuntu_22_64_a_admin.txt 2>&1 | tee o.ubuntu_22_a.txt - echo "$HOME/afni" >> $GITHUB_PATH - afni_system_check.py -check_all - - uses: actions/checkout@v3 + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Checkout repo + 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: Install AFNI + run: | + curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_22_64_a_admin.txt + curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_22_64_b_user.tcsh + 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 with: name: converted-nipype path: pydra/tasks/afni/auto + - name: Strip auto package from gitignore so it is included in package run: | sed -i '/\/src\/pydra\/tasks\/afni\/auto/d' .gitignore + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install build dependencies run: | python -m pip install --upgrade pip + - name: Install task package run: | pip install "./related-packages/fileformats" "./related-packages/fileformats-extras" ".[test]" python -c "import pydra.tasks.afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" + - name: Test with pytest run: | pytest -sv --doctest-modules ./pydra/tasks/afni \ --cov pydra.tasks.afni --cov-report xml - - uses: codecov/codecov-action@v3 + + - name: Upload to CodeCov + uses: codecov/codecov-action@v3 if: ${{ always() }} with: files: coverage.xml,./fileformats/coverage.xml From de158be16926c65e6567888b3791283d237e4643 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 08:55:08 +1100 Subject: [PATCH 09/13] added debugging to gha --- .github/workflows/ci-cd.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 9c7a7d2..1663ca7 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -141,6 +141,9 @@ jobs: name: converted-nipype path: pydra/tasks/afni/auto + - name: Show the contents of the auto-generated tasks + run: tree pydra + - name: Strip auto package from gitignore so it is included in package run: | sed -i '/\/src\/pydra\/tasks\/afni\/auto/d' .gitignore From 56a1f0d9c9ac914cc7e78dfcb2200d9a2681b7d4 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 08:56:58 +1100 Subject: [PATCH 10/13] fixed strip of auto package from gitignore --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 1663ca7..0f57665 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -146,7 +146,7 @@ jobs: - name: Strip auto package from gitignore so it is included in package run: | - sed -i '/\/src\/pydra\/tasks\/afni\/auto/d' .gitignore + sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 9bff3bb4bbff8c2b1a079d2816eb75d185bb715c Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 09:20:17 +1100 Subject: [PATCH 11/13] fixed up latest import --- pydra/tasks/afni/latest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pydra/tasks/afni/latest.py b/pydra/tasks/afni/latest.py index f41e057..3113cff 100644 --- a/pydra/tasks/afni/latest.py +++ b/pydra/tasks/afni/latest.py @@ -1,3 +1,3 @@ -PACKAGE_VERSION = "v1" +PACKAGE_VERSION = "v24_0_12" -from .v1 import * # noqa +from .v24_0_12 import * # noqa From 1353e96097451b538537e3d27eb68673bd0de660 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 09:32:24 +1100 Subject: [PATCH 12/13] disabled doctest in python testing --- .github/workflows/ci-cd.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 0f57665..60290e8 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -165,8 +165,7 @@ jobs: - name: Test with pytest run: | - pytest -sv --doctest-modules ./pydra/tasks/afni \ - --cov pydra.tasks.afni --cov-report xml + pytest -sv ./pydra/tasks/afni --cov pydra.tasks.afni --cov-report xml - name: Upload to CodeCov uses: codecov/codecov-action@v3 From 21c393eb691c911601c1df87df39509f4db3171a Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 19 Mar 2024 11:36:29 +1100 Subject: [PATCH 13/13] touched up readme to get it to pass PyPI check --- README.rst | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index f1d5683..5819ec5 100644 --- a/README.rst +++ b/README.rst @@ -1,11 +1,11 @@ -=============================== +=========================== Pydra task package for afni -=============================== +=========================== .. image:: https://github.com/nipype/pydra-afni/actions/workflows/pythonpackage.yaml/badge.svg :target: https://github.com/nipype/pydra-afni/actions/workflows/pythonpackage.yaml -.. .. image:: https://codecov.io/gh/nipype/pydra-afni/branch/main/graph/badge.svg?token=UIS0OGPST7 -.. :target: https://codecov.io/gh/nipype/pydra-afni +.. image:: https://codecov.io/gh/nipype/pydra-afni/branch/main/graph/badge.svg?token=UIS0OGPST7 + :target: https://codecov.io/gh/nipype/pydra-afni .. image:: https://img.shields.io/pypi/pyversions/pydra-afni.svg :target: https://pypi.python.org/pypi/pydra-afni/ :alt: Supported Python versions @@ -14,10 +14,10 @@ Pydra task package for afni :alt: Latest Version -This package contains a collection of Pydra task interfaces for the afni toolkit. -The basis of this collection has been formed by the semi-automatic conversion of -existing `Nipype `__ interfaces to Pydra using the -`Nipype2Pydra `__ tool +This package contains a collection of Pydra task interfaces for the `AFNI `__ +software toolkit. The basis of this collection has been formed by the semi-automatic +conversion of existing `Nipype `__ interfaces to Pydra +using the `Nipype2Pydra `__ tool Automatically-generated vs manually-curated tasks @@ -26,8 +26,7 @@ Automatically-generated vs manually-curated tasks Automatically generated tasks can be found in the `pydra.tasks.afni.auto` package. 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.afni.v*` packages, corresponding to the version of the afni toolkit -they are designed for. +`pydra.tasks.afni.v*` packages, corresponding to the version of AFNI they are designed for. Tests ----- @@ -39,7 +38,8 @@ the necessary dependencies to run the tests $ pip install -e .[test] -Then the tests, including `doctests` `__, can be launched using +Then the tests, including `doctests` `__, +can be launched using .. code-block:: @@ -71,6 +71,14 @@ Contributing to this package Developer installation ~~~~~~~~~~~~~~~~~~~~~~ +Install the `fileformats `__ packages +corresponding to AFNI specific file formats + + +.. code-block:: + + $ pip install -e ./related-packages/fileformats[dev] + $ pip install -e ./related-packages/fileformats-extras[dev] Install repo in developer mode from the source directory and install pre-commit to ensure consistent code-style and quality. @@ -78,7 +86,7 @@ ensure consistent code-style and quality. .. code-block:: $ pip install -e .[test,dev] -$ pre-commit install + $ pre-commit install Next install the requirements for running the auto-conversion script and generate the Pydra task interfaces from their Nipype counterparts