Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tox.ini: find Notebooks to run with nbval-lax using unix find cmd (WIP) #363

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TestNotebooks/MiscTests/MuMoTtest_1dstream.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
2 changes: 1 addition & 1 deletion TestNotebooks/MiscTests/MuMoTtest_3dstream.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
2 changes: 1 addition & 1 deletion TestNotebooks/MiscTests/MuMoTtest_GreekLetters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.4"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
63 changes: 30 additions & 33 deletions TestNotebooks/MiscTests/MuMoTtest_MasterEq.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Created `%%model` as an alias for `%%latex`.\n"
]
},
{
"data": {
"text/plain": [
"'1.0.0'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import mumot\n",
"\n",
Expand All @@ -20,15 +38,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"%%model\n",
"$\n",
"model1_str = (r\"\"\"\n",
"A -> B : k_1\n",
"B -> A : k_2\n",
"$"
"\"\"\")"
]
},
{
Expand All @@ -37,7 +54,7 @@
"metadata": {},
"outputs": [],
"source": [
"model1 = mumot.parseModel(In[2])"
"model1 = mumot.parseModel(model1_str)"
]
},
{
Expand Down Expand Up @@ -118,8 +135,7 @@
"metadata": {},
"outputs": [],
"source": [
"%%model\n",
"$\n",
"model2 = mumot.parseModel(r\"\"\"\n",
"U -> A : g_1\n",
"U -> B : g_2\n",
"A -> U : a_1\n",
Expand All @@ -128,16 +144,7 @@
"B + U -> B + B : r_2\n",
"A + B -> A + U : s_1\n",
"A + B -> B + U : s_2\n",
"$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"model2 = mumot.parseModel(In[12])"
"\"\"\")"
]
},
{
Expand Down Expand Up @@ -308,8 +315,7 @@
"metadata": {},
"outputs": [],
"source": [
"%%model\n",
"$\n",
"model4 = mumot.parseModel(r\"\"\"\n",
"U -> A : g_1\n",
"U -> B : g_2\n",
"U -> C : g_3\n",
Expand All @@ -325,16 +331,7 @@
"A + C -> C + U : s_4\n",
"B + C -> B + U : s_5\n",
"B + C -> C + U : s_6\n",
"$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"model4 = mumot.parseModel(In[44])"
"\"\"\")"
]
},
{
Expand Down Expand Up @@ -516,7 +513,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.4"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
2 changes: 1 addition & 1 deletion TestNotebooks/MiscTests/MuMoTtest_MultiController.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
16 changes: 3 additions & 13 deletions TestNotebooks/MiscTests/MuMoTtest_bifurcation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"metadata": {},
"outputs": [],
"source": [
"%%model\n",
"$\n",
"model1 = mumot.parseModel(r\"\"\"\n",
"U -> A : g_A\n",
"U -> B : g_B\n",
"A -> U : a_A\n",
Expand All @@ -34,16 +33,7 @@
"B + U -> B + B : r_B\n",
"A + B -> A + U : s\n",
"A + B -> B + U : s\n",
"$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"model1 = mumot.parseModel(In[2])"
"\"\"\")"
]
},
{
Expand Down Expand Up @@ -151,7 +141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.4"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
2 changes: 1 addition & 1 deletion TestNotebooks/MuMoTtest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
28 changes: 11 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,20 @@ commands =

; Ensure the user manual Notebook runs *without errors* (do not check for regressions yet)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=120 docs/MuMoTuserManual.ipynb
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=600 docs/MuMoTuserManual.ipynb

; Ensure test Notebooks runs *without errors* (do not check for regressions yet)
; Ensure test Notebooks run *without errors* (do not check for regressions yet)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=120 --cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" --cov-append \
TestNotebooks/MuMoTtest.ipynb \
TestNotebooks/MiscTests/MuMoTtest_GreekLetters.ipynb \
TestNotebooks/MiscTests/MuMoTtest_MultiController.ipynb \
TestNotebooks/MiscTests/MuMoTtest_NoiseFixedPoints.ipynb \
TestNotebooks/MiscTests/MuMoTtest_oneDimensionalModels.ipynb

; Additional example Notebooks (TODO; leave commented)
; TestNotebooks/MiscTests/MuMoTtest_MasterEq.ipynb - currently hangs after showNoiseEqs() for second model?
; TestNotebooks/MiscTests/MuMoTtest_bifurcation.ipynb
; TestNotebooks/MiscTests/MuMoTuserManual_for_LabPresentation.ipynb
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=600 \
--cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" TestNotebooks

; Ensure the user manual and regression test Notebooks do not show regressions (TODO; leave commented)
; Ensure demo Notebooks run *without errors* (do not check for regressions yet)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
; pytest --verbose --maxfail=1 --nbval --nbval-cell-timeout=120 --cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" --cov-append TestNotebooks/MuMoTtest.ipynb
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=600 DemoNotebooks

; Ensure the main regression test Notebook does not show regressions (TODO; leave commented)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
; pytest --verbose --maxfail=1 --nbval --nbval-cell-timeout=600 --cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" --cov-append TestNotebooks/MuMoTtest.ipynb

; Check user manual does not contain output cells
bash -c 'test $(nbshow --outputs docs/MuMoTuserManual.ipynb | wc -c) -eq 0'
Expand All @@ -54,8 +49,7 @@ source = mumot
; Do not calculate coverage of third-party code.
; (NB here this is the _installed_ code in the hidden virtualenv created by tox,
; not the source code of the package)
omit =
*/site-packages/mumot/gen/*
; omit =

; Used by pytest-cov
[report]
Expand Down