Drop demand & pattern from junction

This commit is contained in:
WQY\qiong
2023-03-01 22:59:40 +08:00
parent e83d3a83a5
commit 628258ef52
6 changed files with 18 additions and 133 deletions

View File

@@ -185,6 +185,8 @@ def _read_inp(file: dict[str, list[str]]) -> ChangeSet:
coords = inp_in_coord(section)
for s in ['JUNCTIONS', 'RESERVOIRS', 'TANKS']:
for node in file_cs[s].operations:
if node['type'] == 'demand':
continue
if node['id'] in coords:
coord = coords[node['id']]
node |= { 'x' : coord['x'], 'y' : coord['y'] }
@@ -204,10 +206,6 @@ def _read_inp(file: dict[str, list[str]]) -> ChangeSet:
elif name == 'END':
pass # :)
# if demand section is empty, fill it with junction data
demands_cs = fill_demand(file_cs['JUNCTIONS'], file_cs['DEMANDS'])
file_cs['DEMANDS'].merge(demands_cs)
# release file
file = {}