bayesline.api.equity.PORTFOLIO_RETURNS_COLUMN_SETTINGS_MENU

bayesline.api.equity.PORTFOLIO_RETURNS_COLUMN_SETTINGS_MENU#

bayesline.api.equity.PORTFOLIO_RETURNS_COLUMN_SETTINGS_MENU = ReportColumnSettingsMenu(metrics={'pnl': 'flow', 'allocation': 'brinson', 'selection': 'brinson', 'interaction': 'brinson'}, choices={'leg': ['portfolio', 'benchmark', 'active'], 'reference': ['own', 'root'], 'denominator': ['none', 'net', 'gross'], 'dates': ['sum', 'compound', 'sum_over_window'], 'link': ['book_difference', 'carino', 'menchero', 'frongello'], 'variant': ['Brinson-Fachler', 'Brinson-Hood-Beebower']}, defaults={'flow': {'leg': 'portfolio', 'reference': 'root', 'denominator': 'net', 'dates': 'compound', 'link': 'book_difference'}, 'brinson': {'reference': 'root', 'denominator': 'net', 'dates': 'sum', 'link': 'menchero', 'variant': 'Brinson-Fachler'}}, presets={})#

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.