-
-
Notifications
You must be signed in to change notification settings - Fork 218
ENH: add animations for motor propellant mass and tank fluid volumes #894
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
base: develop
Are you sure you want to change the base?
ENH: add animations for motor propellant mass and tank fluid volumes #894
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #894 +/- ##
===========================================
- Coverage 80.27% 80.04% -0.23%
===========================================
Files 104 106 +2
Lines 12769 13077 +308
===========================================
+ Hits 10250 10468 +218
- Misses 2519 2609 +90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Great one!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds animation capabilities to RocketPy's plotting functionality, enabling users to visualize motor propellant mass and tank fluid volume changes over time as animated GIFs. The implementation introduces two new animation methods and a helper function to support animation saving/display, following the existing patterns in the codebase for plot methods.
Key Changes
- Added
show_or_save_animation()helper function to provide a consistent interface for saving or displaying matplotlib animations (similar to existingshow_or_save_plot()andshow_or_save_fig()) - Implemented
animate_propellant_mass()method for motors to visualize propellant mass depletion over burn time - Implemented
animate_fluid_volume()method for tanks to visualize liquid and gas volume evolution simultaneously
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| rocketpy/plots/plot_helpers.py | Added show_or_save_animation() helper function supporting .gif format with fps parameter and validation |
| rocketpy/plots/motor_plots.py | Added animate_propellant_mass() method to create animated visualization of motor propellant mass over time |
| rocketpy/plots/tank_plots.py | Added animate_fluid_volume() method to animate liquid and gas volume changes in tanks |
| tests/unit/test_plots.py | Added unit test for show_or_save_animation() covering both show and save behaviors |
| CHANGELOG.md | Updated with new enhancement entry for animation features |
Gui-FernandesBR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the code looks pretty good. I believe it is one of the best PRs I have received lately.
Something I would like to see here before approving is some examples of the plots you have generated. Would you mind sharing us a few screenshots/screen records?
Also, did you verify if your new methods works on jupyter notebooks?
|
@Bizo883 can you solve linters and codecoverage issues?
FYI: https://docs.rocketpy.org/en/latest/development/index.html |
…id_volume and solve linters issues



Pull request type
Checklist
black rocketpy/ tests/) has passed locallypytest tests -m slow --runslow) have passed locallyCHANGELOG.mdhas been updated (if relevant)Current behavior
Currently provides only static plots for motor propellant mass and tank fluid volumes.
New behavior
This PR introduces new animation features for motors and tanks:
--Motor animations
A new method animate_propellant_mass() creates an animation of propellant mass decreasing over time.
--Tank animations
A new method animate_fluid_volume() animates liquid volume and gas volume evolution simultaneously.
--Animation saving helper
Added show_or_save_animation() in plot_helpers.py, providing a interface for saving or displaying animations.
--Unit tests
Added test_show_or_save_animation ensuring correct behavior for .gif output and error handling of unsupported formats.
Breaking change
Additional information
Enter text here...