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, and list_compilers instead 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:

CustomCompilerProtocol

list()[source]#

Return sorted list of registered compiler names.

Returns:
list[str]

Sorted compiler names.

Return type:

list[str]

register(compiler, *, overwrite=False)[source]#

Register a custom compiler callable.

Parameters:
compilerCustomCompilerProtocol

Compiler instance to register.

overwritebool, default=False

If False, raise ValueError when a compiler with the same name is already registered. If True, silently replace.

Raises:
ValueError

If the compiler name is invalid or already registered (when overwrite=False).

TypeError

If compiler does not satisfy CustomCompilerProtocol.

Parameters:
Return type:

None

unregister(name)[source]#

Remove a registered compiler.

Parameters:
namestr

Compiler name to remove.

Returns:
bool

True if the compiler was found and removed, False if it was not registered.

Parameters:

name (str)

Return type:

bool