nvalchemi.hooks.HookRegistryMixin#

class nvalchemi.hooks.HookRegistryMixin[source]#

Mixin providing flat-list hook storage and dispatch.

The host class must provide a step_count attribute. Override _build_context to populate workflow-specific fields.

Set _stage_type on the host class to restrict which stage enum types may be registered. When set, register_hook raises TypeError if hook.stage is not an instance of the declared type(s).

hooks#

Flat list of registered hooks.

Type:

list[Hook]

step_count#

Current step number (must be provided by the engine).

Type:

int

_stage_type#

Accepted stage enum type(s). None disables validation.

Type:

type[Enum] | tuple[type[Enum], …] | None

__init__()#

Methods

__init__()

register_hook(hook[, stage])

Register a hook.

Attributes

hooks

step_count