kempnerpulse.translate.context

Per-process source context for translation (resolved once at startup).

SourceContext pins the operating context — which backend produced the records, how to tag aggregation/provenance, the host/cluster metadata, and the per-GPU identity (UUID, model) — so that the per-record translator is a pure mapping that simply stamps these constants onto every CanonicalRecord.

Functions

make_source_context(backend, *[, hostname, ...])

Build a SourceContext with backend-derived provenance/aggregation.

Classes

SourceContext

Static context resolved at startup; frozen for the process lifetime.

class kempnerpulse.translate.context.SourceContext[source]

Bases: object

Static context resolved at startup; frozen for the process lifetime.

backend: BackendKind
provenance: Provenance
aggregation_mode: AggregationMode
window_microseconds: int
hostname: str
gpu_uuid_by_index: Dict[int, str]
gpu_model_by_index: Dict[int, str]
slurm_metadata: Dict[str, object]
__init__(backend, provenance, aggregation_mode, window_microseconds, hostname, gpu_uuid_by_index=<factory>, gpu_model_by_index=<factory>, slurm_metadata=<factory>)
Parameters:
Return type:

None

kempnerpulse.translate.context.make_source_context(backend, *, hostname=None, gpu_uuid_by_index=None, gpu_model_by_index=None, slurm_metadata=None)[source]

Build a SourceContext with backend-derived provenance/aggregation.

Parameters:
Return type:

SourceContext