MDAnalysis / distopia

SIMD instructions for faster distance calculations.
https://www.mdanalysis.org/distopia/
10 stars 5 forks source link

Dihedral NaN behavour is not the same as MDAnalysis #151

Open hmacdope opened 1 month ago

hmacdope commented 1 month ago

We are not catching NaNs the same way as MDAnalysis is here for dihedrals, where the atan2 input is 0/0

The NaN bit may be being set correctly, but we are just not catching it

https://github.com/MDAnalysis/mdanalysis/blob/cfda8b792ef906820fd330e016b64ff5f6733600/package/MDAnalysis/lib/include/calc_distances.h#L757

Instead they are coming back as -0.0 in numpy repr. We may be able to mask these out at the python layer.

richardjgowers commented 1 month ago

for future reference, the atan2 we're using is here:

https://github.com/google/highway/blob/d0e4aba5a280ed4fa500b0ae7dd6210f46523df1/hwy/contrib/math/math-inl.h#L139