Skip to content
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

utils: iso8601: strip fractional seconds #56

Merged
merged 1 commit into from Apr 12, 2024

Conversation

liambeguin
Copy link
Contributor

According to ISO8601 any number of digits is permitted for fractional seconds, the issue is that Python assumes these are microsecond, and will fail if we have more than 6 digits.

In the event that we detect more that 6 digits, truncate the fractional part and pass it to datetime.

sigmf/utils.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
According to ISO8601 any number of digits is permitted for fractional
seconds, the issue is that Python assumes these are microsecond, and
will fail if we have more than 6 digits.

In the event that we detect more that 6 digits, truncate the fractional
part and pass it to datetime.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Copy link
Collaborator

@Teque5 Teque5 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@Teque5 Teque5 merged commit 2410874 into sigmf:main Apr 12, 2024
3 checks passed
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.

None yet

2 participants