RocketPy icon indicating copy to clipboard operation
RocketPy copied to clipboard

ENH: Pre-calculate attributes in Rocket class

Open Gui-FernandesBR opened this issue 1 year ago • 3 comments

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.md has 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.

Gui-FernandesBR avatar May 05 '24 04:05 Gui-FernandesBR

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.

codecov[bot] avatar May 05 '24 05:05 codecov[bot]

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

MateusStano avatar May 07 '24 19:05 MateusStano

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

MateusStano avatar May 07 '24 19:05 MateusStano

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.

Gui-FernandesBR avatar May 15 '24 13:05 Gui-FernandesBR