CompilerRegistry#
- class scikitplot.cython.CompilerRegistry[source]#
Thread-safe module-level registry of custom compiler callables.
Notes
All operations on the backing dict are guarded by an internal
threading.RLock, so concurrentregister/get/list/unregistercalls are safe (CYTHON-CON-002). The lock is re-entrant so a method may call another without deadlocking.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