bayesline.api.equity.AsyncPortfolioReturnsTieoutReportAccessor#

class bayesline.api.equity.AsyncPortfolioReturnsTieoutReportAccessor(accessor: AsyncReportAccessorApi)#

Specific accessor for a portfolio returns tie-out report.

abstract __init__(accessor: AsyncReportAccessorApi)#

Methods

__init__(accessor)

get_asset_breakdown(portfolio_id[, ...])

Get the asset-level breakdown of computed return contribution.

get_tieout([portfolio_names, start_date, ...])

Get the tie-out metric table over the full date window.

with_scenario(scenario_settings)

Return a new accessor with the given scenario settings applied.

Attributes

accessor

The underlying report accessor API.

scenario_types

scenario_types: ClassVar[list[type[Annotated[Union[PortfolioHoldingsScenario, BasketFactorScenario]]]]] = [<class 'bayesline.api._src.equity.report.scenarios.PortfolioHoldingsScenario'>]#
abstract async get_tieout(portfolio_names: list[str] | None = None, start_date: str | date | datetime | None = None, end_date: str | date | datetime | None = None, value_cols: list[str] | None = None) DataFrame#

Get the tie-out metric table over the full date window.

The returned table is collapsed across the date dimension — one row per portfolio (or hierarchy node), one column per metric. Metric columns: coverage, computed_return, uploaded_return, mean_diff, cumulative_diff, mae, rmse, tracking_error, max_abs_diff, plus one hit_rate_<bps>bp column per configured bucket.

Parameters#

portfolio_nameslist[str] | None, default=None

The names of the portfolios (hierarchy nodes) to include. If None, all are included.

start_dateDateLike | None, default=None

The start date of the report.

end_dateDateLike | None, default=None

The end date of the report.

value_colslist[str] | None, default=None

The value columns to return. If None, all metric columns are returned.

Returns#

pl.DataFrame

A dataframe with one row per portfolio and one column per metric.

abstract async get_asset_breakdown(portfolio_id: str, start_date: str | date | datetime | None = None, end_date: str | date | datetime | None = None, value_cols: list[str] | None = None) DataFrame#

Get the asset-level breakdown of computed return contribution.

At the asset level, only computed_return is populated (as per-asset contribution to the leaf’s computed daily return). All other metric columns are NaN — by design, the uploaded-side and diff metrics are only defined at the leaf level. The NaN cells are preserved to enable future stacked-bar visualizations without a schema change.

Parameters#

portfolio_idstr

The id of the leaf portfolio to break down.

start_dateDateLike | None, default=None

The start date of the report.

end_dateDateLike | None, default=None

The end date of the report.

value_colslist[str] | None, default=None

The value columns to return. If None, all metric columns are returned.

Returns#

pl.DataFrame

A dataframe with one row per (date, asset) and one column per metric.