Skip to content

Commit

Permalink
Merge pull request #102 from lanl-ansi/node_id
Browse files Browse the repository at this point in the history
retain source_id for junction-nodes without demand
  • Loading branch information
tasseff authored Aug 20, 2020
2 parents dff4e4e + b7eab3c commit b6d734d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/io/epanet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ function epanet_to_watermodels!(data::Dict{String,<:Any}; import_all::Bool = fal

for (i, junction) in data["junction"]
if isapprox(junction["demand"], 0.0, atol=1.0e-7)
# copy source_id to the corresponding node before deleting the junction
nodekey = string(junction["node"])
data["node"][nodekey]["source_id"] = junction["source_id"]
delete!(data["junction"], i)
haskey(data, "time_series") && delete!(data["time_series"]["junction"], i)
end
Expand Down

0 comments on commit b6d734d

Please sign in to comment.