radiens_core.models.kpi
KPI (Key Performance Indicator) signal metrics domain models and enums.
| CLASS | DESCRIPTION |
|---|---|
BundleStatId |
Identifies one cross-channel bundle summary. |
ChannelReduction |
How a bundle summary collapses a per-channel metric across channels. |
KpiBundleStatsResult |
Cross-channel KPI summaries over time. |
KpiBundleStatsWindow |
One time bin of a KPI bundle-stats series. |
KpiMetric |
KPI metric identifier. |
KpiMetricId |
Identifies a single KPI metric. |
KpiMetricsResult |
Result of a KPI metrics query. |
KpiMetricsSeriesResult |
Per-channel KPI metric timeseries. |
KpiMetricsWindow |
One time bin of a KPI metrics series. |
KpiMode |
Per-metric KPI computation mode. |
KpiServiceMode |
Which answering mode a KPI metrics request wants. |
KpiStatus |
Status of KPI computation for a dataset or stream. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
FlexBundleStatId |
|
FlexChannelReduction |
|
FlexKpiMetricId |
|
FlexKpiServiceMode |
|
Attributes
FlexBundleStatId
module-attribute
FlexBundleStatId = (
BundleStatId | KpiMetric | str | tuple[str | KpiMetric, str | ChannelReduction]
)
FlexChannelReduction
module-attribute
FlexChannelReduction = ChannelReduction | ChannelReductionStr
ChannelReduction that also accepts a case-insensitive name string.
FlexKpiMetricId
module-attribute
KpiMetricId that also accepts a metric name string or enum member.
Metric name strings are case-insensitive.
Example
The (mode, name) tuple form is deprecated and its mode is ignored — pass
service_mode to get_kpi_metrics() instead.
FlexKpiServiceMode
module-attribute
FlexKpiServiceMode = KpiServiceMode | KpiServiceModeStr
KpiServiceMode that also accepts a case-insensitive name string.
Classes
BundleStatId
Bases: BaseModel
Identifies one cross-channel bundle summary.
A per-channel metric reduced across the selected channels — for example
{RMS, MEAN} is the average RMS over the probe.
| ATTRIBUTE | DESCRIPTION |
|---|---|
metric |
The per-channel metric to reduce.
TYPE:
|
reduce |
How to collapse that metric across channels.
TYPE:
|
ChannelReduction
Bases: IntEnum
How a bundle summary collapses a per-channel metric across channels.
Reductions skip non-finite values (NaN or ±inf: no data or no events). MEAN,
MAX and MIN return NaN when nothing is finite, SUM returns 0, and
COUNT counts the finite values.
KpiBundleStatsResult
Bases: BaseModel
Cross-channel KPI summaries over time.
| ATTRIBUTE | DESCRIPTION |
|---|---|
stats |
Bundle stat IDs, in the order their values appear in each window.
TYPE:
|
windows |
Time windows, ordered by time.
TYPE:
|
answered_mode |
Which mode produced these values.
TYPE:
|
KpiBundleStatsWindow
KpiMetric
Bases: IntEnum
KPI metric identifier.
Member values are not stable across releases; refer to metrics by name.
KPI covers amplifier channels only. Amplitudes are in µV.
NOISE_UV is the spike detector's noise estimate, which its thresholds are scaled
by. SNR is EVENT_MEAN_MAX_ABS / NOISE_UV. EVENT_MEAN_MAX_ABS is the mean
absolute peak of the events in the window, and EVENT_MEAN_MAX_MIN_DIFF_ABS is
their mean peak-to-peak.
For a window with no events, SNR is NaN, EVENT_RATE is 0, EVENT_MIN is
+inf, and the other event metrics are -inf. SNR and the event metrics are
NaN on a channel whose signal is unsuitable for event detection.
KpiMetricId
KpiMetricsResult
Bases: BaseModel
Result of a KPI metrics query.
values is a 2-D numpy array of shape (n_channels, n_metrics)
where rows correspond to channel_indices and columns to metrics.
| ATTRIBUTE | DESCRIPTION |
|---|---|
channel_indices |
Native channel indices in row order. |
metrics |
KPI metric IDs in column order.
TYPE:
|
signal_type |
Signal type for all channels in this result.
TYPE:
|
values |
Metric values: shape |
time_range |
Time range over which these metrics were computed. In
TYPE:
|
answered_mode |
Mode that produced these values. Extrema from
TYPE:
|
KpiMetricsSeriesResult
Bases: BaseModel
Per-channel KPI metric timeseries.
N time windows sharing the same channel_indices / metrics ordering.
| ATTRIBUTE | DESCRIPTION |
|---|---|
channel_indices |
Native channel indices in row order. |
metrics |
KPI metric IDs in column order.
TYPE:
|
signal_type |
Signal type for all channels in this result.
TYPE:
|
windows |
Time windows, ordered by time.
TYPE:
|
answered_mode |
Which mode produced these values.
TYPE:
|
KpiMetricsWindow
KpiMode
Bases: IntEnum
Per-metric KPI computation mode.
Deprecated
Ignored. Pass service_mode to get_kpi_metrics() instead. Removed in 0.1.0.
KpiServiceMode
Bases: IntEnum
Which answering mode a KPI metrics request wants.
| ATTRIBUTE | DESCRIPTION |
|---|---|
RANGE |
Exact fold over the requested time range. Not available on a live stream.
|
STREAM |
Exponential moving average over a lookback window. Live streams only; on a recording it returns NaN.
|
KpiStatus
Bases: BaseModel
Status of KPI computation for a dataset or stream.
| ATTRIBUTE | DESCRIPTION |
|---|---|
stream_group_id |
Unique ID (UID) of the dataset the status belongs to. Not the ID the call was made with.
TYPE:
|
num_packets_memory |
Capacity of the in-memory KPI cache, in packets, derived from
TYPE:
|
packet_dur |
Duration of each KPI packet in seconds.
TYPE:
|
update_period |
How often newly arrived signal is processed, in seconds.
TYPE:
|
persistence |
How long computed KPI packets are kept in memory, in seconds.
TYPE:
|
beta |
Processing headroom,
TYPE:
|
num_packets |
Length of
TYPE:
|
memory_bytes |
Approximate capacity of the in-memory KPI cache in bytes.
TYPE:
|
num_sigs |
Number of amplifier channels, enabled or not.
TYPE:
|
time_range |
Time range KPI has been computed over.
TYPE:
|