Repository navigation
Conversation
closes theochem#261) - Add support for 'slinear', 'quintic', and 'pchip' methods in _HyperRectangleGrid.interpolate in addition to existing 'linear', 'nearest', and 'cubic' methods. - Route all non-derivative interpolations (nu_x == nu_y == nu_z == 0) to SciPy's RegularGridInterpolator, enabling vectorized evaluation on multiple points at once for all methods, including 'cubic'. - The custom CubicSpline-based derivative path is preserved and only used when nu_x, nu_y, or nu_z > 0. - Correctly apply np.exp() when use_log=True in the SciPy path. - Update tests: fix error message assertion and relax atol from 1e-6 to 1e-5 to match SciPy cubic's numerical precision characteristics.
Ao-chuba
force-pushed
the
feature/scipy-interpolation-issue-261
branch
from
February 24, 2026 19:59
ee8aa4a to
77394ea
Compare
Member
Author
|
Hi @marco-2023 , please review this PR whenever you have time. Thanks! |
marco-2023
requested changes
Nov 3, 2026
marco-2023
left a comment
Collaborator
There was a problem hiding this comment.
Thank you Aochuba for your constribution
The idea is sensible but needs furter development:
- Cubic interpolation and its derivatives use different potentially inconsistent implementations. When no derivative is requested, it uses scipy`s RegularGridInterpolator
- The existing cubic interpolation behavior changes, previous code supported extrapolation, current implementation doesn't.
- We need tests for new added methods.
- Keep cubic method on internal spline for consistency between values and derivatives - Enable extrapolation in SciPy RegularGridInterpolator with bounds_error=False, fill_value=None - Restore atol=1e-6 for cubic Gaussian interpolation test - Add comprehensive tests for slinear, quintic, and pchip methods, extrapolation, and derivative error handling
Member
Author
|
Thanks for the review @marco-2023 I've updated the PR:
All tests pass. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@PaulWAyers @Ali-Tehrani ,

This PR updates
_HyperRectangleGrid.interpolateto route non-derivative interpolations directly to SciPy'sRegularGridInterpolator. This enables vectorized evaluation on multiple points and exposes additional interpolation methods likeslinear,quintic, andpchip.Tested and all existing tests pass
Closes #261