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] Enhance networks module testing suite #1631

Merged
merged 36 commits into from
Jul 2, 2024

Conversation

aadya940
Copy link
Contributor

@aadya940 aadya940 commented Jun 9, 2024

  • Re-implemented test_all_networks.py to create a more robust testing Mechanism.
  • Added _config dict to keep track of library dependencies and compatible python versions and the network structure.
  • Checked if build_network returns correct return type, that is, KerasTensor if structure is encoder, Model object otherwise.

@aadya940 aadya940 requested a review from hadifawaz1999 as a code owner June 9, 2024 14:47
@aeon-actions-bot aeon-actions-bot bot added maintenance Continuous integration, unit testing & package distribution networks Networks package labels Jun 9, 2024
@aeon-actions-bot
Copy link
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ $\color{#EC843A}{\textsf{maintenance}}$ ].
I have added the following labels to this PR based on the changes made: [ $\color{#379E11}{\textsf{networks}}$ ]. 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, 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.

@aadya940
Copy link
Contributor Author

aadya940 commented Jun 9, 2024

@MatthewMiddlehurst let's check if this improves coverage or not.

@MatthewMiddlehurst MatthewMiddlehurst added the codecov actions Run the codecov action on a PR label Jun 9, 2024
@MatthewMiddlehurst
Copy link
Member

You will have to push another commit for the test to run unfortunately.

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.

I think we can put this in without testing coverage, seems a good thing to do!

TonyBagnall
TonyBagnall previously approved these changes Jun 10, 2024
Copy link
Member

@MatthewMiddlehurst MatthewMiddlehurst left a comment

Choose a reason for hiding this comment

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

Taking a look, I don't think this is needed anymore actually, see line 33 of the new file where it skips individual estimators if there is a missing module.

Honestly, this test could be improved a lot though, the skip list and try/catch are a bit hacky. Should try to integrate _check_soft_dependencies without skipping the whole test.

@aadya940
Copy link
Contributor Author

I think we could skip the complete test if the tensorflow is not present. However, we could skip the networks which use tensorflow-addons?

@MatthewMiddlehurst
Copy link
Member

Ideally we shouldnt skip anything other than the base class, the only good reason to skip currently is it has a dependency which is not installed

Copy link
Member

@MatthewMiddlehurst MatthewMiddlehurst left a comment

Choose a reason for hiding this comment

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

It could be good to remove the current skipped classes and replace the except with one using the _check_soft_dependencies(soft_dependencies) and _check_python_version(python_version) methods. You may have to edit the new base class a bit to get the correct inputs.

If you can think of anything else we would want to add to this test, that would be good. Currently it does not check anything from the output.

@aadya940
Copy link
Contributor Author

It could be good to remove the current skipped classes and replace the except with one using the _check_soft_dependencies(soft_dependencies) and _check_python_version(python_version) methods. You may have to edit the new base class a bit to get the correct inputs.

If you can think of anything else we would want to add to this test, that would be good. Currently it does not check anything from the output.

Could you please elaborate on this? I didn't quite understand. Thanks :)

@aadya940
Copy link
Contributor Author

How does this look? @MatthewMiddlehurst

@aadya940 aadya940 marked this pull request as draft June 12, 2024 04:17
@aadya940
Copy link
Contributor Author

Do we skip this using pytest.mark.skipif if the version is 3.10? Looks like tensorflow.keras is incompatible with 3.10.

@aadya940
Copy link
Contributor Author

Got it 👍 , shall update it once we take a decision. Thanks :))

@MatthewMiddlehurst
Copy link
Member

I have updated my recommendation above.

@aadya940 aadya940 changed the title [MNT] Fix bug in test_all_networks [MNT] Enhance networks module testing suite Jul 2, 2024
Copy link
Member

@MatthewMiddlehurst MatthewMiddlehurst left a comment

Choose a reason for hiding this comment

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

LGTM. Still some minor issues but does not need to be done here.

Copy link
Member

@hadifawaz1999 hadifawaz1999 left a comment

Choose a reason for hiding this comment

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

LGTM! would be good to check coverage now too

@MatthewMiddlehurst MatthewMiddlehurst merged commit b0b7d63 into aeon-toolkit:main Jul 2, 2024
16 checks passed
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 networks Networks package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants