ENH: Add filename parameter to _MonteCarloPlots.all() method for saving plots to disk #848
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds save functionality to the
_MonteCarloPlots.all()
method, allowing users to save Monte Carlo histogram plots to disk instead of only displaying them.Changes Made
filename=None
parameter to_MonteCarloPlots.all()
method following the existing pattern used in_FlightPlots
show_or_save_plot()
helper function for consistent file handling and validationresults_apogee.png
,results_x_impact.png
)Usage Examples
Key Features
filename
parameter pattern as other RocketPy plot methodsshow_or_save_plot()
helper for file validation and directory creationTesting
test_monte_carlo_plots_all_with_filename
that verifies both display and save modesThis enhancement addresses a gap in the Monte Carlo plotting functionality and provides consistency with other plotting methods in RocketPy.
Fixes #847.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.