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

ENH: Display more information in MonteCarlo prints and plots #760

Merged
merged 11 commits into from
Jan 16, 2025

Conversation

EvanMad
Copy link
Contributor

@EvanMad EvanMad commented Dec 28, 2024

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Prints maximum, minimum, mean, std dev
Plots ^ parameters with histograms

New behavior

Prints maximum, minimum, mean, std dev, 95% PI Lower, 95% PI Upper
Plots ^ parameters with histograms and boxplots

Breaking change

  • Yes
  • No

Additional information

For issue #730

image
image

@EvanMad EvanMad marked this pull request as ready for review December 28, 2024 20:27
@EvanMad EvanMad requested a review from a team as a code owner December 28, 2024 20:27
@Gui-FernandesBR
Copy link
Member

@EvanMad tks for your submission.

I've noticed this PR is duplicated with #753 , therefore we will have to think decide how to proceed, either merging both PRs into one or selecting just one of them.

Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

Overall it is looking good

@EvanMad
Copy link
Contributor Author

EvanMad commented Dec 28, 2024

Apologies for duplicate. I saw that before opening the PR but it seemed like it was unfinished and contained errors

I believe this PR gets closer to resolving the original issue by combining the graphs onto the same plot

Let me know anything I can do to resolve this

@Gui-FernandesBR
Copy link
Member

Apologies for duplicate. I saw that before opening the PR but it seemed like it was unfinished and contained errors

I believe this PR gets closer to resolving the original issue by combining the graphs onto the same plot

Let me know anything I can do to resolve this

No problems. Your approach looks good. Once again, thanks for your submission.

@EvanMad EvanMad changed the base branch from master to develop December 28, 2024 21:19
@Gui-FernandesBR
Copy link
Member

@EvanMad our team is officially on vacations until January 6th.
We appreciate your patience when waiting for the final review.

Meanwhile, what you could already do is to solve linter issues pointed out by the GitHub Actions CI, or also solving the merge conflicts error.

Copy link
Contributor

@Lucas-Prates Lucas-Prates left a comment

Choose a reason for hiding this comment

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

Thank you for your interest in solving this issue, @EvanMad. Overall, things look great to me! I was able to reproduce your plot when running the monte carlo usage notebook with the newest version (3.10) of matplotlib, which is good. Here are some remarks:

  1. I encountered an issue when trying to call the plots.all method with version 3.5 of matplotlib, see image (1). This might be a problem since the current minimum requirement for matplotlib in our project is >=3.0 . If you wish to reproduce the error, install matplotlib==3.5 in a venv and run the monte carlo usage notebook;
  2. This is merely for aesthetic reasons: we could remove the x-axis ticks, y-axis ticks, and x-axis label from the box plot, circled in red ellipsis in image (2); (unifying the plot titles might be a good idea as well, but nevermind this for now)

Image (1) - Error when plotting with version 3.5 of matplotlib
image

Image (2) - Suggested elements to be removed from the plot

image

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.33%. Comparing base (83aa20e) to head (00148bc).
Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
rocketpy/simulation/monte_carlo.py 44.44% 5 Missing ⚠️
rocketpy/prints/monte_carlo_prints.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #760      +/-   ##
===========================================
- Coverage    76.42%   76.33%   -0.09%     
===========================================
  Files           95       96       +1     
  Lines        11090    11473     +383     
===========================================
+ Hits          8475     8758     +283     
- Misses        2615     2715     +100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

done by removing height_ratios and replacing with gridspec
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

LGTM,

@Lucas-Prates is the statistical side looking good to you as well?

@Lucas-Prates Lucas-Prates merged commit 52eab5c into RocketPy-Team:develop Jan 16, 2025
8 checks passed
Gui-FernandesBR pushed a commit that referenced this pull request Jan 19, 2025
* init: new prints test

* move new prints into mc class itself

* enh: boxplots added to histograms in montecarlo plots

* DOC: update changelog

* DOC: fix changelog issues

* ENH: cleaner calculation of result parameters

* enh: cleanup monte-carlo plots

* STY: linting fixes and re-format

* STL: remove extra files

* BUG: fix compatability with matplotlib==3.5

done by removing height_ratios and replacing with gridspec

---------

Co-authored-by: Evan Madurai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants