bayesline.api.equity.MetricDescriptor

bayesline.api.equity.MetricDescriptor#

model MetricDescriptor#

What a metric column means and how it may be aggregated and combined.

Fields#

Field

Type

Required

Default

additive_over

list[str]

No

factory

domain

tuple[float, float] | None

No

None

family

MetricFamily | None

No

None

label

str

Yes

leaf_only_over

list[str]

No

factory

name

str

Yes

precision

int | None

No

None

qualifiers

UnitQualifiers

No

factory

sign

Literal[‘diverging’, ‘sequential’, ‘none’]

No

'none'

time_aggregation

Literal[‘compound’, ‘sum’, ‘last’, ‘mean’, ‘none’]

Yes

unit

Unit

Yes

field additive_over: list[str] [Optional]#

Dimensions over which a group’s value equals the sum of its members’ values, so members may be stacked to reproduce the group.

field domain: tuple[float, float] | None [Optional]#

A fixed natural domain, such as [-1, 1] for a correlation.

field family: MetricFamily | None [Optional]#

The portfolio / benchmark / active family the metric belongs to.

field label: str [Required]#

A display name for the metric.

field leaf_only_over: list[str] [Optional]#

Dimensions over which the metric is defined for leaf members only; groups carry no value.

field name: str [Required]#

The metric column name.

field precision: int | None [Optional]#

Preferred number of fraction digits.

field qualifiers: UnitQualifiers [Optional]#

Refinements of the unit that also govern axis sharing.

field sign: Literal['diverging', 'sequential', 'none'] [Optional]#

Colour semantics: diverging around zero, sequential from zero, or neither.

field time_aggregation: Literal['compound', 'sum', 'last', 'mean', 'none'] [Required]#

How the metric aggregates over the date dimension: compounded, summed, the last value, the mean, or not at all (valid at a single date only).

field unit: Unit [Required]#

The semantic unit of the metric.