From 8b0126c67426cf1ed8761e0edf8730032d717e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=9Al=C4=99zak?= <128084860+jaksle@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:19:52 +0100 Subject: [PATCH] rem Compat, eachslice to maplices + reshape --- Project.toml | 2 -- src/interp.jl | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index c43890d0..e0df42fe 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,6 @@ authors = ["Simon Byrne and various contributors"] version = "0.6.8" [deps] -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" @@ -18,7 +17,6 @@ FFTW = "1" Interpolations = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15" StatsBase = "0.33, 0.34" julia = "1" -Compat = "2.2.0, 4" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/interp.jl b/src/interp.jl index c4498242..748dbc90 100644 --- a/src/interp.jl +++ b/src/interp.jl @@ -1,4 +1,3 @@ -import Compat: eachslice import Interpolations: interpolate, scale @@ -32,7 +31,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)) ) +pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = reshape(mapslices(v->pdf(ik, v), M, dims = 1), size(M)[2:end]) # 1 dimension pdf(k::UnivariateKDE,x) = pdf(InterpKDE(k),x)