Skip to content

Commit fb7f327

Browse files
authored
Always re-execute example notebooks / use myst-nb (#144)
* Current example notebooks are terribly outdated. Run them on every pull request, to stay in sync with the library. * Use myst-nb instead of nbsphinx (more actively developed, fewer dependency problems) * Exclude outdated examples for now * Use m2r2 instead of unmaintained m2r for markdown parsing
1 parent 0648b0c commit fb7f327

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

doc/conf.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@
5050
'sphinx.ext.autosummary',
5151
'sphinx.ext.intersphinx',
5252
'sphinx.ext.viewcode',
53-
'myst_parser',
5453
'sphinx_markdown_tables',
55-
'nbsphinx',
54+
'myst_nb',
5655
]
5756

5857
intersphinx_mapping = {
@@ -73,6 +72,9 @@
7372
'build/html',
7473
'**.ipynb_checkpoints',
7574
'logo/LICENSE.md',
75+
# TODO update and un-exclude
76+
'example/example_visualization.ipynb',
77+
'example/example_visualization_without_visspec.ipynb',
7678
]
7779

7880
master_doc = 'index'
@@ -90,10 +92,14 @@
9092
# For some reason causes sphinx import errors otherwise
9193
autodoc_mock_imports = ['yaml']
9294

95+
# myst_nb options
96+
# https://myst-nb.readthedocs.io/en/latest/configuration.html
97+
nb_execution_mode = "force"
98+
99+
93100
source_suffix = {
94101
'.rst': 'restructuredtext',
95102
'.txt': 'restructuredtext',
96-
'.md': 'markdown',
97103
}
98104

99105
# ignore numpy warnings

doc/example.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ The following examples should help to get a better idea of how to use the PEtab
99
:maxdepth: 1
1010

1111
example/example_petablint.ipynb
12-
example/example_visualization.ipynb
13-
example/example_visualization_without_visspec.ipynb
1412
example/example_visualization_with_visspec.ipynb
1513

1614
Examples of systems biology parameter estimation problems specified in PEtab

doc/md2rst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import m2r
1+
import m2r2
22
import re
33

44

@@ -26,7 +26,7 @@ def absolute_links(txt):
2626

2727
def md2rst(source: str, target: str):
2828
txt = absolute_links(read(source))
29-
txt = m2r.convert(txt)
29+
txt = m2r2.convert(txt)
3030
with open(target, 'w') as f:
3131
f.write(txt)
3232

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,9 @@ def absolute_links(txt):
8383
'sphinxcontrib-napoleon>=0.7',
8484
'sphinx-markdown-tables>=0.0.15',
8585
'sphinx-rtd-theme>=0.5.1',
86-
'myst-parser>=0.16.1',
87-
'nbsphinx>=0.8.2',
88-
'm2r>=0.2.1',
86+
'm2r2',
87+
'myst-nb>=0.14.0',
8988
'ipython>=7.21.0',
90-
# https://github.com/spatialaudio/nbsphinx/issues/641
91-
'Jinja2==3.0.3',
9289
]
9390
}
9491
)

0 commit comments

Comments
 (0)