Closed MichaelMauderer closed 5 years ago
Yep, I think all panics should be removed from the current public interface. Thanks for pointing out!
I think this is related: it only panics when the parameter is too big, when there are not enough points to the left, it just returns the leftmost point.
Couldn't the spline be clamped at both ends, so that one could interpolate all the way to both edges?
Edit: i was wrong, it panics at both ends, but seemingly only with numbers that are still within the parameter range, if the parameter is smaller than the start of the range, there are no issues.
Fixed. Will be part of splines-1.0.0-rc.1
.
This is not documented in the
clamped_sample
docstring. It might be even better if there was a more graceful fallback (e.g., returning an option).