Skip to content

[ENH] Add missing test for forward output of TimeXer as proposed in #1936 #1951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

PranavBhatP
Copy link
Contributor

What does this implement/fix? Explain your changes.

Adds the test for the output shapes of the forward method of TimeXer. The test checks the output contract for the model, which is being implemented in #1936. Currently skipped under test_timexer.py due to obvious causes of failure i.e current version of model on main is still not updated to the required output contract.

What should a reviewer concentrate their feedback on?

Did you add any tests for the change?

Any other comments?

PR checklist

  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
  • Added/modified tests
  • Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with pre-commit install.
    To run hooks independent of commit, execute pre-commit run --all-files

this is skipped for now since the version of timexer on main isn't compatible with the contract outlined by the test
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

tests seem to be failing?

@PranavBhatP
Copy link
Contributor Author

Everything seems to be fine on local, I'll take a look at the failure.

@PranavBhatP
Copy link
Contributor Author

I think I found the cause, there was an unnecessary predict call inside the _integration function.

@PranavBhatP PranavBhatP requested a review from fkiraly August 21, 2025 07:33
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b5eb779). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1951   +/-   ##
=======================================
  Coverage        ?   87.07%           
=======================================
  Files           ?      136           
  Lines           ?     8624           
  Branches        ?        0           
=======================================
  Hits            ?     7509           
  Misses          ?     1115           
  Partials        ?        0           
Flag Coverage Δ
cpu 87.07% <ø> (?)
pytest 87.07% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

waitasec, should there not be a test in TestAllEstimators too?

@PranavBhatP
Copy link
Contributor Author

PranavBhatP commented Aug 21, 2025

waitasec, should there not be a test in TestAllEstimators too?

the test in TestAllEstimators is more generic. it was working for the previous versions of this model as well. The link below shows how the output from forward is tested using model.predict with mode="raw".

https://github.com/sktime/pytorch-forecasting/blob/main/pytorch_forecasting/tests/test_all_estimators.py#L326
So I don't think we need to add one in TestAllEstimators. Please let me know, otherwise.
The specific case with respect to timexer is handled in this PR.

@fkiraly
Copy link
Collaborator

fkiraly commented Aug 22, 2025

I am still a little confused, because:

  • we found that TimeXer was nonconformant with a unified API
  • the TestAllEstimators tests did and still pass

So, it appears that we are missing conformance tests in TestAllEstimators, since they did not detect the non-conformance in TimeXer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PR in progress
Development

Successfully merging this pull request may close these issues.

2 participants