From 9530aa6f6f7c8820ec81dbb61529d09644657292 Mon Sep 17 00:00:00 2001 From: Ashutosh Bharambe Date: Mon, 23 Sep 2024 10:40:09 +0000 Subject: [PATCH] fix(LinearInterpolation): better check for arrays --- src/parameter_caches.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parameter_caches.jl b/src/parameter_caches.jl index bfd9f87e..83f574b8 100644 --- a/src/parameter_caches.jl +++ b/src/parameter_caches.jl @@ -18,8 +18,8 @@ function safe_diff(b, a::T) where {T} b == a ? zero(T) : b - a end -function linear_interpolation_parameters(u::AbstractArray{T}, t, idx) where {T} - Δu = if u isa AbstractArray +function linear_interpolation_parameters(u::AbstractArray{T, N}, t, idx) where {T, N} + Δu = if N > 1 ax = axes(u) safe_diff.(u[ax[1:end-1]..., idx+1:idx+1] , u[ax[1:end-1]..., idx:idx]) else