lbl-anp / becquerel

Becquerel is a Python package for analyzing nuclear spectroscopic measurements.
Other
43 stars 16 forks source link

Handle UNIX timestamps in `handle_datetime` #374

Closed jvavrek closed 5 months ago

jvavrek commented 1 year ago

Passing a UNIX timestamp like 1686726000.0 to handle_datetime currently gives an error, but we can parse it with datetime.fromtimestamp.

jvavrek commented 1 year ago

One test failure occurs on the CI but not my machine:

FAILED tests/utils_test.py::test_handle_datetime[1686726000.0] - AssertionError: assert datetime.datetime(2023, 6, 14, 7, 0) == datetime.datetime(2023, 6, 14, 0, 0)

This is almost certainly a timezone issue.

The other test failure is in isotope_qty_test.py, which I will investigate.

markbandstra commented 1 year ago

Sorry @jvavrek , I accidentally canceled the tests while trying to rerun them, I didn't see you had just pushed.

jvavrek commented 1 year ago

Sorry @jvavrek , I accidentally canceled the tests while trying to rerun them, I didn't see you had just pushed.

No problem. I only updated from main, so they were bound to fail again anyway.