Skip to content

Commit

Permalink
Merge 5e64f9f into d87940f
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Mar 14, 2024
2 parents d87940f + 5e64f9f commit 2cf1223
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 14 deletions.
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
Aqua = "0.8"
IntervalArithmetic = "^0.20"
IntervalRootFinding = "0.5"
LinearAlgebra = "<0.0.1, 1"
Markdown = "<0.0.1, 1"
Random = "<0.0.1, 1"
RecipesBase = "1"
Reexport = "1"
TaylorIntegration = "0.15"
Expand All @@ -27,9 +29,10 @@ Test = "<0.0.1, 1"
julia = "1"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["LinearAlgebra", "Random", "Test"]
test = ["Aqua", "LinearAlgebra", "Random", "Test"]
2 changes: 0 additions & 2 deletions src/TaylorModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import TaylorSeries: integrate, get_order, evaluate, pretty_print,
constant_term, linear_polynomial, nonlinear_polynomial,
fixorder, get_numvars

import IntervalArithmetic: showfull

import LinearAlgebra: norm

export TaylorModel1, RTaylorModel1, TaylorModelN, TMSol
Expand Down
23 changes: 12 additions & 11 deletions src/show.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# show.jl

function showfull(io::IO, f::Union{TaylorModel1, RTaylorModel1, TaylorModelN})
print(io,
"""Taylor model of degree $(get_order(f)):
- x0: $(expansion_point(f))
- I: $(domain(f))
- p: $(polynomial(f))
- Δ: $(remainder(f))
"""
)
end
showfull(x) = showfull(stdout::IO, x)
# Is the following really needed?
# function showfull(io::IO, f::Union{TaylorModel1, RTaylorModel1, TaylorModelN})
# print(io,
# """Taylor model of degree $(get_order(f)):
# - x0: $(expansion_point(f))
# - I: $(domain(f))
# - p: $(polynomial(f))
# - Δ: $(remainder(f))
# """
# )
# end
# showfull(x) = showfull(stdout::IO, x)

function show(io::IO, a::Union{TaylorModel1, RTaylorModel1, TaylorModelN})
if TaylorSeries._show_default[end]
Expand Down
36 changes: 36 additions & 0 deletions test/aqua.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Test
using TaylorModels
using Aqua

@testset "Aqua tests (performance)" begin
# This tests that we don't accidentally run into
# https://github.com/JuliaLang/julia/issues/29393
# Aqua.test_unbound_args(TaylorModels)
ua = Aqua.detect_unbound_args_recursively(TaylorModels)
@test length(ua) == 0

# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/1750
# Test that we're not introducing method ambiguities across deps
ambs = Aqua.detect_ambiguities(TaylorModels; recursive = true)
pkg_match(pkgname, pkdir::Nothing) = false
pkg_match(pkgname, pkdir::AbstractString) = occursin(pkgname, pkdir)
filter!(x -> pkg_match("TaylorModels", pkgdir(last(x).module)), ambs)
for method_ambiguity in ambs
@show method_ambiguity
end
if VERSION < v"1.10.0-DEV"
@test length(ambs) == 0
end
end

@testset "Aqua tests (additional)" begin
Aqua.test_undefined_exports(TaylorModels)
Aqua.test_deps_compat(TaylorModels)
Aqua.test_stale_deps(TaylorModels)
Aqua.test_piracies(TaylorModels)
Aqua.test_unbound_args(TaylorModels)
Aqua.test_project_extras(TaylorModels)
Aqua.test_persistent_tasks(TaylorModels)
end

nothing
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ include("RTM1.jl")
include("TMN.jl")
include("shrink-wrapping.jl")
include("validated_integ.jl")
include("aqua.jl")

0 comments on commit 2cf1223

Please sign in to comment.