Skip to content

Commit a9eaf33

Browse files
authored
run modified notebooks (#117)
1 parent 3e175fe commit a9eaf33

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

.github/workflows/pep8.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@ jobs:
1515
pep8:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
- name: Set up Python 3.8
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v3
2121
with:
2222
python-version: 3.8
2323
- name: cache weekly timestamp
2424
id: pip-cache
2525
run: |
2626
echo "::set-output name=datew::$(date '+%Y-%V')"
2727
- name: cache for pip
28-
uses: actions/cache@v2
28+
uses: actions/cache@v3
2929
id: cache
3030
with:
3131
path: ~/.cache/pip
3232
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
3333
- name: Install dependencies
3434
run: |
3535
python -m pip install --upgrade pip wheel
36+
python -m pip install -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt
3637
python -m pip install -r requirements.txt
3738
- name: PEP8 check
3839
run: |

.github/workflows/test-modified.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: build
2+
3+
on:
4+
# quick tests of modified notebooks for every pull request
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
concurrency:
11+
# automatically cancel the previously triggered workflows when there's a newer version
12+
group: build-gpu-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
if: github.repository == 'Project-MONAI/tutorials'
18+
container:
19+
image: nvcr.io/nvidia/pytorch:21.06-py3 # CUDA 11.3
20+
options: "--gpus 0"
21+
runs-on: [self-hosted, linux, x64]
22+
steps:
23+
- name: Install MONAI
24+
id: monai-install
25+
run: |
26+
which python
27+
python -m pip install --upgrade pip wheel
28+
BUILD_MONAI=0 python -m pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI
29+
python -m pip install -r https://raw.githubusercontent.com/Project-MONAI/MONAI/main/requirements-dev.txt
30+
- uses: actions/checkout@v3
31+
- name: Notebook quick check
32+
shell: bash
33+
run: |
34+
git fetch origin main
35+
python -m pip install -r requirements.txt; python -m pip list
36+
git diff --name-only origin/main | while read line; do if [[ $line == *.ipynb ]]; then ./runner.sh -p "-and -wholename './${line}'"; fi; done;
37+
# [[ $line == *.ipynb ]] && ./runner.sh --file "$line"

modules/2d_slices_from_3d_training.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Training with 2D slices from volumes\n",
88
"\n",
9-
"This tutorial shows how to train a network with 2D samples from 3D inputs.\n",
9+
"This tutorial shows how to train a network with 2D slice samples from 3D inputs.\n",
1010
"\n",
1111
"It mainly demonstrates 2d slice dataset using `monai.data.PatchIterd` and `monai.data.GridPatchDataset`.\n",
1212
"\n",

runner.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ do
141141
failfast=true
142142
;;
143143
-p|--pattern)
144-
pattern="$2"
144+
pattern+="$2"
145+
echo $pattern
145146
shift
146147
;;
147148
-k|--kernelspec)

0 commit comments

Comments
 (0)