Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Commit for Plotting Templates #1

Merged
merged 10 commits into from
May 27, 2021
Merged
7 changes: 4 additions & 3 deletions src/DispatchPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ def run(self):
ax = fig.add_subplot(len(grouped_vars),1,i+1)
for var in group:
# Plot the micro-step variable on the x-axis (i.ee Time)
var_label = var.replace('__', ' ').title()
var_label = var.split('__')[1].replace('_', ' ').title()
ax.plot(dat.iloc[:, 1], dat[var], label=var_label)
ax.set_title(key.title())
ax.set_xlabel('Time')
ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))
file_name = f"dispatch_id{sample_id}_y{macro_step}_c{cluster}.png"
fig.tight_layout()
fig.savefig(f"debug_dispatch_{sample_id}_{macro_step}_{cluster}.png")
self.raiseAMessage(f'Saved figure to "debug_dispatch_{sample_id}_{macro_step}_{cluster}.png"')
fig.savefig(file_name)
self.raiseAMessage(f'Saved figure to "{file_name}"')
plt.clf()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions tests/integration_tests/mechanics/debug_mode/tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
output = 'Debug_Run_o/dispatch.nc'
gold_files = 'gold/dispatch.nc'
[../]
[./debug_plot]
type = NetCDF
output = 'Debug_Run_o/dispatch_id0_y10_c0.png'
gold_files = 'gold/dispatch_id0_y10_c0.png'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the output needs a gold file, since it just checks generation, but I can see what this does later.

[../]
[../]
[]

Expand Down