kempnerpulse.lifecycle

Cross-cutting lifecycle — run the Read → Translate → Compute → Present pipeline.

This is the only module that owns the process lifecycle: it builds the backend, translator, and per-GPU compute state; drives the live TUI / one-shot / CSV export modes; and centralizes signal handling and teardown. Each sampling tick flows Read (RawRecord) → Translate (CanonicalRecord) → Compute (ComputedRecord) → Present (render / CSV).

Functions

run(config)

Validate, identify hardware, build the pipeline, and dispatch a run mode.

Classes

Pipeline

Translate + Compute a tick of RawRecords into sorted ComputedRecords.

ThreadedTickReader

Runs a backend's tick stream in a daemon thread; publishes the latest tick.

class kempnerpulse.lifecycle.ThreadedTickReader[source]

Bases: object

Runs a backend’s tick stream in a daemon thread; publishes the latest tick.

The live TUI needs to read input and render while waiting for the next sample, so the blocking tick stream runs off-thread and the newest tick is published under a condition variable with a monotonically increasing counter.

__init__(backend)[source]
Return type:

None

start()[source]
Return type:

None

last_counter()[source]
Return type:

int

get_latest()[source]
Return type:

Tuple[List[RawRecord] | None, int]

wait_first_sample(timeout)[source]
Parameters:

timeout (float)

Return type:

bool

stop()[source]
Return type:

None

class kempnerpulse.lifecycle.Pipeline[source]

Bases: object

Translate + Compute a tick of RawRecords into sorted ComputedRecords.

__init__(config, identity, allowed)[source]
Parameters:
Return type:

None

process(raw_tick)[source]
Parameters:

raw_tick (Iterable[RawRecord])

Return type:

List[ComputedRecord]

kempnerpulse.lifecycle.run(config)[source]

Validate, identify hardware, build the pipeline, and dispatch a run mode.

Parameters:

config (Config)

Return type:

int