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

Fix merge issues #369

Merged
merged 4 commits into from
Dec 3, 2024
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: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ RegularizationTools = "0.6"
SafeTestsets = "0.1"
StableRNGs = "1"
Symbolics = "5.29, 6"
Test = "1"
Unitful = "1"
Test = "1.10"
Unitful = "1.21.1"
Zygote = "0.6.70"
julia = "1.10"

Expand Down
2 changes: 1 addition & 1 deletion src/interpolation_methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function _interpolate(A::LinearInterpolation{<:AbstractVector}, t::Number, igues
idx = firstindex(A.u)
t1 = t2 = oneunit(eltype(A.t))
u1 = u2 = oneunit(eltype(A.u))
slope = t/t * get_parameters(A, idx)
slope = t / t * get_parameters(A, idx)
else
idx = get_idx(A, t, iguess)
t1, t2 = A.t[idx], A.t[idx + 1]
Expand Down
8 changes: 4 additions & 4 deletions test/interpolation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ end
@test isnan(A(4.0))

u = [0.0, 1.0, 2.0, NaN]
A = LinearInterpolation(u, t; extrapolate = true)
A = LinearInterpolation(u, t; extrapolation = ExtrapolationType.Extension)
@test A(1.0) == 0.0
@test A(2.0) == 1.0
@test A(3.0) == 2.0
Expand Down Expand Up @@ -146,9 +146,9 @@ end

# NaN time value for Unitful arrays: issue #365
t = (0:3)u"s" # Unitful quantities
u = [0, -2, -1, -2]u"m"
A = LinearInterpolation(u, t; extrapolate = true)
@test isnan(A(NaN*u"s"))
u = [0, -2, -1, -2]u"m"
A = LinearInterpolation(u, t; extrapolation = ExtrapolationType.Extension)
@test isnan(A(NaN * u"s"))

# Nan time value:
t = 0.0:3 # Floats
Expand Down
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ using SafeTestsets
@safetestset "Derivative Tests" include("derivative_tests.jl")
@safetestset "Integral Tests" include("integral_tests.jl")
@safetestset "Integral Inverse Tests" include("integral_inverse_tests.jl")
@safetestset "Extrapolation" include("extrapolation_tests.jl")
@safetestset "Extrapolation Tests" include("extrapolation_tests.jl")
@safetestset "Online Tests" include("online_tests.jl")
@safetestset "Regularization Smoothing" include("regularization.jl")
@safetestset "Show methods" include("show.jl")
@safetestset "Zygote support" include("zygote_tests.jl")
@safetestset "Regularization Smoothing Tests" include("regularization.jl")
@safetestset "Show methods Tests" include("show.jl")
@safetestset "Zygote support Tests" include("zygote_tests.jl")
Loading