Remove old inp in routine
This commit is contained in:
@@ -137,39 +137,9 @@ def set_pump_energy(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
# PUMP id {PRICE/PATTERN/EFFIC} value
|
||||
# DEMAND CHARGE value
|
||||
#--------------------------------------------------------------
|
||||
def inp_in_energy(section: list[str]) -> ChangeSet:
|
||||
cs = ChangeSet()
|
||||
|
||||
for s in section:
|
||||
if s.startswith(';'):
|
||||
continue
|
||||
|
||||
tokens = s.strip().split()
|
||||
|
||||
if tokens[0].upper() == 'PUMP':
|
||||
pump = tokens[1]
|
||||
key = tokens[2].lower()
|
||||
value = tokens[3]
|
||||
if key == 'price':
|
||||
value = float(value)
|
||||
cs.append(g_update_prefix | { 'type' : 'pump_energy', 'pump' : pump, key: value })
|
||||
|
||||
else:
|
||||
line = s.upper().strip()
|
||||
for key in get_energy_schema('').keys():
|
||||
if line.startswith(key):
|
||||
value = line.removeprefix(key).strip()
|
||||
|
||||
# exception here
|
||||
if line.startswith('GLOBAL EFFICIENCY'):
|
||||
value = line.removeprefix('GLOBAL EFFICIENCY').strip()
|
||||
|
||||
cs.append(g_update_prefix | { 'type' : 'energy', key : value })
|
||||
|
||||
return cs
|
||||
|
||||
|
||||
def inp_in_energy_new(line: str) -> str:
|
||||
def inp_in_energy(line: str) -> str:
|
||||
tokens = line.split()
|
||||
|
||||
if tokens[0].upper() == 'PUMP':
|
||||
|
||||
Reference in New Issue
Block a user