Skip to main content
Version: v2603

intelligence.zenith_tune.presets.registry

Registry for tuning presets.

PresetRegistry Objects

class PresetRegistry()

Registry for tuning preset classes.

Example:

@PresetRegistry.register("my_framework") class MyFrameworkPreset(TuningPreset): ...

preset = PresetRegistry.get("my_framework")

register

@staticmethod
def register(name: str)

Class decorator to register a preset.

Arguments:

  • name - Unique name for the preset.

Returns:

Decorator that registers the class and returns it unchanged.

get

@staticmethod
def get(name: str, **kwargs) -> TuningPreset | None

Get a preset instance by name.

Arguments:

  • name - Name of the preset to retrieve.
  • **kwargs - Additional keyword arguments passed to the preset constructor.

Returns:

Preset instance, or None if not found.

resolve

@staticmethod
def resolve(preset: TuningPreset | str, **kwargs) -> TuningPreset

Resolve a preset from an instance or name.

Arguments:

  • preset - A TuningPreset instance (returned as-is) or a string name (looked up in registry).
  • **kwargs - Additional keyword arguments passed to the preset constructor (only used when preset is a string).

Returns:

Resolved preset instance.

Raises:

  • ValueError - If the preset name is not registered.
  • TypeError - If preset is not a TuningPreset or str.

list

@staticmethod
def list() -> list[str]

List all registered preset names.

Returns:

List of registered preset names.