Skip to content

Commit e7d5411

Browse files
authored
Merge pull request #4 from nipype/develop
Debugging GH actions for auto-conversion from Nipype
2 parents b401283 + 21c393e commit e7d5411

File tree

6 files changed

+96
-202
lines changed

6 files changed

+96
-202
lines changed

.github/workflows/ci-cd.yaml

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -107,77 +107,68 @@ jobs:
107107
python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
108108
- name: Test fileformats with pytest
109109
run: |
110-
cd ./fileformats
111-
pytest -sv --cov fileformats.medimage_afni --cov fileformats.extras.medimage_afni --cov-report xml .
110+
pytest ./related-packages -sv --cov fileformats.medimage_afni --cov fileformats.extras.medimage_afni --cov-report xml .
112111
113112
test:
114113
needs: [nipype-conv, fileformats-test]
115114
runs-on: ubuntu-22.04
116115
strategy:
117116
matrix:
118-
python-version: ['3.8'] # '3.11'
117+
python-version: ['3.8', '3.11']
119118
steps:
119+
120120
- name: Removed unnecessary tools to free space
121121
run: |
122122
sudo rm -rf /usr/share/dotnet
123-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
124-
- name: Get Download cache Key
125-
id: cache-key
126-
run: echo "::set-output name=key::afni-linux-ubuntu22_amd64-7.4.1"
127-
- name: Cache FreeSurfer
128-
uses: actions/cache@v2
129-
with:
130-
path: $HOME/downloads/afni
131-
key: ${{ steps.cache-key.outputs.key }}
132-
restore-keys: |
133-
afni-linux-ubuntu22_amd64-7.4.1
134-
- name: Download FreeSurfer
135-
if: steps.cache-key.outputs.key != steps.cache-hit.outputs.key
136-
run: |
137-
mkdir -p $HOME/downloads/afni
138-
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
139-
shell: bash
140-
- name: Install Freesurfer
141-
env:
142-
FREESURFER_LICENCE: ${{ secrets.FREESURFER_LICENCE }}
143-
run: |
144-
pushd $HOME/downloads/afni
145-
tar -zxpf afni-linux-ubuntu22_amd64-7.4.1.tar.gz
146-
mv afni $HOME/
147-
popd
148-
export FREESURFER_HOME=$HOME/afni
149-
source $FREESURFER_HOME/SetUpFreeSurfer.sh
150-
echo $FREESURFER_LICENCE > $FREESURFER_HOME/license.txt
151-
export PATH=$FREESURFER_HOME/bin:$PATH
152-
- uses: actions/checkout@v3
123+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
124+
125+
- name: Checkout repo
126+
uses: actions/checkout@v3
127+
153128
- name: Revert version to most recent tag on upstream update
154129
if: github.event_name == 'repository_dispatch'
155130
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
131+
132+
- name: Install AFNI
133+
run: |
134+
curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_22_64_a_admin.txt
135+
curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_22_64_b_user.tcsh
136+
sudo bash OS_notes.linux_ubuntu_22_64_a_admin.txt 2>&1 | tee o.ubuntu_22_a.txt
137+
156138
- name: Download tasks converted from Nipype
157139
uses: actions/download-artifact@v3
158140
with:
159141
name: converted-nipype
160142
path: pydra/tasks/afni/auto
143+
144+
- name: Show the contents of the auto-generated tasks
145+
run: tree pydra
146+
161147
- name: Strip auto package from gitignore so it is included in package
162148
run: |
163-
sed -i '/\/src\/pydra\/tasks\/afni\/auto/d' .gitignore
149+
sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore
150+
164151
- name: Set up Python ${{ matrix.python-version }}
165152
uses: actions/setup-python@v4
166153
with:
167154
python-version: ${{ matrix.python-version }}
155+
168156
- name: Install build dependencies
169157
run: |
170158
python -m pip install --upgrade pip
159+
171160
- name: Install task package
172161
run: |
173162
pip install "./related-packages/fileformats" "./related-packages/fileformats-extras" ".[test]"
174163
python -c "import pydra.tasks.afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
175164
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
165+
176166
- name: Test with pytest
177167
run: |
178-
pytest -sv --doctest-modules ./pydra/tasks/afni \
179-
--cov pydra.tasks.afni --cov-report xml
180-
- uses: codecov/codecov-action@v3
168+
pytest -sv ./pydra/tasks/afni --cov pydra.tasks.afni --cov-report xml
169+
170+
- name: Upload to CodeCov
171+
uses: codecov/codecov-action@v3
181172
if: ${{ always() }}
182173
with:
183174
files: coverage.xml,./fileformats/coverage.xml

.github/workflows/fileformats-ci-cd.yaml

Lines changed: 0 additions & 132 deletions
This file was deleted.

README.rst

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
===============================
1+
===========================
22
Pydra task package for afni
3-
===============================
3+
===========================
44

55
.. image:: https://github.com/nipype/pydra-afni/actions/workflows/pythonpackage.yaml/badge.svg
66
:target: https://github.com/nipype/pydra-afni/actions/workflows/pythonpackage.yaml
7-
.. .. image:: https://codecov.io/gh/nipype/pydra-afni/branch/main/graph/badge.svg?token=UIS0OGPST7
8-
.. :target: https://codecov.io/gh/nipype/pydra-afni
7+
.. image:: https://codecov.io/gh/nipype/pydra-afni/branch/main/graph/badge.svg?token=UIS0OGPST7
8+
:target: https://codecov.io/gh/nipype/pydra-afni
99
.. image:: https://img.shields.io/pypi/pyversions/pydra-afni.svg
1010
:target: https://pypi.python.org/pypi/pydra-afni/
1111
:alt: Supported Python versions
@@ -14,10 +14,10 @@ Pydra task package for afni
1414
:alt: Latest Version
1515

