Skip to content

Commit

Permalink
Add Compats in front of round
Browse files Browse the repository at this point in the history
`round` in v0.6 does not take in keyword arguments
Have to add a `base` keyword argument now while waiting for
JuliaLang/Compat.jl#537
  • Loading branch information
darwindarak committed Jun 30, 2018
1 parent f6ad290 commit 4aad8ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/RigidBodyMotions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ RigidBodyMotion(kin::Kinematics) = RigidBodyMotion(kin(0)..., kin)

function show(io::IO, m::RigidBodyMotion)
println(io, "Rigid Body Motion:")
println(io, " ċ = $(round(m.ċ, digits=2))")
println(io, " c̈ = $(round(m.c̈, digits=2))")
println(io, " α̇ = $(round(m.α̇, digits=2))")
println(io, " ċ = $(Compat.round(m.ċ, digits=2, base=10))")
println(io, " c̈ = $(Compat.round(m.c̈, digits=2, base=10))")
println(io, " α̇ = $(Compat.round(m.α̇, digits=2, base=10))")
print(io, " $(m.kin)")
end

Expand Down Expand Up @@ -379,13 +379,13 @@ struct Sinusoid <: Profile
ω::Float64
end
(s::Sinusoid)(t) = sin(s.ω*t)
show(io::IO, s::Sinusoid) = print(io, "Sinusoid (ω = $(round(s.ω, digits=2)))")
show(io::IO, s::Sinusoid) = print(io, "Sinusoid (ω = $(Compat.round(s.ω, digits=2, base=10)))")

struct EldredgeRamp <: Profile
aₛ::Float64
end
(r::EldredgeRamp)(t) = 0.5(log(2cosh(r.aₛ*t)) + r.aₛ*t)/r.aₛ
show(io::IO, r::EldredgeRamp) = print(io, "logcosh ramp (aₛ = $(round(r.aₛ, digits=2)))")
show(io::IO, r::EldredgeRamp) = print(io, "logcosh ramp (aₛ = $(Compat.round(r.aₛ, digits=2, base=10)))")

struct ColoniusRamp <: Profile
n::Int
Expand All @@ -404,6 +404,6 @@ function (r::ColoniusRamp)(t)
f*Δt^(r.n + 2)/(2r.n + 2)
end
end
show(io::IO, r::ColoniusRamp) = print(io, "power series ramp (n = $(round(r.n, digits=2)))")
show(io::IO, r::ColoniusRamp) = print(io, "power series ramp (n = $(Compat.round(r.n, digits=2, base=10)))")

end
4 changes: 2 additions & 2 deletions src/elements/Bodies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ ConformalBody() = ConformalBody(PowerMap(ComplexF64(1)))

function Base.show(io::IO, b::ConformalBody)
println(io, "Body generated by: $(b.m)")
println(io, " centroid at $(round(b.c, digits=4))")
println(io, " angle $(round(b.α, digits=4))")
println(io, " centroid at $(Compat.round(b.c, digits=4, base=10))")
println(io, " angle $(Compat.round(b.α, digits=4, base=10))")
end


Expand Down
4 changes: 2 additions & 2 deletions src/elements/Plates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ include("plates/pressure.jl")

function Base.show(io::IO, p::Plate)
lesp, tesp = suction_parameters(p)
println(io, "Plate: N = $(p.N), L = $(p.L), c = $(p.c), α = $(round(rad2deg(p.α), digits=2))")
print(io, " LESP = $(round(lesp, digits=2)), TESP = $(round(tesp, digits=2))")
println(io, "Plate: N = $(p.N), L = $(p.L), c = $(p.c), α = $(Compat.round(rad2deg(p.α), digits=2, base=10))")
print(io, " LESP = $(Compat.round(lesp, digits=2, base=10)), TESP = $(Compat.round(tesp, digits=2, base=10))")
end

end
2 changes: 1 addition & 1 deletion src/elements/Vortex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Sheet(zs::AbstractVector, Ss::AbstractVector{Float64}, δ::Float64) = Sheets.Sh

function Base.show(io::IO, s::Sheet)
L = Sheets.arclength(s)
print(io, "Vortex Sheet: L ≈ $(round(L, digits=3)), Γ = $(round(s.Ss[end] - s.Ss[1], digits=3)), δ = $(round(s.δ, digits=3))")
print(io, "Vortex Sheet: L ≈ $(Compat.round(L, digits=3, base=10)), Γ = $(Compat.round(s.Ss[end] - s.Ss[1], digits=3, base=10)), δ = $(Compat.round(s.δ, digits=3, base=10))")
end

circulation(s::Sheet) = s.Ss[end] - s.Ss[1]
Expand Down

0 comments on commit 4aad8ae

Please sign in to comment.