coco_pipe.decoding.registry =========================== .. py:module:: coco_pipe.decoding.registry .. autoapi-nested-parse:: Decoding Registry ================= Central registry for decoding estimators (classifiers, regressors, and FMs). This allows instantiating models from string names in configuration files, avoiding circular imports and simplifying the config layer. Usage ----- >>> from coco_pipe.decoding.registry import register_estimator, get_estimator_cls >>> >>> @register_estimator("MyModel") >>> class MyModel: ... >>> >>> cls = get_estimator_cls("MyModel") Attributes ---------- .. autoapisummary:: coco_pipe.decoding.registry._ESTIMATOR_REGISTRY coco_pipe.decoding.registry._LAZY_MODULES Functions --------- .. autoapisummary:: coco_pipe.decoding.registry._discover_entry_points coco_pipe.decoding.registry._discover_internal_modules coco_pipe.decoding.registry.register_estimator coco_pipe.decoding.registry.get_estimator_cls coco_pipe.decoding.registry.list_estimators Module Contents --------------- .. py:data:: _ESTIMATOR_REGISTRY :type: Dict[str, Type] .. py:data:: _LAZY_MODULES .. py:function:: _discover_entry_points() Populate _LAZY_MODULES from 'coco_pipe.estimators' entry points. This allows plugins to register estimators without modifying code. .. py:function:: _discover_internal_modules() Walk through the 'coco_pipe.decoding' subpackage and import all modules. This triggers the @register_estimator decorators. .. py:function:: register_estimator(name: str) -> Callable[[Type], Type] Decorator to register an estimator class under a specific name. :param name: The unique alias for the estimator (e.g., "RandomForestClassifier"). :type name: str .. py:function:: get_estimator_cls(name: str) -> Type Retrieve an estimator class by name. :param name: Name of the estimator. :type name: str :returns: The class object. :rtype: Type :raises ValueError: If name is not found. .. py:function:: list_estimators() -> Dict[str, Type] Return a copy of the current registry.