Skip to content

Commit 5dd6364

Browse files
committed
Add mktestdocs
1 parent 9201373 commit 5dd6364

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

docs/tutorial/simple_fit.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ We'll also import the function `fit` from pyEllis fitting module.
2323
This is a function decorator, which we will use to display our interactive fitting widget.
2424

2525
```python
26+
import numpy as np
2627
import elli
2728
from elli.fitting import ParamsHist, fit
2829
```
@@ -105,6 +106,7 @@ In the last step we just need to evaluate our model for a set of wavelengths (`l
105106
Additionally, we need the specify the solver (`elli.Solver2x2` in this case).
106107

107108
```python
109+
lbda = np.linspace(210, 800, 100)
108110
structure.evaluate(lbda, ANGLE, solver=elli.Solver2x2)
109111
```
110112

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ dev = [
5151
"nbmake",
5252
"ruff==0.8.5",
5353
"pre-commit",
54+
"mktestdocs>=0.2.5",
5455
]
5556
docs = [
5657
"mkdocs-material",

tests/test_docs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import os
2+
import pathlib
3+
4+
from mktestdocs import check_md_file
5+
6+
7+
def test_simple_fit():
8+
proj_dir = pathlib.Path(__file__).resolve().parent / ".."
9+
os.chdir(proj_dir / "examples" / "Basic Usage")
10+
fpath = proj_dir / "docs" / "tutorial" / "simple_fit.md"
11+
check_md_file(fpath=fpath, memory=True)

uv.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)