Skip to content

Runtime crash in Samformer initialization when metadata is None - #2402

Open
victorwon2001 wants to merge 1 commit into
sktime:mainfrom
victorwon2001:fix/issue-2212
Open

Runtime crash in Samformer initialization when metadata is None#2402
victorwon2001 wants to merge 1 commit into
sktime:mainfrom
victorwon2001:fix/issue-2212

Conversation

@victorwon2001

Copy link
Copy Markdown
LLM generated content, by GPT-5.6 Sol

Reference Issues/PRs

Fixes #2212

What does this implement/fix? Explain your changes.

Samformer now validates metadata before base-model initialization and raises ValueError("metadata is required") when it is missing, matching the existing v2 model convention. The class docstring also documents that metadata is provided by EncoderDecoderTimeSeriesDataModule and lists the max_encoder_length, max_prediction_length, and encoder_cont keys consumed by Samformer.

What should a reviewer concentrate their feedback on?

  • The early validation behavior for direct Samformer construction.
  • The metadata documentation and focused regression test.

Did you add any tests for the change?

Yes. The focused metadata validation test and the Samformer v2 estimator suite pass, and pre-commit checks pass on the modified files.

Any other comments?

None.

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

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2402   +/-   ##
=======================================
  Coverage        ?   88.20%           
=======================================
  Files           ?      200           
  Lines           ?    11172           
  Branches        ?        0           
=======================================
  Hits            ?     9854           
  Misses          ?     1318           
  Partials        ?        0           
Flag Coverage Δ
cpu 88.20% <100.00%> (?)
pytest 88.20% <100.00%> (?)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime crash in Samformer initialization when metadata is None

1 participant