Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] decouple registry from base modules, scitype specific data records for documentation of estimator types #6998

Merged
merged 21 commits into from
Aug 30, 2024

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Aug 18, 2024

Fixes #6970 by a redesign of the object scitype register that decouples the registry module from the rest of sktime, by removing all outside imports on module level (except from sktime.base and utils).

As a side effect, this also adds one record class per object type, which can be used as a tagged metadata record and later as a basis or documenting the individual object types in sktime.

The refactor proceeds as follows:

  • the base class register is replaced by data record classes similar to the _tags module
  • the imports of base classes are isolated in class methods of those records, get_base_class, which returns the base class corresponding to the scitype
  • exports of objects involving tags, in particular the classes, are replaced by functions that produce the object, further isolating the import to places where it is needed, e.g., get_base_class_list

To make the changes deprecation safe, imports of coupled objects are intercepted, and replaced by calls on demand, i.e., whenever an external call carries out an import.

Further, imports from outside registry but inside sktime (all from the test framework) are also replaced with the new functions. This lead to some dead functions and objects, which were removed, which further lead to unused imports, which also were removed.

@fkiraly fkiraly added enhancement Adding new functionality module:base-framework BaseObject, registry, base framework labels Aug 18, 2024
@fkiraly fkiraly changed the title Registry decouple [ENH] decouple of registry from base modules, scitype specific data records for documentation Aug 18, 2024
@fkiraly fkiraly self-assigned this Aug 18, 2024
@fkiraly fkiraly marked this pull request as ready for review August 18, 2024 19:29
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@fkiraly fkiraly changed the title [ENH] decouple of registry from base modules, scitype specific data records for documentation [ENH] decouple of registry from base modules, scitype specific data records for documentation of estimator types Aug 19, 2024
@fkiraly fkiraly changed the title [ENH] decouple of registry from base modules, scitype specific data records for documentation of estimator types [ENH] decouple registry from base modules, scitype specific data records for documentation of estimator types Aug 19, 2024
@fkiraly fkiraly merged commit f3ee417 into main Aug 30, 2024
39 of 44 checks passed
@fkiraly fkiraly deleted the registry-decouple branch August 30, 2024 12:19
benHeid pushed a commit to Z-Fran/sktime that referenced this pull request Oct 3, 2024
…rds for documentation of estimator types (sktime#6998)

Fixes sktime#6970 by a redesign of the
object scitype register that decouples the `registry` module from the
rest of `sktime`, by removing all outside imports on module level
(except from `sktime.base` and `utils`).

As a side effect, this also adds one record class per object type, which
can be used as a tagged metadata record and later as a basis or
documenting the individual object types in `sktime`.

The refactor proceeds as follows:

* the base class register is replaced by data record classes similar to
the `_tags` module
* the imports of base classes are isolated in class methods of those
records, `get_base_class`, which returns the base class corresponding to
the scitype
* exports of objects involving tags, in particular the classes, are
replaced by functions that produce the object, further isolating the
import to places where it is needed, e.g., `get_base_class_list`

To make the changes deprecation safe, imports of coupled objects are
intercepted, and replaced by calls on demand, i.e., whenever an external
call carries out an import.

Further, imports from outside `registry` but inside `sktime` (all from
the test framework) are also replaced with the new functions. This lead
to some dead functions and objects, which were removed, which further
lead to unused imports, which also were removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new functionality module:base-framework BaseObject, registry, base framework
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[ENH] decouple registry module from base classes
1 participant