← Back to Pull requests

[ENH] Add minimal vignette tests for v2 design and fix default datamodule compatibility #2475

Open
unknown opened this pull request with 332 lines diff across 4 files
View on GitHub
unknown unknown commented on Oct 22, 2026 13:27 UTC
Author

Reference Issues/PRs


Fixes #2469. See also #2434.

What does this implement/fix? Explain your changes.


This PR addresses issue #2469 by adding end-to-end minimal vignette tests for all v2 forecasters and fixing a default parameter incompatibility between tree-decomposition models (such as SCINetForecaster) and EncoderDecoderTimeSeriesDataModule:

1. Updated Default max_encoder_length to 32:
- Changed the default max_encoder_length in EncoderDecoderTimeSeriesDataModule from 30 to 32 (a power of 2: $2^5$).
- This ensures default context lengths are divisible by 2, 4, 8, 16, and 32, resolving the failure reported in PR #2434 discussion_r4231012615 where SCINetForecaster() with default num_levels=3 failed due to 30 % (23) != 0.

2. Added Generic test_minimal_vignette in TestAllPtForecastersV2:
- Added _make_minimal_vignette_data helper in pytorch_forecasting/tests/test_all_v2/utils.py.
- Added test_minimal_vignette to TestAllPtForecastersV2 in pytorch_forecasting/tests/test_all_v2/test_all_estimators_v2.py to ensure every current and future v2 forecaster automatically runs a minimal vignette with all defaults.

3. Added Dedicated Tests in tests/test_models/test_minimal_vignette_v2.py**:
- test_minimal_vignette_all_models_defaults: Tests all 11 v2 forecasters (DLinearForecaster, DecoderMLPForecaster, FreTSForecaster, PatchTSTForecaster, SCINetForecaster, SOFTSForecaster, SamformerForecaster, TFTForecaster, TIDEForecaster, TimeXerForecaster, xLSTMTimeForecaster) end-to-end with defaults.
- test_scinet_default_compatibility_regression: Targeted regression test reproducing the exact issue from #2469.

What should a reviewer concentrate their feedback on?


  • The choice of updating max_encoder_length: int = 32 as default in EncoderDecoderTimeSeriesDataModule.

  • Verification that all 11 v2 forecasters execute the minimal vignette with defaults without errors.
  • Did you add any tests for the change?


    Yes:
  • test_minimal_vignette in pytorch_forecasting/tests/test_all_v2/test_all_estimators_v2.py

  • tests/test_models/test_minimal_vignette_v2.py (test_minimal_vignette_all_models_defaults and test_scinet_default_compatibility_regression)
  • Any other comments?


    Dependent on #2434. Once #2434 is merged into v2-dev, this PR will automatically update to show only commit 4af120f.

    PR checklist


  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG].

  • Added/modified tests

  • Used pre-commit hooks when committing to ensure that code is compliant with hooks.
  • Diff: 332 lines (+249 / -83) across 4 files Reviewer: phoeenniixx Review duration: 13267m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 332 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #2475"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.1% (MEDIUM) · Higher = larger blast radius
    42.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%