Skip to main content

prepare_observation

observations.prepare_observation(monitor, grid, sample, variable_names)

Prepare a streaming monitor for block-wise execution.

Calls monitor.prepare(grid, sample, variable_names), which receives a SimulationGrid, a jax.ShapeDtypeStruct describing one [channels, nodes] input value, and optional channel names, and returns a PreparedObservation. Subclasses select their preparation through ordinary method resolution. To stream a type you cannot modify, wrap it in a StreamingMonitor subclass that implements prepare.

The returned recipe is validated abstractly for cadence, callback return structure, state invariance, rank, node count, dtype, and channel metadata before execution.