deisa.ray.window_handler module¶
- class deisa.ray.window_handler.Deisa(*, ray_start: Callable[[], None] | None = None, handshake: Callable[[Deisa], None] | None = None)[source]¶
Bases:
object- execute_callbacks() None[source]¶
Execute the registered simulation callback loop.
Notes
Supports a single registered callback at present. Manages array retrieval from the head actor, optional preparation tasks, windowed array delivery, and garbage collection between iterations.
- register_callback(simulation_callback: Callable, arrays_description: list[WindowArrayDefinition], *, max_iterations=1000000000, prepare_iteration: Callable | None = None, preparation_advance: int = 3) None[source]¶
Register the analytics callback and array descriptions.
- Parameters:
simulation_callback (Callable) – Function to run for each iteration; receives arrays as kwargs and
timestep.arrays_description (list[WindowArrayDefinition]) – Descriptions of arrays to stream to the callback (with optional sliding windows).
max_iterations (int, optional) – Maximum iterations to execute. Default is a large sentinel.
prepare_iteration (Callable or None, optional) – Optional preparatory callback run
preparation_advancesteps ahead. Receives the array andtimestep.preparation_advance (int, optional) – How many iterations ahead to prepare when
prepare_iterationis provided. Default is 3.
- set(*args, key: Hashable, value: Any, chunked: bool = False, **kwargs) None[source]¶
Broadcast a feedback value to all node actors.
- Parameters:
key (Hashable) – Identifier for the shared value.
value (Any) – Value to distribute.
chunked (bool, optional) – Placeholder for future distributed-array feedback. Only
Falseis supported today. Default isFalse.
Notes
The method lazily fetches node actors once and uses fire-and-forget remote calls; callers should not assume synchronous delivery.