From dd25fe8a10250c72572e6799d72f777f0641bc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Galy-Fajou?= Date: Mon, 14 Feb 2022 15:01:45 +0100 Subject: [PATCH 1/7] Use the Aqua workflow to test things further --- .github/workflows/ci.yml | 1 + src/distances/sinus.jl | 2 +- test/Project.toml | 2 ++ test/runtests.jl | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6272e7017..947b77ec8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: arch: - x64 group: + - 'Aqua' - 'Transform' - 'BaseKernels' - 'Kernels' diff --git a/src/distances/sinus.jl b/src/distances/sinus.jl index 51d14c47d..6d5c8fa4d 100644 --- a/src/distances/sinus.jl +++ b/src/distances/sinus.jl @@ -13,7 +13,7 @@ Distances.result_type(::Sinus{T}, Ta::Type, Tb::Type) where {T} = promote_type(T @inline function Distances._evaluate( d::Sinus, a::AbstractVector, b::AbstractVector -) where {T} +) @boundscheck if (length(a) != length(b)) || length(a) != length(d.r) throw( DimensionMismatch( diff --git a/test/Project.toml b/test/Project.toml index 4c04f2c42..51fd6d7ae 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" @@ -17,6 +18,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [compat] +Aqua = "0.5" AxisArrays = "0.4.3" Compat = "3" Distances = "0.10" diff --git a/test/runtests.jl b/test/runtests.jl index c9bc932f3..438701bc3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,6 @@ using KernelFunctions using AxisArrays +using Aqua using Distances using Documenter using Functors: functor @@ -59,6 +60,13 @@ const GROUP = get(ENV, "GROUP", "") include("test_utils.jl") @testset "KernelFunctions" begin + if GROUP == "" || GROUP == "Aqua" + @testset "Aqua" begin + Aqua.test_all(KernelFunctions; ambiguities=false) + Aqua.test_ambiguities(KernelFunctions; recursive=false) + # Avoid checking extra package ambiguity issues + end + end if GROUP == "" || GROUP == "Transform" @testset "transform" begin include("transform/transform.jl") From 07878200d10dbf3b599b7204cf656e03aa4a5ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Galy-Fajou?= Date: Mon, 14 Feb 2022 15:07:06 +0100 Subject: [PATCH 2/7] Update sinus.jl --- src/distances/sinus.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/distances/sinus.jl b/src/distances/sinus.jl index 6d5c8fa4d..2fdadfcf9 100644 --- a/src/distances/sinus.jl +++ b/src/distances/sinus.jl @@ -11,9 +11,7 @@ Distances.parameters(d::Sinus) = d.r Distances.result_type(::Sinus{T}, Ta::Type, Tb::Type) where {T} = promote_type(T, Ta, Tb) -@inline function Distances._evaluate( - d::Sinus, a::AbstractVector, b::AbstractVector -) +@inline function Distances._evaluate(d::Sinus, a::AbstractVector, b::AbstractVector) @boundscheck if (length(a) != length(b)) || length(a) != length(d.r) throw( DimensionMismatch( From dbd31bf13764ea964225010806282b113d1ea38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Galy-Fajou?= Date: Mon, 14 Feb 2022 15:27:19 +0100 Subject: [PATCH 3/7] Resolve comment --- test/runtests.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 438701bc3..7465c1220 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -63,8 +63,10 @@ include("test_utils.jl") if GROUP == "" || GROUP == "Aqua" @testset "Aqua" begin Aqua.test_all(KernelFunctions; ambiguities=false) - Aqua.test_ambiguities(KernelFunctions; recursive=false) - # Avoid checking extra package ambiguity issues + @testset "Method Ambiguity" begin + Aqua.test_ambiguities([KernelFunctions, Base, Core]; recursive=false) + # Avoid checking extra package ambiguity issues + end end end if GROUP == "" || GROUP == "Transform" From c5e515a5b25fa859619378d24f2114b488b8f54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Galy-Fajou?= Date: Mon, 14 Feb 2022 15:53:40 +0100 Subject: [PATCH 4/7] Solve double chain transform ambiguity --- src/transform/chaintransform.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transform/chaintransform.jl b/src/transform/chaintransform.jl index bd4627b19..622a79828 100644 --- a/src/transform/chaintransform.jl +++ b/src/transform/chaintransform.jl @@ -36,6 +36,7 @@ end Base.:∘(t₁::Transform, t₂::Transform) = ChainTransform([t₂, t₁]) Base.:∘(t::Transform, tc::ChainTransform) = ChainTransform(vcat(tc.transforms, t)) Base.:∘(tc::ChainTransform, t::Transform) = ChainTransform(vcat(t, tc.transforms)) +Base.:∘(tc₁::ChainTransform, tc₂::ChainTransform) = ChainTransform(vcat(tc₂.transforms, tc₁.transforms)) (t::ChainTransform)(x) = foldl((x, t) -> t(x), t.transforms; init=x) From 1075532951d72f495ed1dcc13dd12b7d937d6c07 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace <51025924+simsurace@users.noreply.github.com> Date: Sun, 10 Mar 2024 09:07:58 +0100 Subject: [PATCH 5/7] Update runtests.jl Co-authored-by: David Widmann --- test/runtests.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 2f179a481..55dd6eefd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -69,10 +69,8 @@ include("test_utils.jl") if GROUP == "" || GROUP == "Aqua" @testset "Aqua" begin Aqua.test_all(KernelFunctions; ambiguities=false) - @testset "Method Ambiguity" begin - Aqua.test_ambiguities([KernelFunctions, Base, Core]; recursive=false) - # Avoid checking extra package ambiguity issues - end + # Ref https://github.com/JuliaTesting/Aqua.jl/issues/77 + Aqua.test_ambiguities(KernelFunctions; recursive=false) end end if GROUP == "" || GROUP == "Transform" From af01fdc8aed85c844e7e267108485dec84147eae Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace <51025924+simsurace@users.noreply.github.com> Date: Sun, 10 Mar 2024 09:08:03 +0100 Subject: [PATCH 6/7] Update Project.toml Co-authored-by: David Widmann --- test/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Project.toml b/test/Project.toml index 64766be70..b48170e06 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -23,7 +23,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [compat] -Aqua = "0.5" +Aqua = "0.8" AxisArrays = "0.4.3" Compat = "3, 4" Distances = "0.10" From e8c97029fcde2bd6c7c559a706fb8af15018c469 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace Date: Mon, 11 Mar 2024 08:59:50 +0100 Subject: [PATCH 7/7] Add missing compat bounds --- Project.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Project.toml b/Project.toml index 24da5ddcc..8ca0709e1 100644 --- a/Project.toml +++ b/Project.toml @@ -29,11 +29,14 @@ Distances = "0.10.9" FillArrays = "0.10, 0.11, 0.12, 0.13, 1" Functors = "0.1, 0.2, 0.3, 0.4" IrrationalConstants = "0.1, 0.2" +LinearAlgebra = "1" LogExpFunctions = "0.2.1, 0.3" +Random = "1" Requires = "1.0.1" SpecialFunctions = "0.8, 0.9, 0.10, 1, 2" Statistics = "1" StatsBase = "0.32, 0.33, 0.34" TensorCore = "0.1" +Test = "1" ZygoteRules = "0.2" julia = "1.3"