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 tests #691

Merged
merged 3 commits into from
Jun 13, 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
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
Aqua = "0.5"
Colors = "0.9.2, 0.10, 0.11, 0.12"
DSP = "0.6.1, 0.7"
DelayDiffEq = "5.31"
Expand All @@ -40,10 +41,11 @@ RecipesBase = "1"
julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Documenter", "GR", "Plots"]
test = ["Test", "Aqua", "Documenter", "GR", "Plots"]
2 changes: 0 additions & 2 deletions src/ControlSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export LTISystem,
are,
lqr,
kalman,
lqg,
lqgi,
covar,
norm,
hinfnorm,
Expand Down
2 changes: 1 addition & 1 deletion src/hammerstein_weiner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function lsim(sys::HammersteinWienerSystem{T}, u, t::AbstractArray{<:Real};
x0=fill(zero(T), nstates(sys)),
alg=Tsit5(),
abstol=1e-6, reltol=1e-6,
kwargs...) where {T,S}
kwargs...) where {T}

# Make u! in-place function of u
u! = if isa(u, Number) || isa(u,AbstractVector) # Allow for u to be a constant number or vector
Expand Down
2 changes: 1 addition & 1 deletion src/plotting.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Colors
export lsimplot, stepplot, impulseplot, bodeplot, nyquistplot, sigmaplot, marginplot, setPlotScale, gangoffour, gangoffourplot, gangofseven, pzmap, pzmap!, nicholsplot
export bodeplot, nyquistplot, sigmaplot, marginplot, setPlotScale, gangoffour, gangoffourplot, gangofseven, pzmap, pzmap!, nicholsplot

_PlotScale = "log10"
_PlotScaleFunc = :log10
Expand Down
2 changes: 1 addition & 1 deletion src/types/TimeEvolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Discrete{T}(x::Discrete) where T = Discrete{T}(x.Ts)


undef_sampletime(::Type{Discrete{T}}) where T = Discrete{T}(UNDEF_SAMPLEPETIME)
undef_sampletime(::Type{Continuous}) where T = Continuous()
undef_sampletime(::Type{Continuous}) = Continuous()


# Promotion
Expand Down
4 changes: 2 additions & 2 deletions src/types/zpk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ zpk(var::AbstractString, Ts::Real) = zpk(tf(var, Ts))
zpk(z, p, k, Ts::Number) = zpk(z, p, k, Discrete(Ts))
zpk(z, p, k) = zpk(z, p, k, Continuous())
# Catch all 1(2) argument versions
zpk(gain, Ts::Number; kwargs...) where {T <: Number} = zpk(gain, Discrete(Ts))
zpk(gain; kwargs...) where {T <: Number} = zpk(gain, Continuous())
zpk(gain, Ts::Number; kwargs...) = zpk(gain, Discrete(Ts))
zpk(gain; kwargs...) = zpk(gain, Continuous())

# This method is required since the Base method uses promote_op(matprod, eltype(A), eltype(B)) which fails to infer correctly
function Base.:(*)(A::AbstractMatrix{<:Union{<:SisoZpk, <:SisoRational}}, B::AbstractMatrix{<:Union{<:SisoZpk, <:SisoRational}})
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ using Test, LinearAlgebra, Random
import Base.isapprox # In framework and test_synthesis
import SparseArrays: sparse # In test_matrix_comps
import DSP: conv # In test_conversion and test_synthesis
using Aqua
@testset "Aqua" begin
Aqua.test_all(ControlSystems;
ambiguities = false, # casues 100s of hits in all dependencies
stale_deps = false, # Aqua complains about itself https://github.com/JuliaTesting/Aqua.jl/issues/78
)
end


include("framework.jl")

my_tests = [
Expand Down