ENH: Pre-calculate attributes in Rocket class
Pull request type
- [x] Code changes (bugfix, features)
Checklist
- [x] Tests for the changes have been added (if needed)
- [x] Docs have been reviewed and added / updated
- [x] Lint (
black rocketpy/ tests/) has passed locally - [x] All tests (
pytest tests -m slow --runslow) have passed locally - [x]
CHANGELOG.mdhas been updated (if relevant)
Current behavior
The u_dot_generalized method is quite slow...
New behavior
Some calculations are now being done directly in the Rocket class, so the u_dot_generalized only needs to get it from the Rocket object, instead of calculating it repeatedly.
Breaking change
- [x] No
Additional information
This PR requires #594 to be merged.
Codecov Report
Attention: Patch coverage is 94.00000% with 3 lines in your changes are missing coverage. Please review.
Project coverage is 73.37%. Comparing base (
fc6804c) to head (61ebbc7). Report is 3 commits behind head on develop.
| Files | Patch % | Lines |
|---|---|---|
| rocketpy/simulation/flight.py | 85.71% | 2 Missing :warning: |
| rocketpy/rocket/aero_surface.py | 50.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #595 +/- ##
===========================================
+ Coverage 73.31% 73.37% +0.05%
===========================================
Files 57 57
Lines 9436 9453 +17
===========================================
+ Hits 6918 6936 +18
+ Misses 2518 2517 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Is there nothing in the other udots that can be changed to something saved in the rocket class or that can use the new derivative?
Might as well go all the way here
Is there nothing in the other udots that can be changed to something saved in the rocket class or that can use the new derivative?
Might as well go all the way here
nvm just saw your other PR
Is there nothing in the other udots that can be changed to something saved in the rocket class or that can use the new derivative?
Might as well go all the way here
This is a good suggestion. I changed a few attributes in the old u_dot that might be helpful.