Repository navigation
Commit 1fcfbfd
authored
[DOC] ASR: fix numpydoc docstring rendering (#119)
Three malformed numpydoc constructs in `meegkit/asr.py` rendered
incorrectly in the Sphinx API docs.
### 1. `clean_windows` parameter list mangled
A free-text paragraph sat *inside* the `Parameters` block. numpydoc
parsed each line as a `name (type)` entry, producing four garbage
"parameters" and disrupting the real ones:
```
tuned. (The following are detail parameters that usually do not have to be)
want (If you can't get the function to do what you)
consider (you might)
data. (adapting these to your)
```
Moved that guidance to a `Notes` section; all documented parameters now
render correctly.
### 2. `ASR` attribute names showed literal backticks
`Attributes` wrapped names in double backticks (```` ``zi_`` ````, ````
``ab_`` ````, ```` ``cov_`` ````, ```` ``state_`` ````), so the
backticks appeared verbatim in the rendered headings. Changed to plain
`zi_ : array, ...`.
### 3. `cutoff:` missing space before colon
`cutoff:` (in `ASR` and `asr_calibrate`) is not valid numpydoc `name :
type` syntax. Changed to `cutoff : float`.
### Verification
- Built the API docs before/after: all parameters and attributes render
correctly, no build warnings.
- Added a regression test (`test_docstring_parameters`,
`test_docstring_attributes`) that parses the docstrings with numpydoc;
it fails on the original docstrings and passes after the fix.
- Full `tests/test_asr.py` passes; `ruff` clean.1 parent 752f7b2 commit 1fcfbfd
2 files changed
Lines changed: 31 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | 289 | | |
295 | 290 | | |
296 | 291 | | |
| |||
316 | 311 | | |
317 | 312 | | |
318 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
| |||
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
435 | | - | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
25 | 43 | | |
26 | 44 | | |
27 | 45 | | |
| |||
0 commit comments