CallbackDefinition¶
-
class passengersim.callbacks.configured.CallbackDefinition(factory: Callable[[BaseModel], Any], when: 'initialize_sample' | 'begin_sample' | 'daily' | 'end_sample' | 'finalize_sample' | None, parameters_model: type[BaseModel], version: str, output_name: str | None =
None, kind: 'factory' | 'callback' | 'tracer' ='factory', source: Any =None)[source]¶ Bases:
objectFactory metadata used to validate and construct one callback per simulation.
Methods
__init__(factory, when, parameters_model, ...)Attributes
How this definition was registered; see
DefinitionKind.Expected name of the tracer returned by the factory, or None for an ordinary callback.
The function or class given to
register_callback()orregister_tracer().Construct a fresh callable from one validated options model.
Lifecycle hook for the constructed callback.
Schema used for runtime validation without changing explicit config.
Implementation version checked against an explicit config requirement.
- when : Literal['initialize_sample', 'begin_sample', 'daily', 'end_sample', 'finalize_sample'] | None¶
Lifecycle hook for the constructed callback.
None for a factory returning a tracer, which then runs on the hooks the tracer itself declares (see
tracer_hooks()).
- parameters_model : type[BaseModel]¶
Schema used for runtime validation without changing explicit config.
- version : str¶
Implementation version checked against an explicit config requirement.
-
output_name : str | None =
None¶ Expected name of the tracer returned by the factory, or None for an ordinary callback.
-
kind : Literal['factory', 'callback', 'tracer'] =
'factory'¶ How this definition was registered; see
DefinitionKind.
-
source : Any =
None¶ The function or class given to
register_callback()orregister_tracer().None for a factory registration. Used to decide whether a later registration under the same name may replace this one.