Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions aeon/testing/tests/test_api_reference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Tests for API reference documentation completeness."""

from pathlib import Path

import pytest

from aeon.utils.discovery import all_estimators


def test_all_estimators_in_api_reference():
"""Test that all public estimators are listed in the API reference docs."""
repo_root = Path(__file__).resolve().parent.parent.parent.parent
docs_dir = repo_root / "docs" / "api_reference"

if not docs_dir.exists():
pytest.skip(f"API reference directory not found at {docs_dir}.")

doc_files = list(docs_dir.glob("*.rst")) + list(docs_dir.glob("*.md"))

# Collect all stripped lines across all API reference documentation files.
# This ensures estimator names must match a line exactly (e.g. inside an
# autosummary table or code block) rather than passing on substring matches
# or mentions in prose.
doc_lines = set()
for f in doc_files:
for line in f.read_text(encoding="utf-8").splitlines():
doc_lines.add(line.strip())

estimators = all_estimators(include_sklearn=False)
missing = []

for name, klass in estimators:
if name not in doc_lines:
missing.append(f"{name} ({klass.__module__})")

assert not missing, (
f"The following {len(missing)} estimator(s) are missing from the API reference "
f"in {docs_dir}:\n" + "\n".join(f"- {m}" for m in missing)
)
1 change: 1 addition & 0 deletions docs/api_reference/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Clustering Algorithms

KASBA
KShape
TimeSeriesAgglomerative
TimeSeriesKMeans
TimeSeriesKMedoids
TimeSeriesKernelKMeans
Expand Down
2 changes: 2 additions & 0 deletions docs/api_reference/transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ all_tags_for_estimator`` function with the argument ``"transformer"``.
ESMOTE
SMOTE
OHIT
RandomOverSampler
```

### Interval based
Expand Down Expand Up @@ -214,6 +215,7 @@ all_tags_for_estimator`` function with the argument ``"transformer"``.
:template: class.rst

AutoCorrelationSeriesTransformer
CollectionToSeriesWrapper
ClaSPTransformer
DifferenceTransformer
Dobin
Expand Down
Loading