From aac61b006893d2fd471865841e682db230ace3ef Mon Sep 17 00:00:00 2001 From: Niko Sirmpilatze Date: Wed, 18 Dec 2024 15:08:21 +0000 Subject: [PATCH] fix mypy error in py3.12 (#372) --- movement/io/load_poses.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/movement/io/load_poses.py b/movement/io/load_poses.py index 9eaa814f..9c6c8216 100644 --- a/movement/io/load_poses.py +++ b/movement/io/load_poses.py @@ -682,11 +682,13 @@ def _ds_from_valid_data(data: ValidPosesDataset) -> xr.Dataset: n_frames = data.position_array.shape[0] n_space = data.position_array.shape[1] # Create the time coordinate, depending on the value of fps - time_coords = np.arange(n_frames, dtype=int) - time_unit = "frames" if data.fps is not None: - time_coords = time_coords / data.fps + time_coords = np.arange(n_frames, dtype=float) / data.fps time_unit = "seconds" + else: + time_coords = np.arange(n_frames, dtype=int) + time_unit = "frames" + DIM_NAMES = ValidPosesDataset.DIM_NAMES # Convert data to an xarray.Dataset return xr.Dataset(