Skip to content

Commit

Permalink
fix(build/plot): fix for co2 not properly working with per unit cost …
Browse files Browse the repository at this point in the history
…assignment
  • Loading branch information
MPavicevic committed Oct 24, 2023
1 parent cd2d5d9 commit e6238de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dispaset/postprocessing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def plot_dispatch(demand, plotdata, y_ax='', level=None, minlevel=None, curtailm
sumplot_pos = plotdata[cols[idx_zero:]].cumsum(axis=1)
sumplot_pos['zero'] = 0
sumplot_pos = sumplot_pos[['zero'] + sumplot_pos.columns[:-1].tolist()]
if level is not None:
if level is not None and not level.empty:
n = 3
height_ratio = [2.7, .8, .8]
else:
Expand Down Expand Up @@ -143,7 +143,7 @@ def plot_dispatch(demand, plotdata, y_ax='', level=None, minlevel=None, curtailm
colorlist = []

# Plot reservoir levels (either separated or as one value)
if level is not None:
if level is not None and not level.empty:
if isinstance(level, pd.DataFrame):
cols_lvl = level.columns.tolist()
sumplot_lev = level[cols_lvl[0:]].cumsum(axis=1)
Expand Down Expand Up @@ -240,7 +240,7 @@ def plot_dispatch(demand, plotdata, y_ax='', level=None, minlevel=None, curtailm
plt.legend(handles=[line_demand] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5))
elif not load_changed:
plt.legend(handles=[line_demand] + [line_SOC] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5))
elif level is None:
elif level is None or level.empty:
plt.legend(handles=[line_demand] + [line_shedload] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5))
if plot_lines:
axes[0].fill_between(demand.index, demand, reduced_demand, facecolor="none", hatch="X", edgecolor="k",
Expand Down
3 changes: 2 additions & 1 deletion dispaset/preprocessing/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ def build_single_run(config, profiles=None, PtLDemand=None, SectorXFlexDemand=No
# fuels = ['PriceOfNuclear', 'PriceOfBlackCoal', 'PriceOfGas', 'PriceOfFuelOil', 'PriceOfBiomass', 'PriceOfCO2',
# 'PriceOfLignite', 'PriceOfPeat', 'PriceOfAmmonia']
FuelEntries = {'BIO': 'PriceOfBiomass', 'GAS': 'PriceOfGas', 'HRD': 'PriceOfBlackCoal', 'LIG': 'PriceOfLignite',
'NUC': 'PriceOfNuclear', 'OIL': 'PriceOfFuelOil', 'PEA': 'PriceOfPeat', 'AMO': 'PriceOfAmmonia'}
'NUC': 'PriceOfNuclear', 'OIL': 'PriceOfFuelOil', 'PEA': 'PriceOfPeat', 'AMO': 'PriceOfAmmonia',
'PriceOfCO2': 'PriceOfCO2'}
FuelPrices = {}
for fuel in fuels:
fp = pd.DataFrame()
Expand Down

0 comments on commit e6238de

Please sign in to comment.