Skip to content

Use Aqua for project quality test #100

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

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunOrthogonalPolynomials"
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
version = "0.5.2"
version = "0.5.3"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand All @@ -22,6 +22,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
AbstractFFTs = "0.5, 1"
ApproxFunBase = "0.6.14"
Aqua = "0.5"
BandedMatrices = "0.16, 0.17"
BlockArrays = "0.14, 0.15, 0.16"
BlockBandedMatrices = "0.10, 0.11"
Expand All @@ -36,9 +37,10 @@ SpecialFunctions = "0.10, 1.0, 2"
julia = "1.5"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "StaticArrays", "LazyArrays"]
test = ["Aqua", "Test", "StaticArrays", "LazyArrays"]
14 changes: 9 additions & 5 deletions src/Spaces/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ include("CurveSpace.jl")
## Heaviside


conversion_rule(sp::HeavisideSpace,sp2::PiecewiseSpace{NTuple{k,PS}}) where {k,PS<:PolynomialSpace} = sp
conversion_rule(sp::HeavisideSpace,sp2::PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace}}) = sp


Conversion(a::HeavisideSpace,b::PiecewiseSpace{NTuple{kk,CC},DD,RR}) where {kk,CC<:PolynomialSpace,DD<:Domain{<:Number},RR<:Real} =
Conversion(a::HeavisideSpace,
b::PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace},<:Domain{<:Number},<:Real}) =
ConcreteConversion(a,b)
bandwidths(::ConcreteConversion{HS,PiecewiseSpace{NTuple{kk,CC},DD,RR}}) where {HS<:HeavisideSpace,CC<:PolynomialSpace,DD<:Domain{<:Number},RR<:Real,kk} =
0,0
bandwidths(::ConcreteConversion{<:HeavisideSpace,
<:PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace},<:Domain{<:Number},<:Real}}) = 0,0

getindex(C::ConcreteConversion{HS,PiecewiseSpace{NTuple{kk,CC},DD,RR}},k::Integer,j::Integer) where {HS<:HeavisideSpace,CC<:PolynomialSpace,DD<:Domain{<:Number},RR<:Real,kk} =
function getindex(C::ConcreteConversion{<:HeavisideSpace,
<:PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace},<:Domain{<:Number},<:Real}},
k::Integer,j::Integer)
k ≤ dimension(domainspace(C)) && j==k ? one(eltype(C)) : zero(eltype(C))
end
31 changes: 13 additions & 18 deletions src/Spaces/Ultraspherical/ContinuousSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ isperiodic(C::ContinuousSpace) = isperiodic(domain(C))

spacescompatible(a::ContinuousSpace,b::ContinuousSpace) = domainscompatible(a,b)
conversion_rule(a::ContinuousSpace,
b::PiecewiseSpace{CD,DD,RR}) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},DD,RR<:Real} where {DDD,RRR} = a
b::PiecewiseSpace{<:Tuple{Vararg{<:ChebyshevDirichlet{1,1}}},<:Any,<:Real}) = a

plan_transform(sp::ContinuousSpace,vals::AbstractVector) =
TransformPlan{eltype(vals),typeof(sp),false,Nothing}(sp,nothing)

function *(P::TransformPlan{T,SS,false},vals::AbstractVector{T}) where {T,SS<:ContinuousSpace}
function *(P::TransformPlan{T,<:ContinuousSpace,false},vals::AbstractVector{T}) where {T}
S = P.space
n=length(vals)
d=domain(S)
Expand Down Expand Up @@ -131,27 +131,26 @@ coefficients(cfsin::AbstractVector,A::ContinuousSpace,B::ContinuousSpace) =


# We implemnt conversion between continuous space and PiecewiseSpace with Chebyshev dirichlet
function Conversion(ps::PiecewiseSpace{CD,DD,RR},cs::ContinuousSpace) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
DD,RR<:Real} where {DDD,RRR}
const PiecewiseSpaceReal{CD} = PiecewiseSpace{CD,<:Any,<:Real}
const PiecewiseSpaceRealChebyDirichlet11 = PiecewiseSpaceReal{<:Tuple{Vararg{<:ChebyshevDirichlet{1,1}}}}

