Skip to content

Commit a47a416

Browse files
authored
Use Aqua for project quality test (#100)
test for unbound args
1 parent 91673b3 commit a47a416

File tree

4 files changed

+45
-39
lines changed

4 files changed

+45
-39
lines changed

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.5.2"
3+
version = "0.5.3"
44

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

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

4345
[targets]
44-
test = ["Test", "StaticArrays", "LazyArrays"]
46+
test = ["Aqua", "Test", "StaticArrays", "LazyArrays"]

src/Spaces/Spaces.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ include("CurveSpace.jl")
3131
## Heaviside
3232

3333

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

3636

37-
Conversion(a::HeavisideSpace,b::PiecewiseSpace{NTuple{kk,CC},DD,RR}) where {kk,CC<:PolynomialSpace,DD<:Domain{<:Number},RR<:Real} =
37+
Conversion(a::HeavisideSpace,
38+
b::PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace},<:Domain{<:Number},<:Real}) =
3839
ConcreteConversion(a,b)
39-
bandwidths(::ConcreteConversion{HS,PiecewiseSpace{NTuple{kk,CC},DD,RR}}) where {HS<:HeavisideSpace,CC<:PolynomialSpace,DD<:Domain{<:Number},RR<:Real,kk} =
40-
0,0
40+
bandwidths(::ConcreteConversion{<:HeavisideSpace,
41+
<:PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace},<:Domain{<:Number},<:Real}}) = 0,0
4142

42-
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} =
43+
function getindex(C::ConcreteConversion{<:HeavisideSpace,
44+
<:PiecewiseSpace{<:NTuple{<:Any,<:PolynomialSpace},<:Domain{<:Number},<:Real}},
45+
k::Integer,j::Integer)
4346
k dimension(domainspace(C)) && j==k ? one(eltype(C)) : zero(eltype(C))
47+
end

src/Spaces/Ultraspherical/ContinuousSpace.jl

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ isperiodic(C::ContinuousSpace) = isperiodic(domain(C))
1414

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

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

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

132132

133133
# We implemnt conversion between continuous space and PiecewiseSpace with Chebyshev dirichlet
134-
function Conversion(ps::PiecewiseSpace{CD,DD,RR},cs::ContinuousSpace) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
135-
DD,RR<:Real} where {DDD,RRR}
134+
const PiecewiseSpaceReal{CD} = PiecewiseSpace{CD,<:Any,<:Real}
135+
const PiecewiseSpaceRealChebyDirichlet11 = PiecewiseSpaceReal{<:Tuple{Vararg{<:ChebyshevDirichlet{1,1}}}}
136+
137+
function Conversion(ps::PiecewiseSpaceRealChebyDirichlet11, cs::ContinuousSpace)
136138
@assert ps == canonicalspace(cs)
137139
ConcreteConversion(ps,cs)
138140
end
139141

140-
function Conversion(cs::ContinuousSpace,ps::PiecewiseSpace{CD,DD,RR}) where {CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
141-
DD,RR<:Real} where {DDD,RRR}
142+
function Conversion(cs::ContinuousSpace,ps::PiecewiseSpaceRealChebyDirichlet11)
142143
@assert ps == canonicalspace(cs)
143144
ConcreteConversion(cs,ps)
144145
end
145146

146147

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

151151

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

184183

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

191-
function getindex(C::ConcreteConversion{<:ContinuousSpace,
192-
PiecewiseSpace{CD,DD,RR},T},
193-
k::Integer,j::Integer) where {T,CD<:Tuple{Vararg{ChebyshevDirichlet{1,1,DDD,RRR}}},
194-
DD,RR<:Real} where {DDD,RRR}
188+
function getindex(C::ConcreteConversion{<:ContinuousSpace,<:PiecewiseSpaceRealChebyDirichlet11,T},
189+
k::Integer,j::Integer) where {T}
195190
d=domain(domainspace(C))
196191
K=ncomponents(d)
197192
if isperiodic(d)

test/runtests.jl

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
using ApproxFunOrthogonalPolynomials, LinearAlgebra, Test
2+
using Aqua
3+
4+
@testset "Project quality" begin
5+
Aqua.test_all(ApproxFunOrthogonalPolynomials, ambiguities=false, undefined_exports=false)
6+
end
27

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

7-
@time include("ClenshawTest.jl")
8-
@time include("ChebyshevTest.jl")
9-
@time include("ComplexTest.jl")
10-
@time include("broadcastingtest.jl")
11-
@time include("OperatorTest.jl")
12-
@time include("ODETest.jl")
13-
@time include("EigTest.jl")
14-
@time include("VectorTest.jl")
15-
@time include("JacobiTest.jl")
16-
@time include("LaguerreTest.jl")
17-
@time include("HermiteTest.jl")
18-
@time include("SpacesTest.jl")
19-
@time include("MultivariateTest.jl")
20-
@time include("PDETest.jl")
12+
include("ClenshawTest.jl")
13+
include("ChebyshevTest.jl")
14+
include("ComplexTest.jl")
15+
include("broadcastingtest.jl")
16+
include("OperatorTest.jl")
17+
include("ODETest.jl")
18+
include("EigTest.jl")
19+
include("VectorTest.jl")
20+
include("JacobiTest.jl")
21+
include("LaguerreTest.jl")
22+
include("HermiteTest.jl")
23+
include("SpacesTest.jl")
24+
include("MultivariateTest.jl")
25+
include("PDETest.jl")
2126

2227
include("SpeedTest.jl")
2328
include("SpeedODETest.jl")

0 commit comments

Comments
 (0)