nsf icon indicating copy to clipboard operation
nsf copied to clipboard

Check inside_interval_mask before computing splines

Open jrmcornish opened this issue 6 years ago • 1 comments

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.

jrmcornish avatar Nov 25 '19 17:11 jrmcornish

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).

arturbekasov avatar Nov 28 '19 14:11 arturbekasov