Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Unit testing revamp part 1: check_estimator #1479

Merged
merged 87 commits into from
Jul 4, 2024

Conversation

MatthewMiddlehurst
Copy link
Member

@MatthewMiddlehurst MatthewMiddlehurst commented Apr 27, 2024

Reference Issues/PRs

Relies on #1476
See AEP 05

What does this implement/fix? Explain your changes.

Updates the check_estimator method to use a scikit-learn like method for generating estimator tests rather than the current pytest fixtures. The old method is still available for now in check_estimator_legacy. parametrize_with_checks simply outputs the generated checks as parameters for a pytest function.

_yield_estimator_checks.py ports tests over from test_all_estimators. The data used and the calling of estimator methods (i.e. fit and predict) has to change due to the detachment from the "scenarios" framework used previously.

Quick run down of contents:

  • Has some small changes to base classes mostly regarding meta-data, as the storing of it in class attributes breaks the condition of no changes in predict/transform.
  • Implements parametrize_with_checks and check_estimator for non-deprecated interfaces. These are only run on test estimators for now.
  • Implements the current BaseEstimator tests as checks for the above without the "scenario" framework.

@MatthewMiddlehurst MatthewMiddlehurst added maintenance Continuous integration, unit testing & package distribution testing Testing related issue or pull request labels Apr 27, 2024
@aeon-actions-bot
Copy link
Contributor

Thank you for contributing to aeon

