CompilerRegistry#
- class scikitplot.cython.CompilerRegistry[source]#
Thread-unsafe module-level registry of custom compiler callables.
Notes
The registry is intentionally simple (dict-backed) and not thread-safe. Register compilers at module-import time or in a single-threaded setup phase, not concurrently.
Use the module-level helpers
register_compiler,get_compiler, andlist_compilersinstead of instantiating this class directly.- get(name)[source]#
Retrieve a registered compiler by name.
- Parameters:
- namestr
Compiler name.
- Returns:
- CustomCompilerProtocol
The registered compiler callable.
- Raises:
- KeyError
If no compiler with that name is registered.
- Parameters:
name (str)
- Return type:
- register(compiler, *, overwrite=False)[source]#
Register a custom compiler callable.
- Parameters:
- compilerCustomCompilerProtocol
Compiler instance to register.
- overwritebool, default=False
If
False, raiseValueErrorwhen a compiler with the same name is already registered. IfTrue, silently replace.
- Raises:
- ValueError
If the compiler name is invalid or already registered (when
overwrite=False).- TypeError
If
compilerdoes not satisfyCustomCompilerProtocol.
- Parameters:
compiler (CustomCompilerProtocol)
overwrite (bool)
- Return type:
None