Skip to content

Commit

Permalink
Add check for requires_even_sampling in forecast() (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
aadyotb committed Jun 28, 2022
1 parent 593ecb9 commit e0a79f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions merlion/models/forecast/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def resample_time_stamps(self, time_stamps: Union[int, List[int]], time_series_p
tf = resampled[-1]
time_stamps = to_timestamp(resampled)

elif not self.require_even_sampling:
resampled = to_pd_datetime(time_stamps)
tf = resampled[-1]

# Handle the cases where we don't have a max_forecast_steps
elif self.max_forecast_steps is None:
tf = to_pd_datetime(time_stamps[-1])
Expand Down

0 comments on commit e0a79f0

Please sign in to comment.