Skip to content

Commit 2e6ba4f

Browse files
AldoGlimacocco
authored andcommitted
test: added a test for the jupyter notebooks in the examples folder in the CIs
small fix small fix fix
1 parent 81e4770 commit 2e6ba4f

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

.github/workflows/docs.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- opensource
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
test-notebooks-examples:
12+
continue-on-error: True
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 30
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
- uses: actions/setup-python@master
19+
with:
20+
python-version: 3.7
21+
- name: Install dependencies
22+
run: |
23+
pip install -e ."[dev]"
24+
25+
- name: Notebook tests
26+
run: |
27+
tox -e py3.7-nb

Makefile

+6-11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ black: ## apply black formatting
1212
black-check: ## check black formatting
1313
black --check --verbose dadapy tests
1414

15+
flake8: ## check style with flake8
16+
flake8 dadapy/base.py dadapy/metric_comparisons.py dadapy/clustering.py dadapy/id_estimation.py dadapy/density_estimation tests #dev_scripts examples
17+
1518
# to include the "dadapy" folder: pytest tests --doctest-modules dadapy tests/
1619
test: ## run tests quickly with the default Python
1720
pytest tests --doctest-modules tests/ \
@@ -23,20 +26,12 @@ test: ## run tests quickly with the default Python
2326
test-all: ## run tests on every Python version with tox
2427
tox
2528

29+
test-nb: ## test notebooks in the examples folder
30+
pytest examples/notebook_on_intrinsicdim_densityest_clustering.ipynb examples/notebook_on_information_imbalance.ipynb --nbmake --nbmake-timeout=300
31+
2632
coverage: ## check code coverage quickly with the default Python
2733
coverage run --source dadapy -m pytest
2834
coverage report -m
2935
coverage html
3036
$(BROWSER) htmlcov/index.html
3137

32-
flake8: ## check style with flake8
33-
flake8 dadapy/base.py dadapy/metric_comparisons.py dadapy/clustering.py dadapy/id_estimation.py dadapy/density_estimation.py tests #dev_scripts examples
34-
35-
#pylint: ## run pylint
36-
# pylint dadapy tests
37-
#
38-
#vulture: ## run vulture
39-
# vulture dadapy dev_scripts/whitelist.py
40-
#
41-
#darglint: ## run vulture
42-
# darglint dadapy

tox.ini

+8
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,11 @@ deps =
7070
pydocstyle
7171
commands =
7272
flake8 dadapy/base.py dadapy/metric_comparisons.py dadapy/clustering.py dadapy/id_estimation.py dadapy/density_estimation.py tests
73+
74+
[testenv:py3.7-nb]
75+
basepython = python3.7
76+
deps =
77+
pytest>=6.2.5,<6.3.0
78+
nbmake>=1.2,<1.3
79+
commands:
80+
pytest examples/notebook_on_intrinsicdim_densityest_clustering.ipynb examples/notebook_on_information_imbalance.ipynb --nbmake --nbmake-timeout=300

0 commit comments

Comments
 (0)