Fix replay 2D black canvas and journey UX clarity
Stored analysis overlays now use the decoded frame; latch resets and draw failures surface. Verified with bare-video, replay-wiring, visual_policy, and analysis-progress tests.
This commit is contained in:
@@ -145,3 +145,16 @@ def test_paint_domain_background_colours() -> None:
|
||||
)
|
||||
assert tuple(canvas[0, 0]) == (1, 2, 3)
|
||||
assert tuple(canvas[1, 1]) == (10, 20, 30)
|
||||
|
||||
|
||||
def test_select_flow_samples_screens_non_finite_tips() -> None:
|
||||
"""Sparse recovered fields put NaN off the recorded cells; cast must stay quiet."""
|
||||
h, w = 30, 30
|
||||
flow = np.full((h, w, 2), np.nan, dtype=np.float64)
|
||||
flow[15, 15] = (0.5, 0.0)
|
||||
policy = VisualPolicy(flow_on_px=0.4, flow_grid_spacing=10, flow_edge_margin=0)
|
||||
with np.errstate(invalid="raise"):
|
||||
samples = select_flow_samples(flow, None, policy)
|
||||
pairs = set(zip(samples.rows.tolist(), samples.cols.tolist()))
|
||||
assert (15, 15) in pairs
|
||||
assert samples.active_count >= 1
|
||||
|
||||
Reference in New Issue
Block a user