-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action for notebooks (#26)
* add github action for notebooks * update dependencies * fix notebooks * fix other issues * test adding requirement * fix another bug
- Loading branch information
Showing
13 changed files
with
59,532 additions
and
59,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Test tutorials | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tutorials: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
|
||
- name: Install packages | ||
run: | | ||
sudo apt-get install -y rename | ||
python -m pip install --upgrade pip wheel setuptools | ||
python -m pip install -r requirements/tutorials.txt | ||
python -m pip list | ||
- name: Prepare notebooks | ||
run: | | ||
# go into tutorial location | ||
cd tutorials | ||
# convert each notebook into a python file | ||
jupyter nbconvert --to script *.ipynb | ||
# rename the files so they are found by pytest: add 'test' at the beginning | ||
rename 's/(.*)\.py/test $1.py/' * | ||
# rename the files so they are found by pytest: change spaces to underscores | ||
rename 's/ /_/g' test* | ||
# modify each file by adding one level of indentation to each line | ||
sed -i 's/^/ /' test*.py | ||
# modify each file by adding 'def test_func():' at the top | ||
sed -i '1s;^;def test_func():\n;' test*.py | ||
- name: Test tutorial notebooks | ||
run: | | ||
# run pytest ONLY on the tutorials | ||
cd tutorials | ||
pytest --color=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
HypergraphAnalysisToolbox | ||
hypergraphx | ||
hypernetx | ||
hypernetx>=2.3.10 | ||
networkx | ||
xgi | ||
requests | ||
xgi>=0.9.1 | ||
requests | ||
jupyter>=1.0 | ||
ipython<=8.12.0 | ||
nx_hif | ||
rich |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.