[ENH] auto-generate model overview table from registry tags#2236
[ENH] auto-generate model overview table from registry tags#2236IgnazioDS wants to merge 4 commits intosktime:mainfrom
Conversation
Replace the manually maintained CSV table in models.rst with an auto-generated table built from model _tags metadata. This ensures the documentation always reflects the actual registered models. Implementation: - New Sphinx extension (_ext/model_overview.py) with `.. model-overview::` directive that queries all_objects() with return_tags - Extracts capability tags (exogenous, multivariate, pred_int, etc.) and renders an RST grid table - Registers extension in conf.py Adding a new model to the docs is now automatic — just register it with proper _tags and the table updates on next docs build. Addresses sktime#1934
|
@fkiraly Hi! This implements #1934 — auto-generating the model overview table from the registry using a custom Sphinx directive. Fixed the ruff lint issue in a follow-up commit. CI should be green now (readthedocs build still pending). The approach mirrors how sktime handles automated docs generation — queries |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2236 +/- ##
=======================================
Coverage ? 86.93%
=======================================
Files ? 166
Lines ? 9765
Branches ? 0
=======================================
Hits ? 8489
Misses ? 1276
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Thanks a lot! This looks really nice!
I have one recommendation:
Would it be possible that the table shows:
Model_nameifModel_pkgModel_v2ifModel_pkg_v2
This would be helpful for the users to differentiate between the "stable" v1 models and experimental v2 models. Also, pls donot show pkg name in the table, just the model name, i.e, if the name of the pkg class is DecoderMLP_pkg it should display DecoderMLP and if the name is DLinear_pkg_v2 then it should show DLinear_v2.
OR
Would it be better to keep just the model names, but you add a new column where you add the v1, v2 tag. And explain this column below the table?
You could easily differentiate between v1, v2 pkg using the tag "object_type", where v1 models use ["forecaster_pytorch", "forecaster_pytorch_v1"] and v2 models use "forecaster_pytorch_v2". See here
What are your thoughts? @IgnazioDS
FYI @fkiraly @PranavBhatP
- Strip _pkg_v2 suffix and display as ModelName_v2 (e.g. TFT_pkg_v2 -> TFT_v2) - Strip _pkg suffix and display as ModelName (e.g. TFT_pkg -> TFT) - Add Version column using object_type tag: v1 for forecaster_pytorch/forecaster_pytorch_v1, v2 for forecaster_pytorch_v2 - Remove raw pkg class name from display
|
Addressed your feedback @phoeenniixx:
Thanks for the clear guidance! Let me know if you'd prefer the alternative approach (separate v1/v2 column with footnote). |
There was a problem hiding this comment.
Very Nice! It is much better thanks!
I looked at the new page, it looks perfect!
But the links to the models still open the pkg class of the respective model, I think it should lead to the model's implementation...
Also, I think it would be better if you could add a footnote explaining what "version" mean here and that v2 is still experimental and link the issue #1736 and roadmap issue #1993?
Also, I would suggest to keep your branch updated, that prevents any merge conflicts!
Summary
Replaces the manually maintained CSV comparison table in
models.rstwith an auto-generated table built from model_tagsmetadata via theall_objects()registry._ext/model_overview.py) with.. model-overview::directive_tagsMotivation
The current table (lines 24-35 of
models.rst) is manually maintained and doesn't include newer models like DLinear, TimeXer, Samformer, TFT v2, or TiDE v2. Every new model requires a manual edit to the docs, which is error-prone and easy to forget.How It Works
.. model-overview::At build time, this directive:
all_objects(return_tags=[...])to discover all registered modelscapability:exogenous,capability:multivariate,capability:pred_int,info:pred_type,info:y_type,info:computeColumns
info:name+ module path for:py:class:cross-refcapability:exogenouscapability:multivariate"numeric" in info:y_type"category" in info:y_type"distr" in info:pred_typecapability:pred_intinfo:computeTest Plan
sphinx-buildcompletes without errors:py:class:) resolve correctly_tagsautomatically appear in the tableAddresses #1934