ENH: cupyx/scipy/interpolate: add *UnivariateSpline for 1D smoothing splines #8267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add UnivariateSpline family of classes.
SciPy plans to refactor / rework the matching part of scipy.interpolate, the current SciPy proposal is to add two two new functions,
make_splrep
andmake_splprep
and slowly phase outsplrep
,splprep
and*UnivariateSpline
s, see scipy/scipy#19970 . Since this is still under discussion in SciPy, here we add two layers:make_splrep
: add internally but do not expose to the public API. If/when this lands in SciPy, CuPy will only need to add them to__init__
to expose them.*UnivariateSpline
classes. These reuse themake_splrep
internally and adjust the API to match the venerable SciPy API.The differences to the SciPy API are minimal:
k <= 5
. We do not have this limitation here.UnivariateSpline.roots
is not implemented. This is similar to other.roots
methods which rely on solving the non-symmetric eigenvalue problem.Also note that this PR only deals with construction of an interpolant. Once constructed, evaluations go through
BSpline.__call__
method, so the runtime performance relates toBSpline
.This PR is on top of #8263, which adds a needed low-level kernel.
cross-ref #7186 for the tracker.