Skip to content

Commit 1af1a5c

Browse files
authored
Merge pull request #3 from CogStack/CU-2rjxfzj
upgrade medcat to 1.3.0
2 parents 11e497b + 2189b20 commit 1af1a5c

17 files changed

+92613
-92813
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ jobs:
2929
- name: Install dependencies
3030
run: |
3131
pip install -U pip
32-
pip install -r requirements.txt
32+
pip install -r requirements-dev.txt
33+
- name: Install IPython kernel
34+
run: |
35+
python -m ipykernel install --name smoketests
3336
- name: Smoke test tutorial
3437
run: |
3538
pytest --collect-only --nbmake ./notebooks/${{ matrix.part }}
36-
pytest --nbmake --nbmake-timeout=1800 ./notebooks/${{ matrix.part }}
39+
pytest --nbmake -n=auto --nbmake-kernel=smoketests --nbmake-timeout=1800 ./notebooks/${{ matrix.part }}

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ These tutorials expand upon specific aspects of the topics covered across the in
2929

3030
## Development/Editing
3131

32-
Make sure [jupyter](https://docs.jupyter.org/en/latest/install.html) and [jq](https://stedolan.github.io/jq/download/) are installed and available on your path. Modifying the companion HTML version directly is discouraged and instead install the following pre-commit hook which will generate them during committing your change on .ipynb files:
32+
Make sure [jupyter](https://docs.jupyter.org/en/latest/install.html) and [jq](https://stedolan.github.io/jq/download/) are installed and available on your path. Modifying the companion HTML version directly is discouraged and instead install the following pre-commit hook which will generate them during committing your change on `.ipynb` files:
3333
```
3434
git config --local core.hooksPath git-config/hooks
3535
```
36-
To inspect change during code review, visit [Colab](https://colab.research.google.com/github/CogStack/MedCATtutorials/blob) and select the target branch and tutorial. After it is opened, click `File | Revision history` and select start and end revisions you are interested in.
36+
37+
To inspect change during code review, visit [Colab](https://colab.research.google.com/github/CogStack/MedCATtutorials/blob) and select the target branch and tutorial. After it is opened, click `File | Revision history` and select start and end revisions you are interested in.
38+
39+
40+
## Known Issues:
41+
* For ContextualVersionConflict on Google Colab, you need to restart the runtime and run the cell again.
42+
* The pre-commit hook requires nbconvert<6 and jinja2<=3.0.

git-config/hooks/pre-commit

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@ set -eu
44

55
if ! command -v jupyter &> /dev/null
66
then
7-
echo "Warning: Cannot find 'jupyter' on your path so the HTML version won't be created/updated automatically"
8-
echo "Warning: Install 'jupyter' from https://docs.jupyter.org/en/latest/install.html to fix this"
7+
echo "ERROR: Cannot find 'jupyter' on your path so the HTML version won't be created/updated automatically"
8+
echo "ERROR: Install 'jupyter' from https://docs.jupyter.org/en/latest/install.html to fix this"
9+
exit 1
910
elif ! command -v jq &> /dev/null
1011
then
11-
echo "Warning: Cannot find 'jq' on your path so the HTML version won't be created/updated automatically"
12-
echo "Warning: Install 'jq' from https://stedolan.github.io/jq/download/ to fix this"
12+
echo "ERROR: Cannot find 'jq' on your path so the HTML version won't be created/updated automatically"
13+
echo "ERROR: Install 'jq' from https://stedolan.github.io/jq/download/ to fix this"
14+
exit 1
1315
else
1416
notebook_paths=`git diff --cached --name-only --diff-filter=d | grep .ipynb; echo ""`
1517

1618
if [ ! -z "$notebook_paths" ]
1719
then
1820
for path in $notebook_paths
1921
do
20-
# Remove widget states which would fail nbconvert
21-
cat <<< `jq 'del(.metadata.widgets)' $path` > $path
22-
2322
jupyter nbconvert --to html $path
2423
jupyter nbconvert --clear-output --inplace $path
2524
git add ${path/.ipynb/.html}

0 commit comments

Comments
 (0)