From 35320c0de84bdb02b37c8c23bfa9928fd1f8834b Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Wed, 18 Oct 2023 17:56:00 +0200 Subject: [PATCH] opt in to extrapolation for rating curves on DataInterpolations 4.4 (#677) Originally made in #663 as commit 959075f1550b556a97c584dedba54281de24203e. But since it fixes breakage, best to get it on main as soon as possible. --- core/Project.toml | 2 +- core/src/bmi.jl | 2 +- core/src/utils.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/Project.toml b/core/Project.toml index 4780c58df..31cf8981c 100644 --- a/core/Project.toml +++ b/core/Project.toml @@ -43,7 +43,7 @@ ComponentArrays = "0.13.14, 0.14, 0.15" Configurations = "0.17" DBInterface = "2.4" DataFrames = "1.4" -DataInterpolations = "3.7, 4" +DataInterpolations = "4.4" DataStructures = "0.18" Dictionaries = "0.3.25" DiffEqCallbacks = "2.29.1" diff --git a/core/src/bmi.jl b/core/src/bmi.jl index 13ce7a70e..c815d0b05 100644 --- a/core/src/bmi.jl +++ b/core/src/bmi.jl @@ -517,7 +517,7 @@ function update_tabulated_rating_curve!(integrator)::Nothing level = [row.level for row in group] discharge = [row.discharge for row in group] i = searchsortedfirst(node_id, id) - tables[i] = LinearInterpolation(discharge, level) + tables[i] = LinearInterpolation(discharge, level; extrapolate = true) end return nothing end diff --git a/core/src/utils.jl b/core/src/utils.jl index 8967a8850..70f9617eb 100644 --- a/core/src/utils.jl +++ b/core/src/utils.jl @@ -294,7 +294,7 @@ function qh_interpolation( level::AbstractVector, discharge::AbstractVector, )::Tuple{LinearInterpolation, Bool} - return LinearInterpolation(discharge, level), allunique(level) + return LinearInterpolation(discharge, level; extrapolate = true), allunique(level) end """