Add Nearest Neighbor interpolator#287
Conversation
|
Dear @kshitij-maths, I'm quite lost in understanding the new approximator. |
|
This implementation was added specifically to resolve Issue #166, which explicitly requests wrappers for the standard SciPy interpolators. While the theoretical background is identical to
In conclusion, this provides the pure geometric interpolation toolset requested in #166, logically separated from the ML regression pipeline. Feel free to close the PR without merging if you find these additions are useless. |
|
I do not agree with the two points:
Once more, please do not change the original message of the issues: you wrote that
But it's not the truth! The issue is just asking for new interpolators, since Scipy has something like 20-30 different implementations, and it would be nice to exploit them on EZyRB. But no one asked for re-implementing an interpolator already in EZyRB. Maybe next time consider which addition adds more value to the package, instead of just "doing something because you have to". And if you're not sure about it, please ask directly in the issue (or open discussion, propose a plan, etc, there are plenty of possible ways for a constructive development. |
|
Feel free to close the PR!! |
This PR implements the Nearest Neighbor interpolator requested in #166, supporting both univariate and multivariate parameter spaces.
Key Features:
scipy.interpolate.interp1d(kind='nearest')for 1D spaces (withfill_value='extrapolate'for robust boundary handling).scipy.interpolate.NearestNDInterpolatorfor ND spaces.rescale=Trueargument by default for the ND interpolator to prevent severe distance scaling distortions across physical parameters of varying magnitudes.Testing:
tests/test_nearest.py(8 passing tests).tests/test_parallel/test_nearest.py.More interpolators such as splines etc will be added in subsequent additions.