Skip to content

Commit

Permalink
forgot signature + add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Jun 9, 2023
1 parent 05aec8c commit f352518
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Loess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function loess(
]
end

LoessModel(xs, ys, predictions_and_gradients, kdtree)
LoessModel(convert(Matrix{T}, xs), convert(Vector{T}, ys), predictions_and_gradients, kdtree)
end

loess(xs::AbstractVector{T}, ys::AbstractVector{T}; kwargs...) where {T<:AbstractFloat} =
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ using RDatasets
@test Loess.predict(model,x) y
end

@testset "reshaped views" begin
# See: https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/462
# and: https://github.com/JuliaStats/Loess.jl/pull/70
@test Loess.loess(reshape(view(rand(4), 1:4), (4, 1)), rand(4)) isa Loess.LoessModel
end

@testset "sine" begin
x = 1:10
y = sin.(1:10)
Expand Down

0 comments on commit f352518

Please sign in to comment.