Skip to content

Bump actions/setup-python from 4 to 5 (#9) #145

Bump actions/setup-python from 4 to 5 (#9)

Bump actions/setup-python from 4 to 5 (#9) #145

Workflow file for this run

name: Run notebooks
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * 1"
jobs:
run-notebooks:
strategy:
matrix:
nb: [
{title: quickstart, name: TorchIO_tutorial},
{title: "brain parcellation", name: Brain_parcellation_with_TorchIO_and_HighRes3DNet},
{title: transforms, name: Data_preprocessing_and_augmentation_using_TorchIO_a_tutorial},
{title: frameworks, name: TorchIO_MONAI_PyTorch_Lightning},
]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
pip install ipython ipykernel papermill
ipython kernel install --name "python3" --user
- name: Decrease RAM usage
run: |
PARC_NB="notebooks/Brain_parcellation_with_TorchIO_and_HighRes3DNet.ipynb"
sed -i 's/tio.Crop((0, 0, 10, 30, 40, 40))/tio.Crop((60, 60, 90, 110, 100, 100))/g' $PARC_NB
sed -i 's/patch_size = 128/patch_size = 32/g' $PARC_NB
- name: Run ${{ matrix.nb.title }} notebook
run: |
IN_PATH=notebooks/${{ matrix.nb.name }}.ipynb
OUT_PATH=${{ matrix.nb.name }}_output.ipynb
papermill \
--no-progress-bar \
--log-output \
$IN_PATH $OUT_PATH