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

fix: convert to datetime first in format_epoch to retain millisecond precision #84

Merged

Conversation

kyle-cochran
Copy link
Contributor

There is another fix for this I believe. astropy.Time takes an optional precision field. From the docs:

precision : int, optional
    Digits of precision in string representation of time

For example:

test_string = "2024-02-08T19:46:03.597928"
assert Time(test_string, precision=6).strftime("%Y-%m-%dT%H:%M:%S.%f") == test_string #true
assert Time(test_string).strftime("%Y-%m-%dT%H:%M:%S.%f") == test_string #false

Could also add a precision arg to everywhere Time is used, but that might be harder to keep track of in the library. Let me know your preference.

@bradsease bradsease added the bug Something isn't working label Apr 28, 2024
@bradsease bradsease merged commit 1b2ab64 into bradsease:main Apr 28, 2024
6 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8843274942

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 93.67%

Totals Coverage Status
Change from base Build 8218439654: 0.03%
Covered Lines: 873
Relevant Lines: 932

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants