Skip to content

Commit

Permalink
get number of individuals in a more xarray way
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Nov 15, 2023
1 parent 7c1cd8b commit 2af83e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions movement/io/save_poses.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def _auto_split_individuals(ds: xr.Dataset) -> bool:
"""Returns True if there is only one individual in the dataset,
else returns False."""

individuals = ds.coords["individuals"].data.tolist()
return True if len(individuals) == 1 else False
n_individuals = ds.sizes["individuals"]
return True if n_individuals == 1 else False


def _save_dlc_df(filepath: Path, df: pd.DataFrame) -> None:
Expand Down

0 comments on commit 2af83e1

Please sign in to comment.