Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check inside_interval_mask before computing splines #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrmcornish
Copy link

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.

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.
@arturbekasov
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants