def METHOD_NAME(self, ts):
    try:
        ts.dimensions = (
            self.dimensions[0]
            if self.dimensions.shape[0] == 1
            else self.dimensions[ts.frame]
        )
    except IndexError as e:
        raise ValueError(
            f"Dimensions array has no data for frame {ts.frame}"
        ) from e
    return ts