Skip to content

Commit

Permalink
Tweak run.py script.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgpinkus committed Nov 4, 2024
1 parent c6ab019 commit d548bfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions device_kit/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,25 @@ def main():
output_filename = 'run-out/' + splitext(basename(args.filename))[0]

title = meta.get('title') if meta else None
fig, ax = plot_dataframe_as_stacked_bars(df)
fig, ax = plot_dataframe_as_stacked_bars(df, aggregation_level=3)

for (label, d) in df_derivs.iterrows():
ax.plot(d.index, d, label=label + '_deriv')
if label.find('supply') >= 0:
ax.plot(d.index, d, label=label + '_deriv')

_len = df.shape[1]
ax.set_xlim(-2, _len+2)
ax.set_ylim(-1, 1)
# ax.set_ylim(df.min(), df.max())
ax.set_title(title)
ax.legend(
prop={'size': 12},
prop={'size': 10},
# loc='upper right',
framealpha=0.6,
frameon=True,
fancybox=True,
borderaxespad=-3
)
fig.savefig(output_filename + '.png', format='png')
df['cumulative'] = df.sum(axis=1)
df.to_csv(output_filename + '.csv', float_format='%.3f')

print('Total Costs')
Expand Down
1 change: 1 addition & 0 deletions device_kit/sample_scenarios/single_home/single_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def make_home_devices():
'c2': 0.05,
'c3': 0.001,
'damage_depth': 0.2,
'start': 0.5,
'reserve': 0.5,
'capacity': 7,
'efficiency': 0.8,
Expand Down

0 comments on commit d548bfc

Please sign in to comment.