Closed MateusStano closed 2 months ago
@MateusStano I made all the commentaries that I found important to be done in this first review. Overall, code is much better and intuitive. Let's follow the discussions in the next days so we can merge this PR really soon.
Also, @MateusStano can we make all the new methods completely private (i.e. use def __your_private_method
) instead of using a single underscore?
These new methods won't be used out of the Function class, plus using double score seems better, it allows python to mangle the methods.
Attention: Patch coverage is 88.77005%
with 21 lines
in your changes are missing coverage. Please review.
:exclamation: No coverage uploaded for pull request base (
mnt/flight-simulation-speed-up@939d294
). Click here to learn what that means.:exclamation: Current head 29bb5fa differs from pull request most recent head 00a3c1f. Consider uploading reports for the commit 00a3c1f to get more accurate results
Files | Patch % | Lines |
---|---|---|
rocketpy/mathutils/function.py | 88.77% | 21 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@MateusStano good work solving the majority of commentaries!
Could you add tests for the lines missing coverage?
Also, @MateusStano could you please add your PR to the CHANGELOG?
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest tests -m slow --runslow
) have passed locallyCurrent behavior
get_value_opt
were usingnp.searchsorted
, which was slowNew behavior
source
->interpolation
andextrapolation
->inputs
,outputs
andtitle
. Theget_value_opt
function is now modularized and is defined according to the currentinterpolation
andextrapolation
bisect_left
is now used instead ofnp.searchsorted
. This cuts the execution time by half in au_dot_generalized
call.The
Function
class should behave exactly the same as before.Breaking change
Additional information
__img_dim__
that was never used and was always equal to 1. I changed it so its defined at the__init__
for backward compatibility purposes, but it is still never used__mul__
,__sub__
,__truediv__
and other operations by avoiding going through all the validation checks when re-initializing the Functions