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

build_fleet_panel(records, history, ...[, ...])

Lay out the fleet for an available width×height.

candidate_cols(n)

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_grid(n, W, H[, w_min])

Choose (cols, rows) for n cards in a W×H area, matching the grid aspect ratio to the window's.

fleet_panel(records, history[, ...])

gpu_card(rec, history[, power_limit, ...])

jobs_view_panel(records, gpu_processes)

Render a table of all running GPU compute processes with per-GPU metrics.

line_plot_view_panel(records, history[, ...])

Build the full Plot View: shared legend + 3×3 grid of line charts.

selected_gpu_panel(rec, history[, ...])

summary_panel(records, *[, app_version, ...])

workflow_label(weights)

Classes

GpuProcess

A single compute process running on a GPU (for the Job View).

LinePlotRenderable

Rich renderable that draws a line chart, adapting to available width.

kempnerpulse.present.widgets.workflow_label(weights)[source]
Parameters:

weights (Tuple[float, float, float, float])

Return type:

str

class kempnerpulse.present.widgets.GpuProcess[source]

Bases: object

A single compute process running on a GPU (for the Job View).

pid: int
user: str
gid: str
gpu_id: str
gpu_mem_mib: float | None
command: str
__init__(pid, user, gid, gpu_id, gpu_mem_mib, command)
Parameters:
Return type:

None

kempnerpulse.present.widgets.summary_panel(records, *, app_version='', cpu_info=(None, None, None, None), ram_info=(None, None), console_width=200)[source]
Parameters:
Return type:

Panel

kempnerpulse.present.widgets.gpu_card(rec, history, power_limit=None, nvlink_limit=None, detail_columns=2)[source]
Parameters:
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.

Parameters:

n (int)

Return type:

List[int]

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.

Parameters:
Return type:

Tuple[int, int]

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:
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:
Return type:

Panel

class kempnerpulse.present.widgets.LinePlotRenderable[source]

Bases: object

Rich renderable that draws a line chart, adapting to available width.

__init__(gpu_data, chart_rows=10, vmax=100.0, poll=1.0)[source]
Parameters:
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.

Parameters:
Return type:

Panel

kempnerpulse.present.widgets.selected_gpu_panel(rec, history, power_limit=None, nvlink_limit=None, console_width=200)[source]
Parameters:
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:
Return type:

Panel