Skip to content

Commit

Permalink
Add warning when writing out dam node spec
Browse files Browse the repository at this point in the history
Cannot extract dam functions at this time
  • Loading branch information
ConnectedSystems committed Dec 29, 2024
1 parent 2b2ae01 commit 7a6bf11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Nodes/DamNode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ function DamNode(
calc_dam_level::Function,
calc_dam_area::Function,
calc_dam_discharge::Function,
calc_dam_outflow::Function) where {F<:Float64}
calc_dam_outflow::Function
) where {F<:Float64}
return DamNode(name, area, max_storage, storage_coef,
calc_dam_level, calc_dam_area, calc_dam_discharge, calc_dam_outflow,
F[initial_storage], F[], F[], F[], F[], F[], F[], F[])
Expand Down Expand Up @@ -339,7 +340,10 @@ Extract dam-specific values.
function extract_spec!(node::DamNode, spec::AbstractDict)::Nothing
spec["initial_storage"] = node.storage[1]
spec["max_storage"] = node.max_storage

# Cannot extract function implementation at this time (Julia v1.11)
# spec["parameters"]["calc_dam_level"]
@warn "Cannot extract dam calculations at this time. Functions must be manually copied."

return nothing
end

0 comments on commit 7a6bf11

Please sign in to comment.