From 3b24d6ddea1dc953e7fed8ba1c63df365538d84e Mon Sep 17 00:00:00 2001 From: niksirbi Date: Wed, 18 Dec 2024 16:04:12 +0000 Subject: [PATCH] make mypy happy with numpy typing --- movement/io/nwb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/movement/io/nwb.py b/movement/io/nwb.py index c55b4fa2..b9ee57df 100644 --- a/movement/io/nwb.py +++ b/movement/io/nwb.py @@ -327,10 +327,10 @@ def _ds_from_pose_estimation_series( position_array = np.asarray(pose_estimation_series.data) # extract confidence data (n_time,) - if getattr(pose_estimation_series, "confidence", None) is None: - confidence_array = np.full(position_array.shape[0], np.nan) - else: + if getattr(pose_estimation_series, "confidence", None) is not None: confidence_array = np.asarray(pose_estimation_series.confidence) + else: + confidence_array = np.full(position_array.shape[0], np.nan) # Compute fps from the time differences between timestamps fps = np.nanmedian(1 / np.diff(pose_estimation_series.timestamps))