-
Notifications
You must be signed in to change notification settings - Fork 142
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
TimeConverter.reltime
with time_origin = np.timedelta64
sensitive to precision
#1738
Comments
Yes, agree that this should be fixed |
To be clear, I don't think think this bug is really encountered in production due to how the TimeConverter class is used. Regardless, I think this would be good to implement for robustness |
TimeConverter is primarily used in the Field/FieldSet/Grid classes (with usage outside those classes still highly related to those classes). With v4 and the reliance on xarray, this would no longer be a concern. |
Parcels version
master
Description
The internals of
TimeConverter
withnp.timedelta64
assumes that the precision is in seconds, when that might not actually be the case. Hencenp.timedelta64(1, "D") - 1
gives 0 when in reality it should be treated in seconds all the way.What would be a suitable precision for the object? I assume nanoseconds and then convert to float seconds for output?
Code sample
The text was updated successfully, but these errors were encountered: