Parse [RESERVOIRS]
This commit is contained in:
@@ -138,19 +138,19 @@ class InpJunction:
|
||||
def inp_in_junction(section: list[str]) -> ChangeSet:
|
||||
cs = ChangeSet()
|
||||
for s in section:
|
||||
junction = InpJunction(s)
|
||||
cs.append({'operation': API_ADD, 'type': 'junction', 'id': junction.id, 'elevation': junction.elevation, 'demand': junction.demand, 'pattern': junction.pattern})
|
||||
obj = InpJunction(s)
|
||||
cs.append({'operation': API_ADD, 'type': 'junction', 'id': obj.id, 'elevation': obj.elevation, 'demand': obj.demand, 'pattern': obj.pattern})
|
||||
return cs
|
||||
|
||||
|
||||
def inp_out_junction(name: str) -> list[str]:
|
||||
lines = []
|
||||
junctions = read_all(name, 'select * from junctions')
|
||||
for j in junctions:
|
||||
id = j['id']
|
||||
elev = j['elevation']
|
||||
demand = j['demand'] if j['demand'] != None else ''
|
||||
pattern = j['pattern'] if j['pattern'] != None else ''
|
||||
objs = read_all(name, 'select * from junctions')
|
||||
for obj in objs:
|
||||
id = obj['id']
|
||||
elev = obj['elevation']
|
||||
demand = obj['demand'] if obj['demand'] != None else ''
|
||||
pattern = obj['pattern'] if obj['pattern'] != None else ''
|
||||
desc = ';'
|
||||
lines.append(f'{id} {elev} {demand} {pattern} {desc}')
|
||||
return lines
|
||||
|
||||
Reference in New Issue
Block a user