Skip to content

[MNT] Improve coverage for base package#3516

Merged
TonyBagnall merged 20 commits into
mainfrom
ajb/base_cov
Jul 7, 2026
Merged

[MNT] Improve coverage for base package#3516
TonyBagnall merged 20 commits into
mainfrom
ajb/base_cov

Conversation

@TonyBagnall

@TonyBagnall TonyBagnall commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Closes #955. Adds tests for BaseIntervalForest to improve coverage of aeon/base/_estimators/interval_based/base_interval_forest.py, targeting the many branches that were
previously untested.

Changes

  • Changed the test test_autoets_uses_provided_seasonal_period() because the simulated data gives a perfect seasonal fit, causing numeric issues when numba is off. Could possibly be an edge case bug, but fix it to pass codecov for now.

All changes are in aeon/base/_estimators/interval_based/tests/test_base_interval_forest.py. No source code was modified. 21 new test functions were added covering:

  • Invalid base_estimator (non-BaseEstimator input)
  • Invalid series_transformers (string input; invalid item in list)
  • Invalid n_intervals (wrong-length nested list; float type; unknown string; invalid inner/outer list items)
  • Invalid min_interval_length / max_interval_length (list wrong length; invalid float item; invalid type)
  • interval_features as a single callable
  • interval_features as a nested list (callables, transformers, mixed)
  • Invalid interval_features (wrong-length list; invalid type; invalid list items)
  • Invalid att_subsample_size (int < 1; float > 1 or ≤ 0; invalid type; invalid list values)
  • att_subsample_size as a per-series-transformer list (including None entries)
  • att_subsample_size larger than the number of features (warning path)
  • Invalid interval_selection_method (non-string; unknown string)
  • Supervised selection with transformer interval_features (should raise)
  • Invalid replace_nan; valid replace_nan with "nan" and numeric values
  • time_limit_in_minutes > 0 contract path
  • Regressor _predict path via IntervalForestRegressor
  • fit_predict for regressor and fit_predict / fit_predict_proba for classifier
  • temporal_importance_curves with return_dict=True and normalise_time_points=True
  • temporal_importance_curves error cases (regressor; non-decision-tree base estimator)

All new tests use small synthetic datasets (make_example_3d_numpy) and minimal n_estimators to keep runtime fast.

@TonyBagnall TonyBagnall added the coverage Code requiring greater test coverage label Jun 21, 2026
@aeon-actions-bot aeon-actions-bot Bot added forecasting Forecasting package maintenance Continuous integration, unit testing & package distribution labels Jun 21, 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 ]. 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

@TonyBagnall TonyBagnall added codecov actions Run the codecov action on a PR and removed forecasting Forecasting package maintenance Continuous integration, unit testing & package distribution labels Jun 21, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TonyBagnall TonyBagnall marked this pull request as draft June 21, 2026 08:59
@TonyBagnall TonyBagnall marked this pull request as ready for review June 21, 2026 09:09
@TonyBagnall TonyBagnall added codecov actions Run the codecov action on a PR and removed codecov actions Run the codecov action on a PR labels Jun 21, 2026
hadifawaz1999
hadifawaz1999 previously approved these changes Jul 7, 2026

@hadifawaz1999 hadifawaz1999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, always good to improve coverage

# Conflicts:
#	aeon/forecasting/stats/tests/test_ets.py
@TonyBagnall TonyBagnall merged commit 1f824da into main Jul 7, 2026
20 checks passed
@TonyBagnall TonyBagnall deleted the ajb/base_cov branch July 7, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codecov actions Run the codecov action on a PR coverage Code requiring greater test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] BaseIntervalForest coverage

2 participants