metricengine.calculations.utilities
Utility and helper calculations.
This module contains utility calculations, averages, and helper functions. All calculations use the Collection namespace for proper organization.
- metricengine.calculations.utilities.average_value(values)[source]
Arithmetic mean of a sequence.
- Return type:
FV[U]
- Behavior:
Uses SKIP mode: None items are excluded from both sum and count.
Empty or all-None → returns None.
Result unit follows the first non-None item’s unit (else Dimensionless).
- metricengine.calculations.utilities.weighted_average(values, weights)[source]
Weighted mean of values with weights.
- Return type:
FV[U]
- Behavior:
Uses SKIP mode: pairs with None in either value or weight are dropped.
Empty input or length mismatch → returns None (business rule).
Result unit follows the first non-None value’s unit (else Dimensionless).