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

Add Aqua.jl testing #1628

Merged
merged 11 commits into from
Sep 20, 2023
Merged

Add Aqua.jl testing #1628

merged 11 commits into from
Sep 20, 2023

Conversation

sloede
Copy link
Member

@sloede sloede commented Sep 11, 2023

@github-actions
Copy link
Contributor

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (7e22898) 96.11% compared to head (cc9bec0) 96.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1628   +/-   ##
=======================================
  Coverage   96.11%   96.11%           
=======================================
  Files         418      418           
  Lines       34247    34247           
=======================================
  Hits        32915    32915           
  Misses       1332     1332           
Flag Coverage Δ
unittests 96.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sloede sloede marked this pull request as ready for review September 14, 2023 10:26
@sloede
Copy link
Member Author

sloede commented Sep 14, 2023

I am not 100% sure if we want or need this, but adding Aqua tests seemed like not such a big issue to add. Also, testing time is hardly affected (<1 min). There are a lot of imho false-positive method ambiguities. There's also a legit piracy warning, thanks to buccaneer-in-chief @jlchan. I added an exception such that tests pass, but we could also think about moving the relevant function to StartUpDG.

@sloede sloede requested review from ranocha and jlchan September 14, 2023 14:49
@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2023

I am not 100% sure if we want or need this, but adding Aqua tests seemed like not such a big issue to add. Also, testing time is hardly affected (<1 min). There are a lot of imho false-positive method ambiguities. There's also a legit piracy warning, thanks to buccaneer-in-chief @jlchan. I added an exception such that tests pass, but we could also think about moving the relevant function to StartUpDG.

I didn't add that function, but I'm happy to move it StartUpDG.jl. @ranocha, any thoughts?

test/Project.toml Show resolved Hide resolved
@sloede
Copy link
Member Author

sloede commented Sep 14, 2023

I didn't add that function

err... I beg to differ, good sir! 🧐
https://github.com/trixi-framework/Trixi.jl/pull/1010/files#diff-9818bc7a206dbb756a2d8aed9f30baf2bd1cc2eaf9b115e667375da1b69e639bR347-R351

@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2023

Ohh right, I did add that function - the DGMulti solvers using SummationByPartsOperators.jl were super slow without it. I must have forgotten because @ranocha added the other SummationByPartsOperators.jl solver features.

IMO it doesn't make sense to move it to StartUpDG.jl without moving the rest of the specialization of RefElemData and MeshData from SummationsByPartsOperators.jl, but we can merge this first and open an issue. Any preference @sloede?

@sloede
Copy link
Member Author

sloede commented Sep 14, 2023

IMO it doesn't make sense to move it to StartUpDG.jl without moving the rest of the specialization of RefElemData and MeshData from SummationsByPartsOperators.jl, but we can merge this first and open an issue. Any preference @sloede?

I agree, opening an issue would be a good idea 👍 Can you do it, such that you know what would be to do?

@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2023

Wait, I'm a little confused - why is

function StartUpDG.RefElemData(element_type::Line,
D::AbstractDerivativeOperator;
tol = 100 * eps())
not considered type piracy then? It's extending a StartUpDG.jl function to a SummationByPartsOperators.jl abstract type, neither of which is owned by Trixi.jl

@sloede
Copy link
Member Author

sloede commented Sep 14, 2023

Wait, I'm a little confused - why is

function StartUpDG.RefElemData(element_type::Line,
D::AbstractDerivativeOperator;
tol = 100 * eps())

not considered type piracy then? It's extending a StartUpDG.jl function to a SummationByPartsOperators.jl abstract type, neither of which is owned by Trixi.jl

I believe that, yes, this too is 🏴‍☠️ and it's just that Aqua did not catch it 😅

@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2023

@sloede done #1639

Can you add Aqua exceptions for the other StartUpDG functions in https://github.com/trixi-framework/Trixi.jl/blob/92dedde81e12f8ac2259785a9eab40f475d82251/src/solvers/dgmulti/sbp.jl? The ones which commit type piracy should all be prefaced by function StartUpDG.__function_name__

@sloede
Copy link
Member Author

sloede commented Sep 14, 2023

@sloede done #1639

Thanks!

Can you add Aqua exceptions for the other StartUpDG functions

I don't think it is necessary, since all tests have passed so Aqua does not complain about the others.

@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2023

Can you add Aqua exceptions for the other StartUpDG functions

I don't think it is necessary, since all tests have passed so Aqua does not complain about the others.

Yes, but I was thinking that new versions of Aqua might not skip over these other pirated functions.

@sloede
Copy link
Member Author

sloede commented Sep 14, 2023

Can you add Aqua exceptions for the other StartUpDG functions

I don't think it is necessary, since all tests have passed so Aqua does not complain about the others.

Yes, but I was thinking that new versions of Aqua might not skip over these other pirated functions.

Then I would tackle them once the new Aqua version complains about them 🙂

Copy link
Contributor

@jlchan jlchan left a comment

Choose a reason for hiding this comment

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

Sounds good. Thanks for adding this!

@ranocha ranocha enabled auto-merge (squash) September 15, 2023 06:14
@ranocha ranocha disabled auto-merge September 20, 2023 06:04
@ranocha ranocha enabled auto-merge (squash) September 20, 2023 06:04
@ranocha ranocha merged commit 09441e1 into main Sep 20, 2023
@ranocha ranocha deleted the msl/add-aqua-testing branch September 20, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants