-
Notifications
You must be signed in to change notification settings - Fork 678
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
Return distance results as float
rather than double
for 3.0 or make return type flexible.
#3927
Comments
Ideally a |
I'd say a dtype makes sense for a homogenous data structure like an array. For something heterogenous like a Universe it's a "nice to have". I think it's more important to think about loss of precision when you're working with the data than to make promises up-front. For instance, it may make a lot of sense to use double accumulator variables when aggregating float coordinates. |
The performance improvements that you show in #3914 (comment) make a strong case to give up the guarantee of double precision output. Admittedly, after reading the other thread I understand better why @richardjgowers suggests
as this situation would avoid any casting in between. I assume there will still be situations where we would want/need to use mixed precision. Do we make boxes double because that's what we get from trajectories or because we need it for, e.g., PBC stuff? |
My understanding is that the actual precision of coordinates as stored in the trajectory files varies wildly ie XTC it is less accurate than a There was also some arguments made that box ops should be done in double precision (I remember seeing these, I'll try and find them again). But I think this is a question of accuracy, i.e my tests done in distopia indicate you can get 5 sig fig accuracy with all floats anyway. |
Is your feature request related to a problem?
As detailed in #3914 and observed other places, the need to mix precision when computing distances makes the
mda.lib.distances
python and C++ layers slow. It also requires an ugly shim to get distopia to work properly and IMO does not make heaps of sense withfloat
coordinates to start with.Describe the solution you'd like
We could return
float
results or have the return type be flexible, Ie make no promises about the return type.Describe alternatives you've considered
Leave everything the way it is.
Leave your thoughts @MDAnalysis/coredevs as would be a breaking change.
The text was updated successfully, but these errors were encountered: