Skip to content

Commit

Permalink
Fix list index out of range error in vbatDispatch.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SaeedRazavi committed Aug 30, 2024
1 parent c2c4d45 commit 4732032
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion omf/models/vbatDispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
def pyVbat(modelDir, i):
vbType = i['load_type']
with open(pJoin(modelDir, 'temp.csv'), newline='') as f:
ambient = np.array([float(r[0]) for r in csv.reader(f)])
ambientList = []
for r in csv.reader(f):
if r:
ambientList.append(float(r[0]))
ambient = np.array(ambientList)
variables = [i['capacitance'], i['resistance'], i['power'], i['cop'],
i['deadband'], float(i['setpoint']), i['number_devices']]
variables = [float(v) for v in variables]
Expand Down

0 comments on commit 4732032

Please sign in to comment.