Skip to content

Commit

Permalink
opt in to extrapolation for rating curves on DataInterpolations 4.4 (#…
Browse files Browse the repository at this point in the history
…677)

Originally made in #663 as commit
959075f.
But since it fixes breakage, best to get it on main as soon as possible.
  • Loading branch information
visr authored Oct 18, 2023
1 parent 5b6232a commit 35320c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion core/src/bmi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down

0 comments on commit 35320c0

Please sign in to comment.