comnum.frame_metrics#

comnum.frame_metrics(frame, metrics, *, confidence=0.95)#

The metrics of one frame, as a declarative campaign records them (with the values that the blocks recorded), in the format of the metrics of comnum.run_spec().

Parameters:
  • frame (Frame) – the frame after the link.

  • metrics (dict) – the metrics mapping of a specification (report, …).

  • confidence (float) – the level of the intervals.

Returns:

{name: {value, lo, hi, kind, count, total}}, kind being rate (count errors among total events) or mean (of count values).

Return type:

dict

Raises:

ValueError – for an invalid parameter or input (the message names it).

Examples

>>> import comnum
>>> f = comnum.Frame()
>>> comnum.LinkBlock({"type": "source", "constellation": "QPSK", "n_symbols": 8}).apply(f, comnum.Rng(1))
>>> ser = comnum.frame_metrics(f, {"report": ["ser"]})["ser"]
>>> ser["kind"], ser["value"], ser["count"], ser["total"]
('rate', 0.0, 0, 8)