Skip to content

Commit aac61b0

Browse files
authored
fix mypy error in py3.12 (#372)
1 parent 1f3ec8c commit aac61b0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

movement/io/load_poses.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,13 @@ def _ds_from_valid_data(data: ValidPosesDataset) -> xr.Dataset:
682682
n_frames = data.position_array.shape[0]
683683
n_space = data.position_array.shape[1]
684684
# Create the time coordinate, depending on the value of fps
685-
time_coords = np.arange(n_frames, dtype=int)
686-
time_unit = "frames"
687685
if data.fps is not None:
688-
time_coords = time_coords / data.fps
686+
time_coords = np.arange(n_frames, dtype=float) / data.fps
689687
time_unit = "seconds"
688+
else:
689+
time_coords = np.arange(n_frames, dtype=int)
690+
time_unit = "frames"
691+
690692
DIM_NAMES = ValidPosesDataset.DIM_NAMES
691693
# Convert data to an xarray.Dataset
692694
return xr.Dataset(

0 commit comments

Comments
 (0)