Remove old inp in routine
This commit is contained in:
@@ -156,38 +156,9 @@ def delete_tank(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
# [EPA3]
|
||||
# id elev initlevel minlevel maxlevel diam minvol (vcurve)
|
||||
#--------------------------------------------------------------
|
||||
class InpTank:
|
||||
def __init__(self, line: str) -> None:
|
||||
tokens = line.split()
|
||||
|
||||
num = len(tokens)
|
||||
has_desc = tokens[-1].startswith(';')
|
||||
num_without_desc = (num - 1) if has_desc else num
|
||||
|
||||
self.id = str(tokens[0])
|
||||
self.elevation = float(tokens[1])
|
||||
self.init_level = float(tokens[2])
|
||||
self.min_level = float(tokens[3])
|
||||
self.max_level = float(tokens[4])
|
||||
self.diameter = float(tokens[5])
|
||||
self.min_vol = float(tokens[6]) if num_without_desc >= 7 else 0.0
|
||||
self.vol_curve = str(tokens[7]) if num_without_desc >= 8 and tokens[7] != '*' else None
|
||||
self.overflow = str(tokens[8].upper()) if num_without_desc >= 9 else None
|
||||
self.desc = str(tokens[-1]) if has_desc else None
|
||||
|
||||
|
||||
def inp_in_tank(section: list[str]) -> ChangeSet:
|
||||
cs = ChangeSet()
|
||||
for s in section:
|
||||
# skip comment
|
||||
if s.startswith(';'):
|
||||
continue
|
||||
obj = InpTank(s)
|
||||
cs.append(g_add_prefix | {'type': 'tank', 'id': obj.id, 'elevation': obj.elevation, 'init_level': obj.init_level, 'min_level': obj.min_level, 'max_level': obj.max_level, 'diameter': obj.diameter, 'min_vol': obj.min_vol, 'vol_curve': obj.vol_curve, 'overflow': obj.overflow})
|
||||
return cs
|
||||
|
||||
|
||||
def inp_in_tank_new(line: str) -> str:
|
||||
def inp_in_tank(line: str) -> str:
|
||||
tokens = line.split()
|
||||
|
||||
num = len(tokens)
|
||||
|
||||
Reference in New Issue
Block a user