osmose.live_movement

Live-during-run movement snapshots + queue transport (Python engine only).

Pure core module — no UI imports. Produces a per-step MovementSnapshot of living focal schools’ positions for the Run-page live map, and a throttling queue observer the engine step hook calls. queue.Queue is stdlib, so the transport helper stays here and is unit-testable.

Functions

build_snapshot(step, state, grid, config, *)

Build a snapshot of focal + located + living schools at step (pure).

config_is_spatial(config)

True when the config has a regular grid that yields live-movement frames (GridSpec.from_config succeeds — needs grid.nlon/nlat/upleft.*/lowright.*).

format_progress_label(done, n_steps, ndt)

Human progress label from 1-based completed-step count done.

make_run_observer(progress_q[, ...])

Step-observer that pushes (done, n_steps, elapsed_s) to progress_q every step (done = step + 1, 1-based) and delegates to live_observer when given.

make_step_observer(q, *[, dot_cap, ...])

Return a step-observer that builds a snapshot and enqueues it (drop-oldest).

resolve_grid_latlon(grid)

Return (lat, lon) cell-coordinate arrays.

Classes

MovementSnapshot(step, n_steps, status, ...)

One frame of living focal schools' positions for the live map.