From 8124037dfb3ec92f62add5b2e83275ef2d943905 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Mon, 11 Sep 2023 05:58:16 +0200 Subject: [PATCH 1/8] Add Aqua.jl testing --- test/Project.toml | 2 ++ test/runtests.jl | 1 + test/test_aqua.jl | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 test/test_aqua.jl diff --git a/test/Project.toml b/test/Project.toml index 7115a19b441..7f41ffbf720 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [compat] +Aqua = "0.7" BSON = "0.3.3" CairoMakie = "0.6, 0.7, 0.8, 0.9, 0.10" Flux = "0.13 - 0.13.12" # TODO: Return to "0.13" once https://github.com/FluxML/Flux.jl/issues/2204 is resolved @@ -8,6 +9,7 @@ OrdinaryDiffEq = "6.49.1" Plots = "1.16" [deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6" diff --git a/test/runtests.jl b/test/runtests.jl index f1adbaaf1df..7e195fe7402 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -109,6 +109,7 @@ const TRIXI_NTHREADS = clamp(Sys.CPU_THREADS, 2, 3) @time if TRIXI_TEST == "all" || TRIXI_TEST == "misc_part2" include("test_special_elixirs.jl") + include("test_aqua.jl") end @time if TRIXI_TEST == "all" || TRIXI_TEST == "performance_specializations_part1" diff --git a/test/test_aqua.jl b/test/test_aqua.jl new file mode 100644 index 00000000000..5419e0b7283 --- /dev/null +++ b/test/test_aqua.jl @@ -0,0 +1,13 @@ +module TestAqua + +using Aqua +using Test +using Trixi + +include("test_trixi.jl") + +@timed_testset "Aqua.jl" begin + Aqua.test_all(Trixi) +end + +end #module From 3ab92edc6931c15cba368f2403297e8dd9c61ee6 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 12:06:40 +0200 Subject: [PATCH 2/8] [deps] before [compat] --- test/Project.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 7f41ffbf720..fffd1741450 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,13 +1,3 @@ -[compat] -Aqua = "0.7" -BSON = "0.3.3" -CairoMakie = "0.6, 0.7, 0.8, 0.9, 0.10" -Flux = "0.13 - 0.13.12" # TODO: Return to "0.13" once https://github.com/FluxML/Flux.jl/issues/2204 is resolved -ForwardDiff = "0.10" -MPI = "0.20" -OrdinaryDiffEq = "6.49.1" -Plots = "1.16" - [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" @@ -23,6 +13,16 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +[compat] +Aqua = "0.7" +BSON = "0.3.3" +CairoMakie = "0.6, 0.7, 0.8, 0.9, 0.10" +Flux = "0.13 - 0.13.12" # TODO: Return to "0.13" once https://github.com/FluxML/Flux.jl/issues/2204 is resolved +ForwardDiff = "0.10" +MPI = "0.20" +OrdinaryDiffEq = "6.49.1" +Plots = "1.16" + [preferences.OrdinaryDiffEq] PrecompileAutoSpecialize = false PrecompileAutoSwitch = false From de134bfdcb01ec3f3f54fe33c18b7419e4a45b0d Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 12:26:06 +0200 Subject: [PATCH 3/8] =?UTF-8?q?Skip=20ambiguities=20(too=20many=20false=20?= =?UTF-8?q?positives)=20and=20account=20for=20@jlchan=20being=20a=20?= =?UTF-8?q?=F0=9F=8F=B4=E2=80=8D=E2=98=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_aqua.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_aqua.jl b/test/test_aqua.jl index 5419e0b7283..62fdf0c976f 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -7,7 +7,10 @@ using Trixi include("test_trixi.jl") @timed_testset "Aqua.jl" begin - Aqua.test_all(Trixi) + Aqua.test_all(Trixi, + ambiguities = false, + piracy = (treat_as_own = [Trixi.StartUpDG.RefElemData, + Trixi.StartUpDG.MeshData],)) end end #module From 6e78efcdf02aeff0f40b0f5ea89276479c0d18ce Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 13:44:30 +0200 Subject: [PATCH 4/8] Bump Flux minimum version --- test/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Project.toml b/test/Project.toml index fffd1741450..c6cd388aa40 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -17,7 +17,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Aqua = "0.7" BSON = "0.3.3" CairoMakie = "0.6, 0.7, 0.8, 0.9, 0.10" -Flux = "0.13 - 0.13.12" # TODO: Return to "0.13" once https://github.com/FluxML/Flux.jl/issues/2204 is resolved +Flux = "0.14" ForwardDiff = "0.10" MPI = "0.20" OrdinaryDiffEq = "6.49.1" From e803ee0e6a41bc8cb44e59a850df9d1f07661778 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 15:33:45 +0200 Subject: [PATCH 5/8] Adapt test values --- test/test_tree_2d_euler.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_tree_2d_euler.jl b/test/test_tree_2d_euler.jl index e1e3ad32e7d..1b8a261a60d 100644 --- a/test/test_tree_2d_euler.jl +++ b/test/test_tree_2d_euler.jl @@ -140,7 +140,7 @@ EXAMPLES_DIR = pkgdir(Trixi, "examples", "tree_2d_dgsem") @trixi_testset "elixir_euler_sedov_blast_wave_neuralnetwork_perssonperaire.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_neuralnetwork_perssonperaire.jl"), l2 = [0.0845430093623868, 0.09271459184623232, 0.09271459184623232, 0.4377291875101709], - linf = [1.3608553480069898, 1.6822884847136004, 1.6822884847135997, 4.220147414536653], + linf = [1.3608553480069898, 1.6822884847136004, 1.6822884847135997, 4.2201475428867035], maxiters = 30, coverage_override = (maxiters=6,)) end From 1f0c9e3198b0ecbc6ffa6c4ae672e59bc4126a8e Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 15:34:08 +0200 Subject: [PATCH 6/8] Add back pre-v0.14 version for Flux.jl to satisfy Julia v1.8 --- test/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Project.toml b/test/Project.toml index c6cd388aa40..c45be49a5d0 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -17,7 +17,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Aqua = "0.7" BSON = "0.3.3" CairoMakie = "0.6, 0.7, 0.8, 0.9, 0.10" -Flux = "0.14" +Flux = "0.13.15, 0.14" ForwardDiff = "0.10" MPI = "0.20" OrdinaryDiffEq = "6.49.1" From c8c1dc9f46ef7912ad1212b80ab4dbcb54d82b45 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 16:19:09 +0200 Subject: [PATCH 7/8] Add Aqua badge --- README.md | 1 + docs/src/index.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index c177ad2347f..673708d8b89 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Build Status](https://github.com/trixi-framework/Trixi.jl/workflows/CI/badge.svg)](https://github.com/trixi-framework/Trixi.jl/actions?query=workflow%3ACI) [![Codecov](https://codecov.io/gh/trixi-framework/Trixi.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/trixi-framework/Trixi.jl) [![Coveralls](https://coveralls.io/repos/github/trixi-framework/Trixi.jl/badge.svg?branch=main)](https://coveralls.io/github/trixi-framework/Trixi.jl?branch=main) +[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) [![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3996439.svg)](https://doi.org/10.5281/zenodo.3996439) [![Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Trixi)](https://pkgs.genieframework.com?packages=Trixi) diff --git a/docs/src/index.md b/docs/src/index.md index bb2afd1019f..9ffaee26c40 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -7,6 +7,7 @@ [![Build Status](https://github.com/trixi-framework/Trixi.jl/workflows/CI/badge.svg)](https://github.com/trixi-framework/Trixi.jl/actions?query=workflow%3ACI) [![Codecov](https://codecov.io/gh/trixi-framework/Trixi.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/trixi-framework/Trixi.jl) [![Coveralls](https://coveralls.io/repos/github/trixi-framework/Trixi.jl/badge.svg?branch=main)](https://coveralls.io/github/trixi-framework/Trixi.jl?branch=main) +[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) [![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3996439.svg)](https://doi.org/10.5281/zenodo.3996439) From 73dc273dcb60a230e85d1c38171dfb7e0ef3bbd1 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Thu, 14 Sep 2023 16:43:44 +0200 Subject: [PATCH 8/8] Explain piracy exceptions --- test/test_aqua.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_aqua.jl b/test/test_aqua.jl index 62fdf0c976f..f7ab4f545d0 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -9,6 +9,8 @@ include("test_trixi.jl") @timed_testset "Aqua.jl" begin Aqua.test_all(Trixi, ambiguities = false, + # exceptions necessary for adding a new method `StartUpDG.estimate_h` + # in src/solvers/dgmulti/sbp.jl piracy = (treat_as_own = [Trixi.StartUpDG.RefElemData, Trixi.StartUpDG.MeshData],)) end