Skip to content

Commit

Permalink
save aggregated cahsflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisol Garrouste (INL) committed Aug 8, 2023
1 parent 14a4ca7 commit 7700573
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion use_cases/LWR_FT_2023/run/plot_cashflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def plot_lifetime_cashflows(lifetime_cashflows, axis, plant, dispatch_dir, title
def plot_all_locations():
locations = NPP_CAPACITIES.keys()
dir = os.path.dirname(os.path.abspath(__file__))
all_to_csv = pd.DataFrame()

fig, axs = plt.subplots(3,2, figsize = (11,13), sharey= True,layout='constrained')
fig.supylabel('M$ 2020(USD) / MWe')
Expand All @@ -169,12 +170,18 @@ def plot_all_locations():

# Aggregate cashflows
lifetime_cashflows = create_final_cashflows(discounted_cashflows)
lifetime_cashflows.transpose().to_csv(os.path.join(dir,dispatch_dir, 'lifetime_cashflows.csv'))
lifetime_cashflows_to_csv = lifetime_cashflows.transpose()
lifetime_cashflows_to_csv.rename(index={0:loc}, inplace=True)
print(lifetime_cashflows_to_csv)
lifetime_cashflows_to_csv.to_csv(os.path.join(dir,dispatch_dir, 'lifetime_cashflows.csv'))
all_to_csv = pd.concat([all_to_csv, lifetime_cashflows_to_csv], axis=0)

plot_lifetime_cashflows(lifetime_cashflows, axis = ax, plant = loc, dispatch_dir=dispatch_dir, title=title)
# dont need last space for graph
axs.flat[-1].axis('tight')
axs.flat[-1].axis('off')

all_to_csv.to_csv(os.path.join(dir, 'lwr_ft_cashflow_breakdown.csv'))
plt.savefig(os.path.join(dir, "total_cashflow_breakdown.png"))


Expand Down

0 comments on commit 7700573

Please sign in to comment.