-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix interpolation framework when there are no valid points to interpolate #5623
Fix interpolation framework when there are no valid points to interpolate #5623
Conversation
test_interpolation_target_sphere<InterpTargetTestHelpers::ValidPoints::All>( | ||
make_not_null(&gen), num_spheres, intrp::AngularOrdering::Strahlkorper); | ||
test_interpolation_target_sphere< | ||
InterpTargetTestHelpers::ValidPoints::None>( |
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.
Should this test have a "Some" check?
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 can add one, it would be non-trivial as the target spheres are randomly generated. I might be able to do it with an offset spherical domain.
"[Unit]") { | ||
domain::creators::register_derived_with_charm(); | ||
run_test<InterpTargetTestHelpers::ValidPoints::All>(); | ||
run_test<InterpTargetTestHelpers::ValidPoints::None>(); |
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.
Should this test test "Some"?
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.
This would be more difficult to test as I would need to pass in which points are invalid. I didn't think it was worth the effort as the only difference between All and Some would be the invalid points print nan which is tested by None. I can add a comment saying so, or put in the effort for the additional test if you would prefere
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.
You can just add a comment. Same for the other test I commented on.
bde2f6b
to
7f9f60f
Compare
Needs a rebase. |
If the test fails with an uncaught exception, it will not delete the created output file. There is a check run before writing the file, but it specified the incorrect name.
This will occur for example if all interpolated points are invalid in which case the coordinates will be correct, but the data will be nans.
Add tests that they work correctly when there are invalid target points.
Prior to this change, if there were no valid target points, the interpolation target never received a subsequent message, which meant no cleanup was done, and the current temporal_id kept waiting for a message. For sequential targets this leads to a growing list of pending temporal_ids and accumulated volume data waiting to be interpolated. Now the interpolation target is sent a message, and will continue to do whatever it would have done if there was a subset of target points that are invalid. Added additional tests to some interpolation callbacks that would have failed prior to this change when there are no valid target points.
7f9f60f
to
8b15094
Compare
Proposed changes
If there were no valid interpolation points (i.e. all points were outside the Domain), the interpolation target was not informed. This led to a growing list of pending interpolations and uninterpolated volume data for sequential interpolation targets such as the apparent horizon finder.
Now I added a check for this case and send a message to the interpolation target that allows the interpolation target to do whatever it did when there was a mixture of valid and invalid interpolation points.
I also fixed a few minor things I encountered debugging this, as well as added tests that would have failed.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments