Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add NdBSpline based interpolation methods to RGI#8276

Merged
takagi merged 7 commits into
cupy:mainfrom
ev-br:make_nd_2
Apr 12, 2024
Merged

add NdBSpline based interpolation methods to RGI#8276
takagi merged 7 commits into
cupy:mainfrom
ev-br:make_nd_2

Conversation

@ev-br

@ev-br ev-br commented Apr 4, 2024

Copy link
Copy Markdown
Contributor

Add a constructor for N-dimensional b-splines from data, which is new in SciPy 1.13.0.

The user API matches that of SciPy 1.13.0:

  • the constructor is exposed via the RegularGridInterpolator only
  • there is a slight backwards compat change: RGI(..., method="cubic") now goes through the NdBSpline. Previous behavior is available via RGI(..., method="cubic_legacy")
  • the new way is parametrically slower for construction of an interpolator (previously: essentially zero work; currently: construct and solve a large sparse linear system)
  • the new way is parametrically faster for evaluations: previously the evaluation went through a python loop over the data points, and for each data point a loop over the dimensions; the new way delegates to NdBSpline, which has a GPU kernel for evaluations.
  • new methods can compute the derivatives.

cross-ref #7186

ev-br and others added 5 commits April 4, 2024 08:52
…tests

1) csrlsvqr, thus spsolve is not available on hip;
2) Match scipy in skipping too slow tests: these tests are too slow
   for no good reason, and the behavior is anyway tested with other methods
   (slinear and slinear_legacy).
@ev-br ev-br marked this pull request as draft April 4, 2024 09:01
@ev-br ev-br changed the title Make nd 2 WIP: add NdBSpline based interpolation methods to RGI Apr 4, 2024
@ev-br ev-br marked this pull request as ready for review April 4, 2024 20:29
@ev-br ev-br changed the title WIP: add NdBSpline based interpolation methods to RGI add NdBSpline based interpolation methods to RGI Apr 4, 2024
@ev-br

ev-br commented Apr 4, 2024

Copy link
Copy Markdown
Contributor Author

This PR now includes Edgar's fixes for NdBSpline.design_matrix (thanks!) and is passing all tests locally.

@takagi takagi self-assigned this Apr 5, 2024
@takagi takagi added cat:feature New features/APIs prio:medium labels Apr 5, 2024
@takagi

takagi commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

/test mini

@takagi

takagi commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

Would you add make_ndbspl on scipy_interpolate.rst?

@ev-br

ev-br commented Apr 5, 2024

Copy link
Copy Markdown
Contributor Author

Would you add make_ndbspl on scipy_interpolate.rst?

It's private in SciPy, so this would go beyond the scipy 1.13.0 API at least. Yes/no?

@takagi

takagi commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

It's private in SciPy, so this would go beyond the scipy 1.13.0 API at least. Yes/no?

Thanks, we don't need it on the current document.

@takagi takagi enabled auto-merge April 5, 2024 06:33

@takagi takagi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@takagi takagi added this to the v14.0.0a1 milestone Apr 5, 2024
@takagi takagi disabled auto-merge April 12, 2024 05:21
@takagi takagi merged commit 36ce755 into cupy:main Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants