Skip to content

Commit

Permalink
Allow for NaNs for drainage and infiltration
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Feb 1, 2024
1 parent 5f5e09a commit 473b058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ If a value is NaN, it is not set.
function set_table_row!(table::NamedTuple, row, i::Int)::NamedTuple
for (symbol, vector) in pairs(table)
val = getproperty(row, symbol)
if !isnan(val)
if !ismissing(val) && !isnan(val)
vector[i] = val
end
end
Expand Down Expand Up @@ -668,7 +668,7 @@ function set_current_value!(
for (i, id) in enumerate(node_id)
for (symbol, vector) in pairs(table)
idx = findlast(
row -> row.node_id == id && !isnan(getproperty(row, symbol)),
row -> row.node_id == id && !ismissing(getproperty(row, symbol)),
pre_table,
)
if idx !== nothing
Expand Down
4 changes: 2 additions & 2 deletions core/src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ end
@version BasinTimeV1 begin
node_id::Int
time::DateTime
drainage::Float64
drainage::Union{Missing, Float64}
potential_evaporation::Float64
infiltration::Float64
infiltration::Union{Missing, Float64}
precipitation::Float64
urban_runoff::Float64
end
Expand Down

0 comments on commit 473b058

Please sign in to comment.