[DOC] ASR: fix numpydoc docstring rendering#119
Open
sappelhoff wants to merge 1 commit into
Open
Conversation
Three malformed numpydoc constructs rendered incorrectly in the Sphinx API docs: - clean_windows had a free-text paragraph inside the Parameters block, which numpydoc parsed as four garbage "parameters" (tuned., want, consider, data.); moved it to a Notes section. - ASR Attributes wrapped the names in double backticks (``zi_`` etc.), so the literal backticks showed in the rendered attribute headings. - cutoff in ASR and asr_calibrate used "cutoff:" (no space before the colon), which is not valid numpydoc name/type syntax. Add a regression test that parses the docstrings with numpydoc and checks that documented parameters match the signature and attribute names carry no markup.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #119 +/- ##
=======================================
Coverage 83.10% 83.10%
=======================================
Files 25 25
Lines 2818 2818
=======================================
Hits 2342 2342
Misses 476 476 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three malformed numpydoc constructs in
meegkit/asr.pyrendered incorrectly in the Sphinx API docs.1.
clean_windowsparameter list mangledA free-text paragraph sat inside the
Parametersblock. numpydoc parsed each line as aname (type)entry, producing four garbage "parameters" and disrupting the real ones:Moved that guidance to a
Notessection; all documented parameters now render correctly.2.
ASRattribute names showed literal backticksAttributeswrapped names in double backticks (``zi_``,``ab_``,``cov_``,``state_``), so the backticks appeared verbatim in the rendered headings. Changed to plainzi_ : array, ....3.
cutoff:missing space before coloncutoff:(inASRandasr_calibrate) is not valid numpydocname : typesyntax. Changed tocutoff : float.Verification
test_docstring_parameters,test_docstring_attributes) that parses the docstrings with numpydoc; it fails on the original docstrings and passes after the fix.tests/test_asr.pypasses;ruffclean.