openairbearing.core.params

Parameter metadata for input dataclasses.

Every input number is stored in SI. param attaches what a form, a plot axis or a schema needs to show it: a label, the SI unit, the unit people read it in and the factor from SI to that unit.

param(default, label: str, unit: str = '', display: str | None = None, scale: float = 1.0, minimum: float | None = None, maximum: float | None = None, choices: tuple | None = None, help: str | None = None, follows: str | None = None)[source]

Dataclass field with display metadata.

The metadata is not checked here; it is for whoever shows or reads the value.

  • default: the default value, in SI.

  • label: name of the value as shown to people.

  • unit: SI unit of the stored value.

  • display: unit shown to people (default: the SI unit), with shown value = stored value × scale.

  • minimum, maximum: limits of the stored value, in SI.

  • choices: the values allowed, for a value picked from a list.

  • help: a sentence or two on what the value means, for a tooltip next to its label.

  • follows: name of another field of the same dataclass whose value this one takes while it is not given. The default is then None, which means “not given”; a number holds the value whatever the other field is.