Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Lint and test workflow
on:
push:
workflow_dispatch:

jobs:
quality:
name: Lint code
runs-on: ubuntu-latest

steps:
- name: Install non-python dependencies
run: |
sudo apt-get install -y graphviz-dev

- name: Setup Python environment
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.6
with:
python-version: "3.10"

- name: yamlfix
run: poetry run poe yamlfix-check

- name: ruff
run: poetry run poe ruff-lint-check

- name: snakefmt
run: poetry run poe snakefmt-check

test:
runs-on: ubuntu-latest
needs: ["quality"]
strategy:
matrix:
python-version: ["3.9", "3.10"]

steps:
- name: Install non-python dependencies
run: |
sudo apt-get install -y graphviz-dev

- name: Set up Python ${{ matrix.python-version }}
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.6
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python environments
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.6
with:
python-version: ${{ matrix.python-version }}
install-library: true

- name: Setup env for autoafids
run: |
echo "AUTOAFIDS_CACHE_DIR=`pwd`/test_data/autoafids_cache_dir" >> $GITHUB_ENV
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the AUTOAFIDS_CACHE_DIR, I think if we combine the dry and wet runs it will be overwritten for the model cache dir in the wet run. Will this be alright or was this section added to cache the setup environment
(dependencies etc.)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this from my code - not longer a conflict!


- name: Test T1w modality
run: |
poetry run autoafids test_data/bids_T1w test_out participant -np

- name: Test T2w modality
run: |
poetry run autoafids test_data/bids_T2w test_out participant --modality T2w -np

- name: Test CT modality
run: |
poetry run autoafids test_data/bids_ct test_out participant --modality ct -np

- name: Test stereotaxy feature with T1w modality
run: |
poetry run autoafids test_data/bids_T1w test_out participant --stereotaxy STN -np

- name: Test stereotaxy feature with T2w modality
run: |
poetry run autoafids test_data/bids_T2w test_out participant --stereotaxy STN --modality T2w -np

- name: Test fidqc feature
run: |
poetry run autoafids test_data/bids_T1w test_out participant --fidqc -np

37 changes: 0 additions & 37 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion autoafids/config/snakebids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pybids_inputs:
- reconstruction
- run

CT:
ct:
filters:
suffix: ct
extension: .nii.gz
Expand Down
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,7 @@ snakefmt = "snakefmt autoafids"
snakefmt-check = "snakefmt --check autoafids"
quality = ["yamlfix", "ruff-lint", "snakefmt"]
quality-check = ["yamlfix-check", "ruff-lint-check", "snakefmt-check"]
test = [
"test_base"
]

[tool.poe.tasks.test_base]
shell = """
python ./autoafids/run.py ./tests/data/ ./tests/data/derivatives/ participant \
-np --force-output
"""

[tool.poe.tasks.yamlfix]
shell = """
Expand Down
Empty file.
Empty file.