nsf
nsf copied to clipboard
Check inside_interval_mask before computing splines
In the (rare) event that there are no points inside the spline interval,
computing a spline crashes because it assumes implicitly that the
interval contains points (e.g. via use of min()). This patch fixes
this behaviour.
Nice and simple, thank you!
For this to be complete, any chance simple test cases could be added for affected functions? Should be as simple passing in inputs that are all outside of the spline interval, and making sure the outputs make sense (see https://github.com/bayesiains/nsf/blob/master/nde/transforms/splines/linear_test.py and other *_test.py files in the same folder).