1616

17-
This package contains a collection of Pydra task interfaces for the afni toolkit.
18-
The basis of this collection has been formed by the semi-automatic conversion of
19-
existing `Nipype <https://github.com/nipy/nipype>`__ interfaces to Pydra using the
20-
`Nipype2Pydra <https://github.com/nipype/nipype2pydra>`__ tool
17+
This package contains a collection of Pydra task interfaces for the `AFNI <https://afni.nimh.nih.gov/>`__
18+
software toolkit. The basis of this collection has been formed by the semi-automatic
19+
conversion of existing `Nipype <https://github.com/nipy/nipype>`__ interfaces to Pydra
20+
using the `Nipype2Pydra <https://github.com/nipype/nipype2pydra>`__ tool
2121

2222

2323
Automatically-generated vs manually-curated tasks
@@ -26,8 +26,7 @@ Automatically-generated vs manually-curated tasks
2626
Automatically generated tasks can be found in the `pydra.tasks.afni.auto` package.
2727
These packages should be treated with extreme caution as they likely do not pass testing.
2828
Generated tasks that have been edited and pass testing are imported into one or more of the
29-
`pydra.tasks.afni.v*` packages, corresponding to the version of the afni toolkit
30-
they are designed for.
29+
`pydra.tasks.afni.v*` packages, corresponding to the version of AFNI they are designed for.
3130

3231
Tests
3332
-----
@@ -39,7 +38,8 @@ the necessary dependencies to run the tests
3938
4039
$ pip install -e .[test]
4140
42-
Then the tests, including `doctests` <https://docs.python.org/3/library/doctest.html>`__, can be launched using
41+
Then the tests, including `doctests` <https://docs.python.org/3/library/doctest.html>`__,
42+
can be launched using
4343

4444
.. code-block::
4545
@@ -71,14 +71,22 @@ Contributing to this package
7171
Developer installation
7272
~~~~~~~~~~~~~~~~~~~~~~
7373

74+
Install the `fileformats <https://arcanaframework.github.io/fileformats/>`__ packages
75+
corresponding to AFNI specific file formats
76+
77+
78+
.. code-block::
79+
80+
$ pip install -e ./related-packages/fileformats[dev]
81+
$ pip install -e ./related-packages/fileformats-extras[dev]
7482
7583
Install repo in developer mode from the source directory and install pre-commit to
7684
ensure consistent code-style and quality.
7785

7886
.. code-block::
7987
8088
$ pip install -e .[test,dev]
81-
$ pre-commit install
89+
$ pre-commit install
8290
8391
Next install the requirements for running the auto-conversion script and generate the
8492
Pydra task interfaces from their Nipype counterparts

pydra/tasks/afni/latest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
PACKAGE_VERSION = "v1"
1+
PACKAGE_VERSION = "v24_0_12"
22

3-
from .v1 import * # noqa
3+
from .v24_0_12 import * # noqa

related-packages/fileformats-extras/fileformats/extras/medimage_afni/__init__.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33
import typing as ty
44
from random import Random
5-
from fileformats.core import FileSet
5+
from fileformats.core import FileSet, SampleFileGenerator
66
from fileformats.medimage_afni import (
77
OneD,
88
Head,
@@ -16,58 +16,46 @@
1616
@FileSet.generate_sample_data.register
1717
def gen_sample_oned_data(
1818
oned: OneD,
19-
dest_dir: Path,
20-
seed: ty.Union[int, Random] = 0,
21-
stem: ty.Optional[str] = None,
19+
generator: SampleFileGenerator,
2220
) -> ty.Iterable[Path]:
2321
raise NotImplementedError
2422

2523

2624
@FileSet.generate_sample_data.register
2725
def gen_sample_head_data(
2826
head: Head,
29-
dest_dir: Path,
30-
seed: ty.Union[int, Random] = 0,
31-
stem: ty.Optional[str] = None,
27+
generator: SampleFileGenerator,
3228
) -> ty.Iterable[Path]:
3329
raise NotImplementedError
3430

3531

3632
@FileSet.generate_sample_data.register
3733
def gen_sample_all1_data(
3834
all1: All1,
39-
dest_dir: Path,
40-
seed: ty.Union[int, Random] = 0,
41-
stem: ty.Optional[str] = None,
35+
generator: SampleFileGenerator,
4236
) -> ty.Iterable[Path]:
4337
raise NotImplementedError
4438

4539

4640
@FileSet.generate_sample_data.register
4741
def gen_sample_r1_data(
4842
r1: R1,
49-
dest_dir: Path,
50-
seed: ty.Union[int, Random] = 0,
51-
stem: ty.Optional[str] = None,
43+
generator: SampleFileGenerator,
5244
) -> ty.Iterable[Path]:
5345
raise NotImplementedError
5446

5547

5648
@FileSet.generate_sample_data.register
5749
def gen_sample_threed_data(
5850
threed: ThreeD,
59-
dest_dir: Path,
60-
seed: ty.Union[int, Random] = 0,
61-
stem: ty.Optional[str] = None,
51+
generator: SampleFileGenerator,
6252
) -> ty.Iterable[Path]:
6353
raise NotImplementedError
6454

6555

6656
@FileSet.generate_sample_data.register
6757
def gen_sample_dset_data(
6858
dset: Dset,
69-
dest_dir: Path,
70-
seed: ty.Union[int, Random] = 0,
71-
stem: ty.Optional[str] = None,
59+
generator: SampleFileGenerator,
7260
) -> ty.Iterable[Path]:
7361
raise NotImplementedError

0 commit comments

Comments
 (0)