function Conversion(ps::PiecewiseSpaceRealChebyDirichlet11, cs::ContinuousSpace)
@assert ps == canonicalspace(cs)
ConcreteConversion(ps,cs)
end

function Conversion(cs::ContinuousSpace,ps::PiecewiseSpace{CD,DD,RR}) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
DD,RR<:Real} where {DDD,RRR}
function Conversion(cs::ContinuousSpace,ps::PiecewiseSpaceRealChebyDirichlet11)
@assert ps == canonicalspace(cs)
ConcreteConversion(cs,ps)
end


bandwidths(C::ConcreteConversion{PiecewiseSpace{CD,DD,RR},CS}) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
DD,RR<:Real,CS<:ContinuousSpace} where {DDD,RRR} =
bandwidths(C::ConcreteConversion{<:PiecewiseSpaceRealChebyDirichlet11,<:ContinuousSpace}) =
1,ncomponents(domain(rangespace(C)))


function getindex(C::ConcreteConversion{PiecewiseSpace{CD,DD,RR},CS,T},
k::Integer,j::Integer) where {T,DD,RR<:Real,CS<:ContinuousSpace,
CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}}} where {DDD,RRR}
function getindex(C::ConcreteConversion{<:PiecewiseSpaceRealChebyDirichlet11,<:ContinuousSpace,T},
k::Integer,j::Integer) where {T}
d=domain(rangespace(C))
K=ncomponents(d)
if isperiodic(d)
Expand Down Expand Up @@ -182,16 +181,12 @@ function getindex(C::ConcreteConversion{PiecewiseSpace{CD,DD,RR},CS,T},
end


bandwidths(C::ConcreteConversion{<:ContinuousSpace,
PiecewiseSpace{CD,DD,RR}}) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
DD,RR<:Real} where {DDD,RRR} =
bandwidths(C::ConcreteConversion{<:ContinuousSpace, <:PiecewiseSpaceRealChebyDirichlet11}) =
isperiodic(domainspace(C)) ? (2ncomponents(domain(rangespace(C)))-1,1) :
(ncomponents(domain(rangespace(C))),1)

function getindex(C::ConcreteConversion{<:ContinuousSpace,
PiecewiseSpace{CD,DD,RR},T},
k::Integer,j::Integer) where {T,CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
DD,RR<:Real} where {DDD,RRR}
function getindex(C::ConcreteConversion{<:ContinuousSpace,<:PiecewiseSpaceRealChebyDirichlet11,T},
k::Integer,j::Integer) where {T}
d=domain(domainspace(C))
K=ncomponents(d)
if isperiodic(d)
Expand Down
33 changes: 19 additions & 14 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
using ApproxFunOrthogonalPolynomials, LinearAlgebra, Test
using Aqua

@testset "Project quality" begin
Aqua.test_all(ApproxFunOrthogonalPolynomials, ambiguities=false, undefined_exports=false)
end

@testset "Domain" begin
@test reverseorientation(Arc(1,2,(0.1,0.2))) == Arc(1,2,(0.2,0.1))
end

@time include("ClenshawTest.jl")
@time include("ChebyshevTest.jl")
@time include("ComplexTest.jl")
@time include("broadcastingtest.jl")
@time include("OperatorTest.jl")
@time include("ODETest.jl")
@time include("EigTest.jl")
@time include("VectorTest.jl")
@time include("JacobiTest.jl")
@time include("LaguerreTest.jl")
@time include("HermiteTest.jl")
@time include("SpacesTest.jl")
@time include("MultivariateTest.jl")
@time include("PDETest.jl")
include("ClenshawTest.jl")
include("ChebyshevTest.jl")
include("ComplexTest.jl")
include("broadcastingtest.jl")
include("OperatorTest.jl")
include("ODETest.jl")
include("EigTest.jl")
include("VectorTest.jl")
include("JacobiTest.jl")
include("LaguerreTest.jl")
include("HermiteTest.jl")
include("SpacesTest.jl")
include("MultivariateTest.jl")
include("PDETest.jl")

include("SpeedTest.jl")
include("SpeedODETest.jl")
Expand Down