Commit a455b00
committed
Documentation accuracy pass: 83 docstring fixes, Sphinx repairs, runnable examples
An audit compared every constructor signature against its numpydoc block,
attempted all 72 example scripts, and built the Sphinx site. No runtime
behavior changes: an executable-AST comparison confirms the 43 touched model
modules differ only in docstrings.
Docstrings (83 fixes across 43 modules):
- Removed seven documented constructor parameters that do not exist and raise
TypeError if passed: GMM.verbose, GMM.verbose_interval,
RGraph.active_support_params, RGraph.random_state,
SUOD.cost_forecast_loc_fit/_pred, and LUNAR.n_neighbors (the real keyword is
the British spelling n_neighbours; the entry is renamed with a note).
- Corrected documented defaults that disagreed with the signature, among them
ABOD.n_neighbors 10->5, ALAD.epochs 500->200, ALAD.preprocessing True->False,
AnoGAN.learning_rate_query 0.001->0.01, RGraph.transition_steps 20->10, and
DIF.hidden_neurons, documented as [64,32] while the constructor substitutes
[500,100].
- Documented public parameters that had no entry, and corrected labels_, typed
as int in BaseDetector and every detector that copied the wording when it is
a numpy array, plus XGBOD.labels_, which claimed threshold_ is applied to
decision_scores_ when fit() never sets threshold_.
- Disclosed CBLOF.n_jobs as accepted-but-unused (see #713).
Sphinx:
- Enabled sphinx.ext.napoleon, absent since numpydoc style was adopted, so
every Parameters/Attributes heading was parsed as an RST section title. A
full build goes from 310 warnings and 242 class="problematic" spans to 41
and 5, and the :attr: links for decision_scores_ and labels_ resolve for the
first time.
- Enabling it also exposed five docstrings the parser could not read, inert
text until now: AnoGAN emitted 1 of 16 parameters, RGraph 5 of 16, DIF 30
fields for an 11-parameter constructor, XGBOD turned a commented-out block
into four bogus parameters, and so_gaal_new.SO_GAAL had an entirely empty
Parameters section. All five repaired; a sweep over all 62 detectors now
parses every documented parameter with no bogus or missing entries.
- Removed the dead pyod.models.auto_encoder_torch section (module deleted in
2024; a duplicated :exclude-members: made the directive raise
DuplicateOptionError, which Sphinx stripped, so the page rendered a bare
heading) and de-duplicated the pyod.models.base automodule.
Entry points:
- The README quick start called clf.fit(X_train) without defining X_train and
used visualize without importing it, so the block on the GitHub landing page
and the PyPI description raised NameError when pasted.
- docs/install.rst documented a pytorch extra that does not exist (pip treats
an unknown extra as a warning, so the command succeeded while installing
none of the PyTorch stack), omitted nine real extras and pyod[all], claimed
the MCP server registers seven tools when it registers ten, and advertised
Claude Desktop support for a command no code path targets.
Examples: fixed runtime failures in mad_example.py (two features for a
univariate-only detector) and qmcd_example.py (appended ground-truth labels to
the feature matrix before predict, raising and leaking test labels).
mat_file_conversion.py now byte-compiles after removal of mid-file Python 2
__future__ imports.
Deferred to separate issues, since each needs a runtime decision: #713
(CBLOF.n_jobs), #714 (DevNet unused parameters including random_state), #715
(pyod info infers Claude Code from a directory it creates itself).
Full suite: 1532 passed, 0 failed. Reviewed via /implement-review (Codex round
6), which caught that enabling Napoleon had silently broken four docstrings --
a failure mode that produces no "problematic" markup and so was invisible to
the metric used to validate the change.1 parent 4b4fbbb commit a455b00
54 files changed
Lines changed: 285 additions & 178 deletions
File tree
- docs
- examples
- examples
- data
- pyod/models
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
733 | 743 | | |
734 | 744 | | |
735 | 745 | | |
| |||
767 | 777 | | |
768 | 778 | | |
769 | 779 | | |
770 | | - | |
| 780 | + | |
771 | 781 | | |
772 | 782 | | |
773 | | - | |
| 783 | + | |
774 | 784 | | |
775 | 785 | | |
776 | 786 | | |
777 | 787 | | |
| 788 | + | |
| 789 | + | |
778 | 790 | | |
779 | 791 | | |
780 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments