parametrize_with_checks

parametrize_with_checks(estimators: list[BaseAeonEstimator | type[BaseAeonEstimator]], use_first_parameter_set: bool = False) Callable[source]

Pytest specific decorator for parametrizing aeon estimator checks.

The id of each check is set to be the name of the check with its keyword arguments, including a pprint version of the estimator.

This allows to use pytest -k to specify which tests to run i.e.

pytest -k check_fit_updates_state

Based on the scikit-learn``parametrize_with_checks function.

Parameters:
estimatorslist of aeon BaseAeonEstimator instances or classes

Estimators to generate checks for. If an item is a class, an instance will be created using BaseAeonEstimator._create_test_instance().

use_first_parameter_setbool, default=False

If True, only the first parameter set from _get_test_params will be used if a class is passed.

Returns:
decoratorpytest.mark.parametrize

See also

check_estimator

Check if estimator adheres to tsml or scikit-learn conventions.

Examples

>>> from aeon.testing.estimator_checking import parametrize_with_checks
>>> from aeon.classification.interval_based import TimeSeriesForestClassifier
>>> from aeon.regression.interval_based import TimeSeriesForestRegressor
>>> @parametrize_with_checks(
...                     [TimeSeriesForestClassifier, TimeSeriesForestRegressor])
... def test_aeon_compatible_estimator(check):
...     check()