I would have added the following labels to this PR based on the changes made: [ $\color{#2C2F20}{\textsf{testing}}$ ], however some package labels are already present.

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, any trivial fixes will automatically be pushed to your PR unless it is a draft.

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

@MatthewMiddlehurst MatthewMiddlehurst added the codecov actions Run the codecov action on a PR label Apr 28, 2024
@MatthewMiddlehurst MatthewMiddlehurst marked this pull request as ready for review July 2, 2024 19:02
@MatthewMiddlehurst MatthewMiddlehurst changed the title [MNT] check_estimator [MNT] Unit testing revamp part 1: check_estimator Jul 2, 2024
Copy link
Member

@baraline baraline left a comment

Choose a reason for hiding this comment

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

Had a quick look and I must say that the testing pipeline seems way clearer to me with this format, from testing data to which test are run for which estimator.

I'll delve a bit more into it tomorrow, just some typos in found while reading through it.

aeon/base/_base_collection.py Show resolved Hide resolved
aeon/base/_base.py Show resolved Hide resolved
aeon/testing/estimator_checking/_estimator_checks.py Outdated Show resolved Hide resolved
@MatthewMiddlehurst
Copy link
Member Author

Actually, with forecasting more officially deprecated now, I can probably remove the legacy check function. Can keep for now if people disagree.

@TonyBagnall
Copy link
Contributor

Actually, with forecasting more officially deprecated now, I can probably remove the legacy check function. Can keep for now if people disagree.

I vote remove it

Copy link
Contributor

@TonyBagnall TonyBagnall left a comment

Choose a reason for hiding this comment

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

LGTM, onwards!

@MatthewMiddlehurst MatthewMiddlehurst merged commit 0cf32d1 into main Jul 4, 2024
16 checks passed
@MatthewMiddlehurst MatthewMiddlehurst deleted the mm/check-estimator branch July 4, 2024 09:16
MatthewMiddlehurst added a commit to time-series-machine-learning/aeon-tsml-fork that referenced this pull request Jul 4, 2024
* [BUG] fix padder fit_values (aeon-toolkit#1752)

* fix padder

* declare var

* [DOC,MNT] Documentation updates and deprecation warning for `v1.0.0` (aeon-toolkit#1743)

* forecasting docs

* v1.0.0 mass deprecation message

* index fix

* installation

* typos

* comment

* pushing to forks is crazy

* dont create branches

* [MNT] Unit testing revamp part 1: `check_estimator` (aeon-toolkit#1479)

* remove no soft deps job and expand full no soft deps job

* no PR testing flag

* module soft deps

* is this actually returning an empty list

* import modules now

* clear out module soft dep

* check_estimator

* check_estimator updates

* import

* more complete functions and tests

* fix

* coverage and paramterize function test

* testing data start

* testing data start

* testing data cont

* real partial

* cont

* testing data changes

* examples revert

* fourier features

* Revert "fourier features"

This reverts commit 567c5e1.

* legacy skip

* init

* move to legacy

* example data update

* testing data

* imports

* examples

* testing update

* multiindex

* multiindex fixes

* multiindex returns

* test

* test

* docs, tests and fixes

* comments

* last bits

* refactor testing folder

* imports

* series generators

* fixes

* make_series legacy

* merge

* forecasting functions

* fixes

* fixes

* fixes

* testing

* examples

* convert checks

* fixes

* docs

* ad datasets

* more docs

* forecasting compose

* forecasting

* delete forecasting api docs

* docs

* revert and comment init

* imports

* import test

* uncomment

* docstrings

* no imports

* package name

* import

* docstring

* fixes

* remove legacy and doc fix

* [ENH] Channel selection rocket wrapper (aeon-toolkit#1504)

* base channel selector

* base channel selector

* random channel selector

* elbow class test

* random channel selector

* base channel selector

* base channel selector

* revert registry

* draft channel selector

* class method

* test channel scorer

* docstring

* remove unnecessary ExponentTransform import

* deprecate DateTime

* Revert "deprecate DateTime"

This reverts commit 98b29e6.

* channel selection

* remove dependency

* move tests to fit

* move tests to fit

* channel scorer test

* add to API

* maint

* maint

---------

Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>
MatthewMiddlehurst added a commit to time-series-machine-learning/aeon-tsml-fork that referenced this pull request Jul 4, 2024
* [BUG] fix padder fit_values (aeon-toolkit#1752)

* fix padder

* declare var

* [DOC,MNT] Documentation updates and deprecation warning for `v1.0.0` (aeon-toolkit#1743)

* forecasting docs

* v1.0.0 mass deprecation message

* index fix

* installation

* typos

* [MNT] Unit testing revamp part 1: `check_estimator` (aeon-toolkit#1479)

* remove no soft deps job and expand full no soft deps job

* no PR testing flag

* module soft deps

* is this actually returning an empty list

* import modules now

* clear out module soft dep

* check_estimator

* check_estimator updates

* import

* more complete functions and tests

* fix

* coverage and paramterize function test

* testing data start

* testing data start

* testing data cont

* real partial

* cont

* testing data changes

* examples revert

* fourier features

* Revert "fourier features"

This reverts commit 567c5e1.

* legacy skip

* init

* move to legacy

* example data update

* testing data

* imports

* examples

* testing update

* multiindex

* multiindex fixes

* multiindex returns

* test

* test

* docs, tests and fixes

* comments

* last bits

* refactor testing folder

* imports

* series generators

* fixes

* make_series legacy

* merge

* forecasting functions

* fixes

* fixes

* fixes

* testing

* examples

* convert checks

* fixes

* docs

* ad datasets

* more docs

* forecasting compose

* forecasting

* delete forecasting api docs

* docs

* revert and comment init

* imports

* import test

* uncomment

* docstrings

* no imports

* package name

* import

* docstring

* fixes

* remove legacy and doc fix

* [ENH] Channel selection rocket wrapper (aeon-toolkit#1504)

* base channel selector

* base channel selector

* random channel selector

* elbow class test

* random channel selector

* base channel selector

* base channel selector

* revert registry

* draft channel selector

* class method

* test channel scorer

* docstring

* remove unnecessary ExponentTransform import

* deprecate DateTime

* Revert "deprecate DateTime"

This reverts commit 98b29e6.

* channel selection

* remove dependency

* move tests to fit

* move tests to fit

* channel scorer test

* add to API

* [DEP] Exclusion list  (aeon-toolkit#1730)

* remove dependency

* excluded list

* [MNT] Removing `tensorflow_addons` dependency (aeon-toolkit#1421)

* tensorflow bound

* add manually instance normalization

* empty commit

* fix doxs

* fix bug

* add maintainer

* re arrange

* dep on utils

* fix comments

* add version and file to header

* re add conflict

* remove addon

* only adodn remove

* add typeguard dep

* remove addons from test

* remove tag of python<3.12 from base class

* edit pyptoject for test details

* remove typeguard

* remove addons

* remove typeguard

* fix bug in python version

* remove config on python < 3.12

* remove python version from test

* remove python version from base

* use group norm

* re-add 3.12 limit

* remove tags and add python version

* skip random state clr test

* fix test all networks

* set y for channel selection test

* set y for channel selection test

---------

Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>

* comment

* Empty commit for CI

* uncomment

---------

Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>
Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
Co-authored-by: MatthewMiddlehurst <MatthewMiddlehurst@users.noreply.github.com>
MatthewMiddlehurst added a commit that referenced this pull request Jul 9, 2024
…ting CI (#1764)

* [MNT] Bot to make empty commits (#15)

* CI fun

* comments and token

* [MNT] empty commit PR 2 (#16)

* CI fun

* comments and token

* comments

* skip dirty check

* Empty commit for CI

* empty comment 3 (#17)

* comment

* prs only

* comment

* Empty commit for CI

* empty commit 4 (#18)

* comment

* correct branch

* Empty commit for CI

* empty commit 5 (#19)

* comment

* branch

* empty commit 6 (#20)

* [BUG] fix padder fit_values (#1752)

* fix padder

* declare var

* [DOC,MNT] Documentation updates and deprecation warning for `v1.0.0` (#1743)

* forecasting docs

* v1.0.0 mass deprecation message

* index fix

* installation

* typos

* comment

* pushing to forks is crazy

* dont create branches

* [MNT] Unit testing revamp part 1: `check_estimator` (#1479)

* remove no soft deps job and expand full no soft deps job

* no PR testing flag

* module soft deps

* is this actually returning an empty list

* import modules now

* clear out module soft dep

* check_estimator

* check_estimator updates

* import

* more complete functions and tests

* fix

* coverage and paramterize function test

* testing data start

* testing data start

* testing data cont

* real partial

* cont

* testing data changes

* examples revert

* fourier features

* Revert "fourier features"

This reverts commit 567c5e1.

* legacy skip

* init

* move to legacy

* example data update

* testing data

* imports

* examples

* testing update

* multiindex

* multiindex fixes

* multiindex returns

* test

* test

* docs, tests and fixes

* comments

* last bits

* refactor testing folder

* imports

* series generators

* fixes

* make_series legacy

* merge

* forecasting functions

* fixes

* fixes

* fixes

* testing

* examples

* convert checks

* fixes

* docs

* ad datasets

* more docs

* forecasting compose

* forecasting

* delete forecasting api docs

* docs

* revert and comment init

* imports

* import test

* uncomment

* docstrings

* no imports

* package name

* import

* docstring

* fixes

* remove legacy and doc fix

* [ENH] Channel selection rocket wrapper (#1504)

* base channel selector

* base channel selector

* random channel selector

* elbow class test

* random channel selector

* base channel selector

* base channel selector

* revert registry

* draft channel selector

* class method

* test channel scorer

* docstring

* remove unnecessary ExponentTransform import

* deprecate DateTime

* Revert "deprecate DateTime"

This reverts commit 98b29e6.

* channel selection

* remove dependency

* move tests to fit

* move tests to fit

* channel scorer test

* add to API

* maint

* maint

---------

Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>

* empty commit 7 (#21)

* comment

* remove branch param

* fixes

* Empty commit for CI

* empty commit 8 (#22)

* comment

* repo and branch

* comment

* empty commit 9 (#23)

* [BUG] fix padder fit_values (#1752)

* fix padder

* declare var

* [DOC,MNT] Documentation updates and deprecation warning for `v1.0.0` (#1743)

* forecasting docs

* v1.0.0 mass deprecation message

* index fix

* installation

* typos

* [MNT] Unit testing revamp part 1: `check_estimator` (#1479)

* remove no soft deps job and expand full no soft deps job

* no PR testing flag

* module soft deps

* is this actually returning an empty list

* import modules now

* clear out module soft dep

* check_estimator

* check_estimator updates

* import

* more complete functions and tests

* fix

* coverage and paramterize function test

* testing data start

* testing data start

* testing data cont

* real partial

* cont

* testing data changes

* examples revert

* fourier features

* Revert "fourier features"

This reverts commit 567c5e1.

* legacy skip

* init

* move to legacy

* example data update

* testing data

* imports

* examples

* testing update

* multiindex

* multiindex fixes

* multiindex returns

* test

* test

* docs, tests and fixes

* comments

* last bits

* refactor testing folder

* imports

* series generators

* fixes

* make_series legacy

* merge

* forecasting functions

* fixes

* fixes

* fixes

* testing

* examples

* convert checks

* fixes

* docs

* ad datasets

* more docs

* forecasting compose

* forecasting

* delete forecasting api docs

* docs

* revert and comment init

* imports

* import test

* uncomment

* docstrings

* no imports

* package name

* import

* docstring

* fixes

* remove legacy and doc fix

* [ENH] Channel selection rocket wrapper (#1504)

* base channel selector

* base channel selector

* random channel selector

* elbow class test

* random channel selector

* base channel selector

* base channel selector

* revert registry

* draft channel selector

* class method

* test channel scorer

* docstring

* remove unnecessary ExponentTransform import

* deprecate DateTime

* Revert "deprecate DateTime"

This reverts commit 98b29e6.

* channel selection

* remove dependency

* move tests to fit

* move tests to fit

* channel scorer test

* add to API

* [DEP] Exclusion list  (#1730)

* remove dependency

* excluded list

* [MNT] Removing `tensorflow_addons` dependency (#1421)

* tensorflow bound

* add manually instance normalization

* empty commit

* fix doxs

* fix bug

* add maintainer

* re arrange

* dep on utils

* fix comments

* add version and file to header

* re add conflict

* remove addon

* only adodn remove

* add typeguard dep

* remove addons from test

* remove tag of python<3.12 from base class

* edit pyptoject for test details

* remove typeguard

* remove addons

* remove typeguard

* fix bug in python version

* remove config on python < 3.12

* remove python version from test

* remove python version from base

* use group norm

* re-add 3.12 limit

* remove tags and add python version

* skip random state clr test

* fix test all networks

* set y for channel selection test

* set y for channel selection test

---------

Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>

* comment

* Empty commit for CI

* uncomment

---------

Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>
Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
Co-authored-by: MatthewMiddlehurst <MatthewMiddlehurst@users.noreply.github.com>

---------

Co-authored-by: MatthewMiddlehurst <MatthewMiddlehurst@users.noreply.github.com>
Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>
Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
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 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.

None yet

3 participants