Skip to content

Commit

Permalink
ci: use python to download checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
BioGeek committed Aug 22, 2024
1 parent a4738a2 commit 3761808
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/pytest-multiversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Test notebooks on Windows
if: ${{ matrix.os }} == windows-latest
- name: Test notebooks
run: |
$env:PYDEVD_DISABLE_FILE_VALIDATION=1; python -m ipykernel install --user --name instanovo
pytest --nbmake "./notebooks" --nbmake-kernel=instanovo --nbmake-timeout=10000
- name: Test notebooks on Linux
if: ${{ matrix.os }} != windows-latest
run: |
PYDEVD_DISABLE_FILE_VALIDATION=1 python -m ipykernel install --user --name instanovo
if [ ${{ matrix.os }} == 'windows-latest' ]; then
$env:PYDEVD_DISABLE_FILE_VALIDATION=1; python -m ipykernel install --user --name instanovo
else
PYDEVD_DISABLE_FILE_VALIDATION=1 python -m ipykernel install --user --name instanovo
fi
pytest --nbmake "./notebooks" --nbmake-kernel=instanovo --nbmake-timeout=10000
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,5 @@ docs_public/
logs/
mlruns/
notebooks/checkpoints
notebooks/predictions.csv
secrets/
16 changes: 10 additions & 6 deletions notebooks/getting_started_with_instanovo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"import torch\n",
"import os\n",
"import numpy as np\n",
"import pandas as pd"
"import pandas as pd\n",
"import urllib.request"
]
},
{
Expand Down Expand Up @@ -127,8 +128,11 @@
"outputs": [],
"source": [
"# Download checkpoint locally\n",
"!mkdir checkpoints/\n",
"!wget -nc https://github.com/instadeepai/InstaNovo/releases/download/0.1.4/instanovo_yeast.pt -P ./checkpoints/"
"os.makedirs('checkpoints', exist_ok=True)\n",
"url = \"https://github.com/instadeepai/InstaNovo/releases/download/0.1.4/instanovo_yeast.pt\"\n",
"file_path = os.path.join('checkpoints', 'instanovo_yeast.pt')\n",
"if not os.path.exists(file_path):\n",
" urllib.request.urlretrieve(url, file_path)"
]
},
{
Expand Down Expand Up @@ -838,9 +842,9 @@
"provenance": []
},
"kernelspec": {
"display_name": "instanovo-py3.8",
"display_name": "instanovo",
"language": "python",
"name": "instanovo-py3.8"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -852,7 +856,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.9"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 3761808

Please sign in to comment.