← Back to Pull requests

&Faakhir30 [ENH] Update Datamodules according to new API design #2423

Closed
unknown closed this pull request without merging on Oct 21, 2026 11:07 UTC
View on GitHub
unknown unknown commented on Sep 11, 2026 07:04 UTC
Author

Stacks on #2410 (and #2313 in coming commits FYI @Faakhir30 )
Also see #2407, #2398

This PR is aimed at v2-dev instead of main, so that we dont break current user code until this design is complete and stable. See #2407 for details. So I had to update the branch target in the workflows for the tests to run (which might fail due to the changes)

Stack


  • TimeSeries - #2410

  • Datamodule - #2423 <- This PR

  • Forecaster - #2434
  • Note


    The tutorials will fail for sure, will update the notebook in one of the branchs stacked over this PR.
    Still need to add the Forecaster and tests - will add the notebook and docs changes on the upcoming branches as the vignette is incomplete without forecaster which is not in this PR.

    Changes


  • All metadata dataclasses (like EncDecDataModuleMetadata, TimeSeriesMetadata etc) are added to _metadata.py

  • a new util for validation checks in utils/_validation

  • Update the tests (needed to make some changes like updating the param name) in standalone model tests for v2 as well

  • - Also had to add metadata in ignore of save_hyperparameters of Samformer. See this comment
  • Updates to datamodules (currently duplicate in both classes)

  • - Uses EncDecDataModuleMetadata (in case of EncoderDecoderTImeSeriesDatamodule) and tslib dm has its own metadata dataclass.
    - Data validation.
    - with_data method to create a new dm instance using the already present params (like already fitted scalers - only to create the transformed data).
    - Like creating a datamodule for prediction where we need the scalers from the datamodule we used for fitting.
    - Also useful to create the class "without data" which arrives at forecaster.fit() while we accept the dm class in __init__ of the forecaster. So, the class is actually just empty at this point without data.

    Diff: 246 lines (+184 / -62) across 3 files Reviewer: phoeenniixx Review duration: 57842m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 246 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.330
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2423"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.4% · Safe to merge
    15.4%