-
-
Notifications
You must be signed in to change notification settings - Fork 174
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: Function Validation Rework & Swap np.searchsorted
to bisect_left
#582
ENH: Function Validation Rework & Swap np.searchsorted
to bisect_left
#582
Conversation
@MateusStano I made all the commentaries that I found important to be done in this first review. |
Also, @MateusStano can we make all the new methods completely private (i.e. use 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. |
np.searchsorted
to bisect_left
np.searchsorted
to bisect_left
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## mnt/flight-simulation-speed-up #582 +/- ##
=================================================================
Coverage ? 72.86%
=================================================================
Files ? 59
Lines ? 9547
Branches ? 0
=================================================================
Hits ? 6956
Misses ? 2591
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Gui-FernandesBR <[email protected]>
Co-authored-by: Gui-FernandesBR <[email protected]>
@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? |
f03adeb
into
mnt/flight-simulation-speed-up
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