-
Notifications
You must be signed in to change notification settings - Fork 322
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
Fixes bug introduced by #3596 when handling NaNs. #3600
Fixes bug introduced by #3596 when handling NaNs. #3600
Conversation
ctrlPtsY[idx], | ||
order); | ||
// In case of NaN return zero. | ||
return 0.; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this might be hiding another issue? Is it possible that your CMC simulation/visualization is feeding this function a NaN value for x
which then gets masked by returning zero here. Or do you think the changes introduced new NaNs somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this was the previous behavior of the function. In that case, this is probably fine.
Looks like the intention was for the smoothSegmentedFunction to return NaN for a NaN as input (which makes sense).
Changed this PR to fix always returning
Note that without this PR an exception is raised if the input is NaN, which blows up some cases that were fine before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the clarification @pepbos.
Also, you can ignore the Mac failures, that is an issue with the CI. Working on a fix for that. |
My Pr #3596 introduced a bug, or triggered a bug elsewhere, when handling NaN's in SmoothSegmentedFunction.
Not sure when NaNs will be injected, and if that even makes sense, but before #3596 that was OK, but currently main will raise an exception. This PR makes it fine again, as was before #3596.
I noticed when trying to visualize my result from a CMC, which raised an exception now.
This change is