Skip to content

Commit

Permalink
Zebras: Fix index handling of SplitFrame.resize. (awslabs#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper authored Jun 28, 2023
1 parent 60dbf0a commit fc67da1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gluonts/zebras/_split_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def resize(
future_length = maybe.unwrap_or(future_length, self.future_length)

if index is not None:
start = index[0] + (self.past_length + past_length)
# Calculate new start. If current past_length is larger than the
# the new one, we shift it to the right, if it's smaller, we need
# to go further into the past (shift to the left)
start = index[0] + (self.past_length - past_length)
index = start.periods(past_length + future_length)

return _replace(
Expand Down

0 comments on commit fc67da1

Please sign in to comment.