Skip to main content

measures.measure_units

measures.measure_units(spec)

The measures of every unit, the rows of babregen measures.

Parameters

Name Type Description Default
spec RegenSpec The loaded spec. required

Returns

Name Type Description
list[UnitMeasures] list[UnitMeasures]: One entry per unit, ordered by pace from slow to fast, then units without a valid pace, and by name within a pace.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import load_spec, make_sample_repo, measure_units

with TemporaryDirectory() as tmp:
    spec = load_spec(make_sample_repo(Path(tmp) / "demo"))
    print([m.unit for m in measure_units(spec)])
['samplepkg.core.calc']