Skip to content

Commit 84eaa96

Browse files
committed
adding Compat
1 parent 8d44f99 commit 84eaa96

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Project.toml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ authors = ["Simon Byrne and various contributors"]
44
version = "0.6.8"
55

66
[deps]
7+
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
78
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
89
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
910
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
@@ -17,6 +18,7 @@ FFTW = "1"
1718
Interpolations = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15"
1819
StatsBase = "0.33, 0.34"
1920
julia = "1"
21+
Compat = "3.22, 4"
2022

2123
[extras]
2224
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/interp.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import Compat: @compat
12
import Interpolations: interpolate, scale
23

4+
35
mutable struct InterpKDE{K,I} <: AbstractKDE
46
kde::K
57
itp::I
@@ -30,7 +32,7 @@ InterpKDE(kde::BivariateKDE) = InterpKDE(kde::BivariateKDE, BSpline(Quadratic(Li
3032
# any dimension
3133
pdf(ik::InterpKDE,x::Real...) = ik.itp(x...)
3234
pdf(ik::InterpKDE, V::AbstractVector) = ik.itp(V...)
33-
pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = pdf.(ik,eachslice(M, dims=ntuple(i->i+1, N-1)) )
35+
pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = @compat pdf.(ik,eachslice(M, dims=ntuple(i->i+1, N-1)) )
3436

3537
# 1 dimension
3638
pdf(k::UnivariateKDE,x) = pdf(InterpKDE(k),x)

0 commit comments

Comments
 (0)