-
-
Notifications
You must be signed in to change notification settings - Fork 52
Add optional extrapolation methods #433
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
Add optional extrapolation methods #433
Conversation
Needs tests that this actually does what is expected. |
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.
Looking good! I added some small comments. Since there is no issue for this, it would be nice if you motivate these changes in the PR description.
src/integral_inverses.jl
Outdated
function invert_integral(A::ConstantInterpolation{<:AbstractVector{<:Number}}, | ||
extrapolation_left::ExtrapolationType.T = A.extrapolation_left, |
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.
function invert_integral(A::ConstantInterpolation{<:AbstractVector{<:Number}}, | |
extrapolation_left::ExtrapolationType.T = A.extrapolation_left, | |
function invert_integral( | |
A::ConstantInterpolation{<:AbstractVector{<:Number}}; | |
extrapolation_left::ExtrapolationType.T = A.extrapolation_left, |
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.
Nice
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Before, invert_integral inherits the extrapolation method from the interpolation it got in its construction.
If we did a piecewise linear interpolation with constant extrapolation, the inverted integral would not integrate beyond the input data. With this change, we can set the extrapolation method of invert_integral independent of the interpolation.