accelmo.monitor.app

The monitor web app: pick a stage and a step, see every panel for it.

Nothing the panels draw is kept in memory: a draw reads the run log and the optics cache from disk, builds the figures, hands them to the browser and lets go of the data. The page changes only when the user asks (stage, step, tab or the Redraw button), so a long run does not make the browser rebuild figures every few seconds.

accelmo.monitor.app.SUMMARY_PANELS = {<function summaries_panel>}

Panels that show MonitorView.summaries, and so go stale as those grow.

accelmo.monitor.app.LATEST_STEP = 'latest'

The step dropdown’s value for “whichever step is the newest”.

class accelmo.monitor.app.Monitor(root, spec, cache, refresh_seconds)[source]

Bases: object

One browser session’s view of the run logs below root.

Every refresh_seconds it rescans for stages, queues the optics it needs (the selected step first, then the latest, then the whole history coarse-to-fine) and says in the sidebar whether the visible tab is out of date. It redraws only on a user action; the Redraw button draws the visible tab afresh if (and only if) there is new data for it.

Parameters:
layout()[source]

The Panel page of the monitor.

Return type:

BaseTemplate

refresh()[source]

Rescan stages, queue optics, update the sidebar. Never touches the plots.

Return type:

None

accelmo.monitor.app.serve(root, spec=None, *, port=5006, address='localhost', refresh_seconds=5.0, workers=1, cache_dir=None, show=False)[source]

Serve the monitor for the run logs below root until interrupted.

Return type:

None

Parameters:
  • root (Path | Sequence[Path])

  • spec (MonitorSpec | None)

  • port (int)

  • address (str)

  • refresh_seconds (float)

  • workers (int)

  • cache_dir (Path | None)

  • show (bool)