Skip to content

Commit

Permalink
fix mypy error in py3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Dec 18, 2024
1 parent 1f3ec8c commit cd133e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions movement/io/load_poses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit cd133e7

Please sign in to comment.