Reconcile the drifted parameter docstrings - #212
Merged
Conversation
The rendered API listed `ransac`, `channel_wise` and `matlab_strict` as `bool | None` in twelve places. All twelve have a plain bool default and never accept `None`, so a reader was told they could pass it. The four entries that keep `bool | None` are the ones in `find_all_bads`, where `None` really does mean "use the value from instantiation".
`ransac`, `random_state`, `matlab_strict` and `reject_by_annotation` are each documented in several places, and the copies had drifted apart. The `PrepPipeline` and `Reference` copies of `ransac` had lost the sentence warning that RANSAC slows detection down considerably; three copies of `random_state` pointed at "RandomState" without linking it and left every literal unmarked; `Reference` neither marked up the `matlab_strict` default nor linked the page listing the differences it turns off; and its `reject_by_annotation` no longer said what `'omit'` does to the data or why one would ask for it. Each site keeps the opening sentence that is genuinely its own: what the seed is used for differs between the pipeline, the reference and RANSAC, and `matlab_strict` is described in terms of the code the reader is looking at.
The wording fixes need no entry, but a user reading the rendered API was told that three boolean flags accept `None`.
sappelhoff
force-pushed
the
reconcile-parameter-docs
branch
from
August 21, 2026 09:37
af89c6d to
9577130
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
=======================================
Coverage 98.03% 98.03%
=======================================
Files 8 8
Lines 864 864
=======================================
Hits 847 847
Misses 17 17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Documentation only — no change to behaviour, signatures or defaults.
Several parameters are documented in more than one place, because their
descriptions were copy-pasted between
NoisyChannels,PrepPipeline,Reference,find_bad_by_ransacandremoveTrend. The copies have sincedrifted: markup was lost, a cross-reference was dropped, and one type string
is wrong in twelve places. This reconciles them.
Type strings
ransac,channel_wiseandmatlab_strictwere rendered asbool | Noneintwelve places. All twelve have a plain bool default and never accept
None, sothe API docs told the reader they could pass it. They now say
bool.The entries that keep
bool | Noneare the ones inNoisyChannels.find_all_bads, whereNonereally does mean "use the valuefrom instantiation", or where the parameter is documented as ignored.
Prose
ransacinPrepPipelineandReferencehad lost the sentence warning thatRANSAC slows noisy channel detection down considerably, and left its default
unmarked.
random_stateinPrepPipeline,Referenceandfind_bad_by_ransacsaid"see RandomState for details" without linking anything, and marked up none of
its literals. All three now link
~numpy.random.RandomState.matlab_strictinReferencewas the only description of that flag in thepackage that did not point at
:ref:matlab-diffs``, the page listing theimprovements it turns off.
reject_by_annotationinReferenceno longer said what'omit'does to thedata or why one would ask for it.
interpolate_badsinPrepPipeline.robust_referencenow names thealternative to interpolating, as the
Referencecopy already did.Each site keeps the opening sentence that is genuinely its own: what the random
seed is used for differs between the pipeline, the reference and RANSAC, and
matlab_strictis described in terms of the code the reader is looking at("PyPREP", "RANSAC", "detrending").
The wording fixes get no changelog entry, but the type strings do: a user
reading the rendered API was told three boolean flags accept
None.Open questions
quiet-logging-by-default, notmain. Do not configure logging when pyprep is imported #211 is still open andtouches two of the same files, though not these lines. Retarget to
mainonce it lands.
right for numpydoc — a reader of
NoisyChannels.__init__wants the textinline, not a pointer elsewhere. Deduplicating for real means an MNE-style
docdict+fill_docsubstituting one canonical string at import time,which is a separate and much larger change. Until then these copies can drift
again.
{int, None} | Noneand{None, 'omit'} | Noneleft alone. The trailing| Noneis redundant in both, and in every similar type string in thepackage. Untangling that is its own decision, not part of a wording fix.
PrepPipeline.robust_referencedocumentsmax_iterationsby deferring to theprep_paramsdict, whileReferencestates the number outright. Bothreadings are defensible for their own call signature, so neither was touched.
channel_wiseandmax_chunk_sizedrop the "has no effect if not using RANSAC" clause insidethe RANSAC functions themselves, and the private RANSAC helpers do not render
in the docs at all.
Verification
pytest(61 passed),pre-commit run --all-files, and a cleanmake htmlindocs/with no warnings.