QualityMetric#

class pypillometry.QualityMetric(name, title, value, unit='', label=None, description='', thresholds=None)[source]#

Bases: object

A single quality measure.

Attributes:
namestr

short name (e.g., “missing_pct”)

titlestr

human-readable name (e.g., “missing data”)

valuefloat, int, str or None

the value (NaN or None if it could not be computed)

unitstr

unit of value (e.g., “%”, “s”, “deg”)

labelstr or None

“good”, “ok”, “poor”, “bad”, or None if the measure has no label

descriptionstr

what is measured

thresholdstuple or None

the thresholds used for the label

Methods

format_value

Return the value with unit as a short string.

to_dict

Return the metric as a dict (value, unit, label, description).

Details

format_value()[source]#

Return the value with unit as a short string.

Return type:

str

to_dict()[source]#

Return the metric as a dict (value, unit, label, description).

Return type:

dict