Skip to content

Fix for timestamp round-off issue in convert_gps_time #86

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

Merged
merged 4 commits into from
Sep 21, 2018

Conversation

cbertinato
Copy link
Collaborator

The underlying issue exposed in Issue #85 is due to a bug in a low-level function in the pandas library that converts timestamps of any unit into integers in nanoseconds. The fix in this PR should be considered temporary until the associated issue in pandas is fixed.

By passing a timestamp in nanoseconds to the pandas to_timedelta function, rather than a timestamp in seconds, the problematic code path in the pandas library is avoided.

Unit tests for the datetime_to_sow function were also included in this PR to catch this issue in the future.

Closes Issue #85

Chris Bertinato added 4 commits September 18, 2018 21:20
There are round-off errors in the pandas to_timedelta function. This interim fix until, which will remain until the issue gets addressed in the pandas code base, rounds datetimes to the nearest 1000 ns. This only works for times up to a precision of about 10 us.
@cbertinato cbertinato requested a review from bradyzp September 21, 2018 12:32
Copy link
Member

@bradyzp bradyzp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I don't see any issues.

@cbertinato cbertinato merged commit 0599622 into develop Sep 21, 2018
@cbertinato cbertinato deleted the bug/gps_time_rounding_issue branch September 21, 2018 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants