kempnerpulse.present.widgets¶
Rich panels and the line-plot renderable.
Every widget consumes ComputedRecord objects and reads metric values from the
wrapped CanonicalRecord (canonical fractions/SI), converting to display
units at render time via format. The responsive layout — fixed-width
bars, stacked-vs-two-column card detail, fixed-width health/status badges,
no-wrap headers, summary/footer field-drop ordering, fleet vertical scrolling,
and the focus-view reflowing info grid — is reproduced from the single-file
implementation, with the magic numbers kept as named constants.
Functions
|
Lay out the fleet for an available width×height. |
Sensible column counts for n cards: full row (n), full column (1), exact divisors, and balanced ragged grids; pruned so every row but the last is full. |
|
|
Choose (cols, rows) for n cards in a W×H area, matching the grid aspect ratio to the window's. |
|
|
|
|
|
Render a table of all running GPU compute processes with per-GPU metrics. |
|
Build the full Plot View: shared legend + 3×3 grid of line charts. |
|
|
|
|
|
Classes
A single compute process running on a GPU (for the Job View). |
|
Rich renderable that draws a line chart, adapting to available width. |
- class kempnerpulse.present.widgets.GpuProcess[source]¶
Bases:
objectA single compute process running on a GPU (for the Job View).
- kempnerpulse.present.widgets.summary_panel(records, *, app_version='', cpu_info=(None, None, None, None), ram_info=(None, None), console_width=200)[source]¶
- kempnerpulse.present.widgets.gpu_card(rec, history, power_limit=None, nvlink_limit=None, detail_columns=2)[source]¶
- Parameters:
rec (ComputedRecord)
history (HistoryStore)
power_limit (float | None)
nvlink_limit (float | None)
detail_columns (int)
- Return type:
Panel
- kempnerpulse.present.widgets.candidate_cols(n)[source]¶
Sensible column counts for n cards: full row (n), full column (1), exact divisors, and balanced ragged grids; pruned so every row but the last is full.
- kempnerpulse.present.widgets.choose_grid(n, W, H, w_min=None)[source]¶
Choose (cols, rows) for n cards in a W×H area, matching the grid aspect ratio to the window’s. Never more columns than fit at the card minimum width. Deterministic.
- kempnerpulse.present.widgets.fleet_panel(records, history, cards_per_row=2, detail_columns=2, power_limits=None, nvlink_bw_limits=None, avail_height=None, controller=None)[source]¶
- Parameters:
records (List[ComputedRecord])
history (HistoryStore)
cards_per_row (int)
detail_columns (int)
avail_height (int | None)
controller (CommandController | None)
- Return type:
Panel
- kempnerpulse.present.widgets.build_fleet_panel(records, history, avail_width, avail_height, power_limits=None, nvlink_bw_limits=None, controller=None)[source]¶
Lay out the fleet for an available width×height. Shared by the main fleet view and the focus-mode mini-fleet so both behave identically.
- Parameters:
records (List[ComputedRecord])
history (HistoryStore)
avail_width (int)
avail_height (int)
controller (CommandController | None)
- Return type:
Panel
- class kempnerpulse.present.widgets.LinePlotRenderable[source]¶
Bases:
objectRich renderable that draws a line chart, adapting to available width.
- kempnerpulse.present.widgets.line_plot_view_panel(records, history, pcie_bw_limits=None, pcie_info='', poll=1.0, power_limits=None, console_height=50)[source]¶
Build the full Plot View: shared legend + 3×3 grid of line charts.
- kempnerpulse.present.widgets.selected_gpu_panel(rec, history, power_limit=None, nvlink_limit=None, console_width=200)[source]¶
- Parameters:
rec (ComputedRecord)
history (HistoryStore)
power_limit (float | None)
nvlink_limit (float | None)
console_width (int)
- Return type:
Panel
- kempnerpulse.present.widgets.jobs_view_panel(records, gpu_processes)[source]¶
Render a table of all running GPU compute processes with per-GPU metrics.
- Parameters:
records (List[ComputedRecord])
gpu_processes (Dict[str, List[GpuProcess]])
- Return type:
Panel