Skip to content

[MNT] Add CI test for correct API entries - #3750

Merged
TonyBagnall merged 4 commits into
aeon-toolkit:mainfrom
GiGiKoneti:mnt/api-reference-test
Sep 10, 2026
Merged

TonyBagnall merged 4 commits into
aeon-toolkit:mainfrom
GiGiKoneti:mnt/api-reference-test

Conversation

@GiGiKoneti

@GiGiKoneti GiGiKoneti commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #3479

What does this implement/fix? Explain your changes.

This PR adds a CI test to ensure that all public estimators in aeon are documented in docs/api_reference/.

Key changes:

  1. API Reference Test: Created aeon/testing/tests/test_api_reference.py which dynamically checks that all estimators returned by all_estimators() are listed in the .rst / .md files under docs/api_reference/. It skips gracefully if run in packaged environments where the docs directory is not present.
  2. Documentation Fixes: Added missing estimators caught by the new test:
    • CollectionToSeriesWrapper in docs/api_reference/transformations.md
    • RandomOverSampler in docs/api_reference/transformations.md
    • TimeSeriesAgglomerative in docs/api_reference/clustering.rst

Does your contribution introduce a new dependency? If yes, which one?

No.

Any other comments?

None.

PR checklist

For all contributions
  • I've added myself to the list of contributors. Alternatively, you can use the @all-contributors bot to do this for you after the PR has been merged.
  • The PR title starts with either [ENH], [MNT], [DOC], [BUG], [REF], [DEP] or [GOV] indicating whether the PR topic is related to enhancement, maintenance, documentation, bugs, refactoring, deprecation or governance.
For new estimators and functions
  • I've added the estimator/function to the online API documentation.
  • (OPTIONAL) I've added myself as a __maintainer__ at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.
For developers with write access
  • (OPTIONAL) I've updated aeon's CODEOWNERS to receive notifications about future changes to these files.

@aeon-actions-bot aeon-actions-bot Bot added forecasting Forecasting package maintenance Continuous integration, unit testing & package distribution testing Testing related issue or pull request labels Aug 16, 2026
@aeon-actions-bot

Copy link
Copy Markdown
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ maintenance ].
I have added the following labels to this PR based on the changes made: [ forecasting, testing ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, please run pre-commit locally and push the fixes to your PR branch.

Don't hesitate to ask questions on the aeon Discord channel if you have any.

PR CI actions

These checkboxes will add labels to enable or disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • Run pre-commit checks for all files
  • Run mypy typecheck tests
  • Run all pytest tests and configurations
  • Run all notebook example tests
  • Run numba-disabled codecov tests
  • Disable numba cache loading
  • Regenerate expected results for testing
  • Push an empty commit to re-run CI checks

@GiGiKoneti
GiGiKoneti force-pushed the mnt/api-reference-test branch from bc16720 to 2096e77 Compare August 16, 2026 17:37

@TonyBagnall TonyBagnall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks useful and it has already picked up some missing API entries. One query thoug: currently if name not in doc_contents only checks whether the estimator name occurs anywhere in the API docs. That could pass if an estimator is mentioned in prose, or if its name is a substring of another estimator, without it actually being added to an autosummary.

Could it instead collect the stripped lines from the API reference files and require the estimator name to match a line exactly?

@GiGiKoneti
GiGiKoneti force-pushed the mnt/api-reference-test branch from 4f8a4d3 to 0aefa49 Compare August 27, 2026 03:45
@GiGiKoneti

Copy link
Copy Markdown
Contributor Author

Done! Updated the test to use exact line matching instead of a global substring search. Tests pass successfully

@TonyBagnall

Copy link
Copy Markdown
Contributor

One small thing before approval: the test still checks if name not in doc_contents, so an estimator could pass if its name only appears in prose or as a substring of another estimator.

Could we instead collect the stripped lines from the API reference files and require an exact match for each estimator name? That would more directly test that every estimator actually has an API reference entry.

@GiGiKoneti

Copy link
Copy Markdown
Contributor Author

Hey @TonyBagnall, this is already done! Commit 0aefa49 updated the test to collect doc_lines = {line.strip() ...} and check if name not in doc_lines: so it strictly enforces exact line matching.

@TonyBagnall TonyBagnall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks

@TonyBagnall
TonyBagnall merged commit ce21593 into aeon-toolkit:main Sep 10, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forecasting Forecasting package maintenance Continuous integration, unit testing & package distribution testing Testing related issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNT] Add CI test for correct API entries

2 participants