From 91323030a77740c079fbdd5beff0f14b3f7f6292 Mon Sep 17 00:00:00 2001 From: Wu-Jung Lee Date: Sun, 2 Feb 2025 15:06:18 +0800 Subject: [PATCH] Assemble AD2CP timestamp with nanosecond precision (#1436) * assemble ad2cp timestamp at ns instead of us * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add noqa --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- echopype/convert/parse_ad2cp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/echopype/convert/parse_ad2cp.py b/echopype/convert/parse_ad2cp.py index 51ebc9848..c98190495 100644 --- a/echopype/convert/parse_ad2cp.py +++ b/echopype/convert/parse_ad2cp.py @@ -328,7 +328,8 @@ def timestamp(self) -> np.datetime64: microsec100 = self.data["microsec100"] try: return np.datetime64( - f"{year:04}-{month:02}-{day:02}T{hour:02}:{minute:02}:{seconds:02}.{microsec100:04}" + f"{year:04}-{month:02}-{day:02}T{hour:02}:{minute:02}:{seconds:02}.{microsec100:04}", # noqa + "ns", ) # type: ignore except ValueError: return np.datetime64("NaT") # type: ignore