Skip to main content

measures.measures_table

measures.measures_table(spec)

Pace, intent coverage and specification size of every unit, as a Markdown table.

Parameters

Name Type Description Default
spec RegenSpec The loaded spec. required

Returns

Name Type Description
str str The columns unit \| pace \| coverage \| decisions \| consumers \| code \| record \| decision lines \| evaluation lines \| spec \| ratio, one row per unit, ordered slow, medium, fast, then units without a valid pace, and by name within a pace, and a total row of the sums. coverage is covered items out of all items; decisions is the number of decision records the intent items cite and consumers the number of declared consumers; code, record, decision lines and evaluation lines are lines; spec is the sum of the last three and ratio is spec per line of code.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import load_spec, make_sample_repo, measures_table

with TemporaryDirectory() as tmp:
    spec = load_spec(make_sample_repo(Path(tmp) / "demo"))
    print(measures_table(spec))
| unit | pace | coverage | decisions | consumers | code | record | decision lines | evaluation lines | spec | ratio |
|---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| samplepkg.core.calc | fast | 1/1 | 1 | 2 | 10 | 23 | 9 | 9 | 41 | 4.1 |
| total | - | 1/1 | 1 | 2 | 10 | 23 | 9 | 9 | 41 | 4.1 |