Fix check for dropping to single cell in volume render#292
Fix check for dropping to single cell in volume render#292FHusko wants to merge 1 commit intoSWIFTSIM:masterfrom
Conversation
Updated the calculation for drop_to_single_cell to use a different formula based on the square root of 3.
|
Thanks for catching this. For the but that's just at a glance. I haven't studied this part of the code carefully, and unfortunately there's nothing in the test suite covering this function as far as I can tell. If you feel up to adding a test for that it's very welcome... |
|
I think the check in |
|
I've no strong objection to fixing this bug without fixing the special case at the same time, in that case could you open an issue describing what still needs to be looked at in future? The code comment is ok, but easily lost/overlooked. For this bugfix I still think that it would be worth having a regression test. Could use a single particle carefully placed so that it gets missed when the bug is present, but then gets included when the bug is fixed. Not sure how familiar you are with pytest, if you need some guidance just let me know. |
|
I'm not sure what's wrong with I'll update here once I've done something on a regression test. |
|
@FHusko don't suppose you've had a chance to write a test for this? |
|
@kyleaoman Not yet, sorry! I also got ill recently which set me back a bit. |
|
No problem, sorry to hear you haven't been well - no rush of course, might just send the occasional reminder. |
The volume render was sometimes missing particles altogether because their smoothing kernels did not encompass any cell centers. This is due to an incorrect one-half factor instead of sqrt(3) / 2 when checking how big the kernel is relative to the cell sizes.
I did not modify the
scatter_limited_zfunction, since that one isn't used at the moment and is not working anyways as far as I am aware.