def _set_t_end(self):
        # t_end is the timestep previous to t_start + horizon,
        # because the .loc[start:end] slice includes the end
        try:
            self.t_end = self.prev(int(self.t_start
                                   + self.config_model.opmode.horizon
                                   / self.data.time_res_data))
        except __HOLE__:
            # If t_end is beyond last timestep, cap it to last one, and
            # log the occurance
            t_bound = self.data._dt.index[-1]
            msg = 'Capping t_end to {}'.format(t_bound)
            logging.debug(msg)
            self.t_end = t_bound
        # print('\n\n***\n{}-{}\n***\n\n'.format(self.t_start, self.t_end))
dataset/ETHPy150Open calliope-project/calliope/calliope/core.py/Model._set_t_end