← Back to Pull requests

[ENH] add a tag register to the registry #2451

Open
unknown opened this pull request with 275 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 06, 2026 00:38 UTC
Author

Reference Issues/PRs

Fixes #2333. Follows up on the review of #2334.

What does this implement/fix? Explain your changes.

Adds a class-based tag register to pytorch_forecasting/_registry, following the pattern sktime and skpro use, and makes it the single place tag semantics are documented.

  • _registry/_tags.py

  • check_tag_is_valid(tag_name, tag_value)

  • all_tags(parent_types, return_names, as_dataframe)

  • all_objects rejects unknown filter_tags

  • docs/source/registry.rst, linked from the v1 and v2 API toctrees
  • Each tag documents its possible values, its default, and what reads it, as asked for in the review of #2334. The same descriptions were previously copied across five places (both template READMEs, both template _model_pkg.py comment blocks, the package layer page); all five now point at the register.

    What should a reviewer concentrate their feedback on?

  • The behaviour change.

  • The three tags no code reads.

  • parent_type for info:pred_type and info:y_type.
  • Did you add any tests for the change?

    Yes, _registry/tests/test_tags.py, 68 cases. Three are worth calling out:

  • test_every_tag_is_documented

  • test_every_declared_tag_is_registered and test_every_declared_tag_value_is_valid

  • test_metric_type_enum_matches_test_all_metrics and test_object_type_enum_covers_test_class_registry
  • Any other comments?

    Reading each tag's consumers turned up three things

    1. The capability:* family has no defaults, so an omitted tag reads back as None, not False.
    2. info:pred_type is missing from every v2 package and info:y_type from three, although the v2 template asks for them. The fallback to [] is silent and narrows which losses those models are tested against. TFTForecaster in #2434 has the same gap.
    3. info:metric_name, capability:quantile_generation and shape:adds_quantile_dimension have no consumer anywhere, including docs and tests.

    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: 275 lines (+206 / -69) across 3 files Reviewer: phoeenniixx Review duration: 37076m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 275 lines diff across 3 files
    0.40
    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%
    42%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.336
    Real PR Conversation Timeline
    1 comments
    "Review active on #2451"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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.6% · Safe to merge
    22.6%