Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Datajuicer Data juicer Operator Module Registration

From Leeroopedia
Knowledge Sources
Domains Data_Engineering, Design_Patterns
Last Updated 2026-02-14 17:00 GMT

Overview

A decorator-based registry pattern that enables operators to self-register under a string name for dynamic discovery from YAML configurations.

Description

Operator Module Registration uses Python decorators to register operator classes in a global OPERATORS registry at import time. When a class is decorated with @OPERATORS.register_module(), it becomes discoverable by name (either the class name or a custom name). The configuration system uses these names to instantiate operators from YAML process lists without hard-coded imports. This pattern decouples configuration from implementation and makes the system trivially extensible.

Usage

Use this principle when implementing any new operator. Apply the decorator to the class definition, optionally providing a custom name. The operator will then be usable in YAML configurations.

Theoretical Basis

# Abstract pattern (NOT real implementation)
class Registry:
    modules = {}

    def register_module(name=None):
        def decorator(cls):
            key = name or cls.__name__
            Registry.modules[key] = cls
            return cls
        return decorator

# Usage:
@Registry.register_module('my_filter')
class MyFilter(Filter):
    pass

# Lookup:
cls = Registry.modules['my_filter']
instance = cls(**kwargs)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment