11from functools import wraps
2- from typing import Iterable , List , Tuple , Union
2+ from typing import Iterable , List , Tuple , Union , overload
33
44import numpy as np
55import pandas as pd
@@ -54,7 +54,15 @@ def _pose_constructor(self):
5454
5555 return Pose
5656
57- def trajectory (self , index : Union [int , Iterable [int ]], inverse : bool = False ):
57+ @overload
58+ def trajectory (self , index : int , inverse : bool = False ) -> Trajectory : ...
59+
60+ @overload
61+ def trajectory (self , index : Iterable [int ], inverse : bool = False ) -> Self : ...
62+
63+ def trajectory (
64+ self , index : Union [int , Iterable [int ]], inverse : bool = False
65+ ) -> Trajectory | Self :
5866 """
5967 Select trajectory data for specific indices, or exclude them if inverse is set to True.
6068
@@ -67,7 +75,7 @@ def trajectory(self, index: Union[int, Iterable[int]], inverse: bool = False):
6775 are excluded from the resulting dataset, and all other trajectories are included. Defaults to False.
6876
6977 Returns:
70- TrajectoryDataset: A trajectory or multiple trajectories of the dataset.
78+ tasi.Trajectory | TrajectoryDataset: A trajectory or multiple trajectories of the dataset.
7179 """
7280
7381 if isinstance (index , (int , np .int_ )):
0 commit comments