[ENH] tag registry upgrade - full tag documentation, user_facing field, env_marker tag - #1183
Open
adity1raut wants to merge 1 commit into
Open
adity1raut wants to merge 1 commit into
adity1raut wants to merge 1 commit into
Conversation
…eld, `env_marker` tag Upgrades the tag registry in `skpro.registry._tags` to the `sktime` pattern, as per sktime#1083: * all tag classes have structured docstrings, following `sktime.registry._tags`: string name, tag category, values, examples, default, and description, describing the actual behaviour of the tag in `skpro` * `user_facing` field added to `_BaseTag` and all tags * `object_type` docstring dynamically lists all scitypes * new `env_marker` tag (PEP 508), which `skbase`'s `_check_estimator_deps` already checks * `object_type` tag type is now str or list of str, as polymorphic objects exist * register construction moved into a function, to avoid loop variables leaking into the module namespace * module docstring explains how to add a new tag class * tests for the tag class specification and `check_tag_is_valid`
adity1raut
requested review from
felipeangelimvieira and
fkiraly
as code owners
October 1, 2026 17:10
Contributor
Author
|
@fkiraly this covers the remaining tag registry item from #1083. The What changed:
As discussed in the issue, I left the Would appreciate a review when you have time, especially on the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Fixes #1083.
This PR does the remaining item of #1083, the tag registry and tag documentation. The
__post_init__and__dynamic_tags__item was done in #1094.As discussed in the issue, changing
all_tagsfiltering to include"object"and"estimator"tags is left for a separate PR.What does this implement/fix? Explain your changes.
This PR brings
skpro.registry._tagsin line withsktime.registry._tags:sktimeformat: a one-line summary, then string name, tag category (public / private / extension developer), values, examples and default, then a description. The text describes what each tag does inskpro, checked against the code that reads it, for example:capability:update:updatedoes nothing if the tag isFalse.distr:paramtype:get_params_dfandto_dfonly work for parametric distributions.distr:measuretype:pdfreturns zero for discrete distributions, andpmfreturns zero for continuous ones.reserved_params: these parameters are exempt from some constructor andset_paramstests.user_facingfield: added to_BaseTagand set on every tag, as insktime.object_typedocstring: lists all scitypes, generated fromget_obj_scitype_list(return_descriptions=True). This is skipped if docstrings are stripped (python -OO).env_markertag (PEP 508):skbase's_check_estimator_depsalready reads it (sincescikit-base0.8.2), but it was missing from the registry.object_typenow has type("list", "str"), because objects can have several types, e.g.,["metric", "metric_distr"]. Before this,check_tag_is_validrejected list values.object_typeandestimator_typedescriptions no longer give'transformer'as an example, sinceskprohas no transformer scitype.python_dependencies_aliasandestimator_typeare documented as legacy tags: no current code reads them.cl,tag_name, etc. in the module namespace.clpointed to the last tag class, soy_inner_mtypeshowed up twice when scanning the module. The register itself was correct, because the scan ran before the loop._tagsfields). It previously said to editOBJECT_TAG_REGISTERdirectly, which is outdated.env_markeradded todocs/source/api_reference/tags.rst. Every tag class is now listed there.The register contents are otherwise unchanged. Compared with
main, the only differences are the newenv_markerrow and the updatedobject_typeandestimator_typerows.Does your contribution introduce a new dependency? If yes, which one?
No.
What should a reviewer concentrate their feedback on?
skprobehaviour correctly.user_facingvalue of each tag. I set capability, property and metadata tags toTrue. Theapprox_*_splandbisect_itertags are alsoTrue, as "configuration" tags users may change withset_tags. Packaging, CI and extension developer tags areFalse.object_typetag type change to("list", "str").Did you add any tests for the change?
Yes, in
skpro/registry/tests/test_tags.py:test_tag_class_spec, run for each tag class, checks that:tag_nameandshort_descrare filled in;:replaced by__;parent_typevalues are valid scitypes;short_descris at most 80 characters;user_facingis a bool;- String name: ...line.test_tag_names_uniquechecks that no tag name is defined twice. This test found the namespace leak described above.test_object_type_doc_lists_scitypeschecks that the generatedobject_typedocstring lists every scitype.test_check_tag_is_validcovers valid and invalid values, including a list-valuedobject_type.Checks run locally:
pytest skpro/registry: 89 passed.pytest skpro/tests/test_all_estimators.py -k tag: 650 passed.PR checklist
For all contributions