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. |
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]
)
BundleStatId that also accepts a metric name or KpiMetric (reduced by MEAN), a
(metric, reduction) pair, or a {"metric": ..., "reduce": ...} dict whose reduce
defaults to MEAN.
FlexChannelReduction
module-attribute
FlexChannelReduction = ChannelReduction | ChannelReductionStr
ChannelReduction that also accepts a case-insensitive name string.
FlexKpiMetricId
module-attribute
FlexKpiMetricId = KpiMetricId | KpiMetric | str
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).
| ATTRIBUTE | DESCRIPTION |
|---|---|
MEAN |
Mean of the finite values. NaN when none are finite.
|
MAX |
Largest finite value. NaN when none are finite.
|
MIN |
Smallest finite value. NaN when none are finite.
|
SUM |
Sum of the finite values. 0 when none are finite.
|
COUNT |
Number of 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.
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.
| ATTRIBUTE | DESCRIPTION |
|---|---|
NUM_PTS |
Number of samples measured.
|
NUM_PTS_ISI |
Number of samples
|
DUR_SEC |
Duration measured, in seconds.
|
MEAN |
Mean signal level.
|
MIN |
Minimum signal level.
|
MAX |
Maximum signal level.
|
MAX_ABS |
Largest absolute signal level.
|
MAX_MIN_DIFF_ABS |
Signal range,
|
SD |
Signal standard deviation.
|
RMS |
Signal root mean square.
|
NOISE_UV |
The spike detector's noise estimate, which its thresholds are scaled by. NaN when nothing was measured.
|
SNR |
|
EVENT_RATE |
Events per second.
|
EVENT_MAX |
Largest event peak.
|
EVENT_MIN |
Smallest event trough.
|
EVENT_MAX_ABS |
Largest absolute event peak.
|
EVENT_MAX_MIN_DIFF_ABS |
Largest event peak-to-peak.
|
EVENT_MEAN_MAX_ABS |
Mean absolute peak of the events.
|
EVENT_MEAN_MAX_MIN_DIFF_ABS |
Mean peak-to-peak of the events.
|
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
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:
|