Skip to content

Commit

Permalink
trying Compat for eachslice in Julia 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jaksle committed Feb 7, 2024
1 parent d4b7976 commit d3ade85
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
Compat = "2.2.0"
Distributions = "0.23, 0.24, 0.25"
DocStringExtensions = "0.8, 0.9"
FFTW = "1"
Expand Down
1 change: 1 addition & 0 deletions src/KernelDensity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using DocStringExtensions: TYPEDEF, FIELDS
using StatsBase
using Distributions
using Interpolations
using Compat

import Distributions: twoπ, pdf
import FFTW: rfft, irfft
Expand Down
2 changes: 1 addition & 1 deletion src/interp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ InterpKDE(kde::BivariateKDE) = InterpKDE(kde::BivariateKDE, BSpline(Quadratic(Li
# any dimension
pdf(ik::InterpKDE,x::Real...) = ik.itp(x...)
pdf(ik::InterpKDE, V::AbstractVector) = ik.itp(V...)
pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = pdf.(ik,eachslice(M, dims=ntuple(i->i+1, N-1)) )
@compat pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = pdf.(ik,eachslice(M, dims=ntuple(i->i+1, N-1)) )

# 1 dimension
pdf(k::UnivariateKDE,x) = pdf(InterpKDE(k),x)
Expand Down

0 comments on commit d3ade85

Please sign in to comment.