Skip to content

Commit

Permalink
Workarounds for missing Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjankovic committed Dec 19, 2023
1 parent da723d1 commit 5eb92c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions omf/models/microgridDesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def makeGridLine(x,y,color,name):
powerWindToLoad = makeGridLine(x_values,outData['powerWindToLoad' + indexString],'purple','Load met by Wind')
plotData.append(powerWindToLoad)

if results['Generator']['size_kw'] > 0:
if 'Generator' in results and results['Generator']['size_kw'] > 0:
powerDieselToLoad = makeGridLine(x_values,outData['powerDieselToLoad' + indexString],'brown','Load met by Fossil Gen')
plotData.append(powerDieselToLoad)

Expand Down Expand Up @@ -1018,7 +1018,7 @@ def makeGridLine(x,y,color,name):
outData["windData" + indexString] = json.dumps(plotData, cls=plotly.utils.PlotlyJSONEncoder)

plotData = []
if results['Generator']['size_kw'] > 0:
if 'Generator' in results and results['Generator']['size_kw'] > 0:
powerDieselToLoad = makeGridLine(x_values,outData['powerDieselToLoad' + indexString],'brown','Fossil Gen used to meet Load')
plotData.append(powerDieselToLoad)

Expand Down Expand Up @@ -1048,7 +1048,7 @@ def makeGridLine(x,y,color,name):
powerWindToBattery = makeGridLine(x_values,outData['powerWindToBattery' + indexString],'purple','Wind')
plotData.append(powerWindToBattery)

if results['Generator']['size_kw'] > 0:
if 'Generator' in results and results['Generator']['size_kw'] > 0:
powerDieselToBattery = makeGridLine(x_values,outData['powerDieselToBattery' + indexString],'brown','Fossil Gen')
plotData.append(powerDieselToBattery)

Expand Down

0 comments on commit 5eb92c7

Please sign in to comment.