Skip to content

[BUG] fixes correct passing of index in v2 - #2369

Open
phoeenniixx wants to merge 5 commits into
sktime:mainfrom
phoeenniixx:index-bug
Open

[BUG] fixes correct passing of index in v2#2369
phoeenniixx wants to merge 5 commits into
sktime:mainfrom
phoeenniixx:index-bug

Conversation

@phoeenniixx

Copy link
Copy Markdown
Member

Fixes #2367

Adds a new prediction_start_idx to the collate_fn that is returned when return_info has index.

@phoeenniixx phoeenniixx added bug Something isn't working ptf-v2 Related to `pytorch-forecasting` v2 labels Aug 5, 2026
@phoeenniixx

Copy link
Copy Markdown
Member Author

Has to remove index from the cell in the tutorial as previously it was just printing y[1] (a random placeholder, see here). We still need to add some thing like x_to_index of v1, to make this index actually useful. But for now, it is similar to v1, matching group with decoder_idx (see x_to_index).

But this breaks what the cell printed before, as now preds["index"] is a 2d tensor and not 1d. So, i just removed it, it makes no sense there.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@phoeenniixx
phoeenniixx marked this pull request as ready for review August 5, 2026 07:50
@phoeenniixx

Copy link
Copy Markdown
Member Author

The big diff in the tutorial is because I had to rerun the whole nb locally to update the outputs :)

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@062aeb4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pytorch_forecasting/callbacks/predict.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2369   +/-   ##
=======================================
  Coverage        ?   88.12%           
=======================================
  Files           ?      196           
  Lines           ?    11061           
  Branches        ?        0           
=======================================
  Hits            ?     9747           
  Misses          ?     1314           
  Partials        ?        0           
Flag Coverage Δ
cpu 88.12% <84.61%> (?)
pytest 88.12% <84.61%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fkiraly fkiraly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nb looks substantially different, can you kindly explain?

@phoeenniixx

Copy link
Copy Markdown
Member Author

The nb looks substantially different, can you kindly explain?

As the nb had wrong indexes printed (which were just y[1]), I had to rerun the whole nb to remove that wrong values.

@phoeenniixx
phoeenniixx requested a review from fkiraly August 26, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ptf-v2 Related to `pytorch-forecasting` v2

Projects

Development

Successfully merging this pull request may close these issues.

[BUG] index is not being returned correctly in v2

2 participants