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

Revert #12 #63

Merged
merged 1 commit into from
Dec 14, 2023
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
6 changes: 0 additions & 6 deletions src/PCHIPInterpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ struct Interpolator{Xs,Ys,Ds}
length(eachindex(xs, ys)) ≥ 2 || throw(ArgumentError("inputs must have at least 2 elements"))
_is_strictly_increasing(xs) || throw(ArgumentError("xs must be strictly increasing"))

xs = deepcopy(xs)
ys = deepcopy(ys)
ds = _pchip_ds_scipy(xs, ys)

new{typeof(xs),typeof(ys),typeof(ds)}(xs, ys, ds)
Expand All @@ -68,10 +66,6 @@ struct Interpolator{Xs,Ys,Ds}
length(eachindex(xs, ys, ds)) ≥ 2 || throw(ArgumentError("inputs must have at least 2 elements"))
_is_strictly_increasing(xs) || throw(ArgumentError("xs must be strictly increasing"))

xs = deepcopy(xs)
ys = deepcopy(ys)
ds = deepcopy(ds)

new{typeof(xs),typeof(ys),typeof(ds)}(xs, ys, ds)
end
end
Expand Down
11 changes: 0 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,6 @@ end
@test itp(1) == 1
end

@testset "gh-11" begin
# Regression test for https://github.com/gerlero/PCHIPInterpolation.jl/issues/11
v = [1, 2, 3]
itp = Interpolator(v, v)
xs = copy(itp.xs)
ys = copy(itp.ys)
v .= -1
@test itp.xs == xs
@test itp.ys == ys
end

@testset "gh-31" begin
# Test correctness of _pchip_ds_scipy implementation following https://github.com/gerlero/PCHIPInterpolation.jl/issues/31
# Tests that the interpolated values are the same as SciPy
Expand Down