From 81a6254d3439d004da911a44ac87a6ef7b7436ce Mon Sep 17 00:00:00 2001 From: GiGiKoneti Date: Sun, 16 Aug 2026 23:07:06 +0530 Subject: [PATCH 1/2] [MNT] Add CI test for correct API entries (#3479) --- aeon/testing/tests/test_api_reference.py | 31 ++++++++++++++++++++++++ docs/api_reference/clustering.rst | 1 + docs/api_reference/transformations.md | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 aeon/testing/tests/test_api_reference.py diff --git a/aeon/testing/tests/test_api_reference.py b/aeon/testing/tests/test_api_reference.py new file mode 100644 index 0000000000..b745788913 --- /dev/null +++ b/aeon/testing/tests/test_api_reference.py @@ -0,0 +1,31 @@ +"""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")) + doc_contents = " ".join([f.read_text(encoding="utf-8") for f in doc_files]) + + estimators = all_estimators(include_sklearn=False) + missing = [] + + for name, klass in estimators: + if name not in doc_contents: + 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) + ) diff --git a/docs/api_reference/clustering.rst b/docs/api_reference/clustering.rst index 2ca50f90b7..44d6c4bf2b 100644 --- a/docs/api_reference/clustering.rst +++ b/docs/api_reference/clustering.rst @@ -22,6 +22,7 @@ Clustering Algorithms KASBA KShape + TimeSeriesAgglomerative TimeSeriesKMeans TimeSeriesKMedoids TimeSeriesKernelKMeans diff --git a/docs/api_reference/transformations.md b/docs/api_reference/transformations.md index 4a2e40cd7e..03d2ca62fb 100644 --- a/docs/api_reference/transformations.md +++ b/docs/api_reference/transformations.md @@ -134,6 +134,7 @@ all_tags_for_estimator`` function with the argument ``"transformer"``. ESMOTE SMOTE OHIT + RandomOverSampler ``` ### Interval based @@ -214,6 +215,7 @@ all_tags_for_estimator`` function with the argument ``"transformer"``. :template: class.rst AutoCorrelationSeriesTransformer + CollectionToSeriesWrapper ClaSPTransformer DifferenceTransformer Dobin From 0aefa490e4d32016d4e987e23db14e3b00fbfbfe Mon Sep 17 00:00:00 2001 From: GiGiKoneti Date: Thu, 27 Aug 2026 09:15:17 +0530 Subject: [PATCH 2/2] [MNT] Update API reference check to match line exactly --- aeon/testing/tests/test_api_reference.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/aeon/testing/tests/test_api_reference.py b/aeon/testing/tests/test_api_reference.py index b745788913..f8d3c245f7 100644 --- a/aeon/testing/tests/test_api_reference.py +++ b/aeon/testing/tests/test_api_reference.py @@ -16,13 +16,21 @@ def test_all_estimators_in_api_reference(): pytest.skip(f"API reference directory not found at {docs_dir}.") doc_files = list(docs_dir.glob("*.rst")) + list(docs_dir.glob("*.md")) - doc_contents = " ".join([f.read_text(encoding="utf-8") for f in doc_files]) + + # 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_contents: + if name not in doc_lines: missing.append(f"{name} ({klass.__module__})") assert not missing, (