bayesline.api.equity.ReportColumnSettingsMenu

bayesline.api.equity.ReportColumnSettingsMenu#

model ReportColumnSettingsMenu#

What a report’s columns may be: metrics, choices, defaults and presets.

A column is validated against the menu of the report it is asked of, and resolve() fills its None choices from the menu’s defaults. The precedence a column resolves by is its explicit field, then a preset, then the defaults a deployment lays over the report’s, then the report’s, then the variant’s. A bare name in value_cols is a preset where the menu has one of that name, and a metric otherwise: a preset wins over a metric of the same name, which stays reachable as a pair, and nothing stops a preset taking a metric’s name. A menu with no metrics offers no column.

Fields#

Field

Type

Required

Default

choices

dict[str, list[str]]

No

factory

defaults

dict[str, dict[str, str]]

No

factory

metrics

dict[str, str]

No

factory

presets

dict[str, AnyReportColumnSettings[Never]]

No

factory

field choices: dict[str, list[str]] [Optional]#

The values each choice field admits.

field defaults: dict[str, dict[str, str]] [Optional]#

What a None choice resolves to, keyed by metric or by column kind; a metric’s entry takes precedence over its kind’s.

field metrics: dict[str, str] [Optional]#

Each metric the report answers, mapped to its column kind.

field presets: dict[str, AnyReportColumnSettings[Never]] [Optional]#

Named columns, every choice set: the report’s metric columns.