bayesline.api.equity.PortfolioCoverageReportAccessor#
- class bayesline.api.equity.PortfolioCoverageReportAccessor(accessor: ReportAccessorApi)#
Typed wrapper around the generic portfolio coverage cube.
- abstract __init__(accessor: ReportAccessorApi)#
Methods
__init__(accessor)coverage(*, by, metric, stats)Compute identifier coverage from the coverage cube.
with_scenario(scenario_settings)Return a new accessor with the given scenario settings applied.
Attributes
accessorThe underlying report accessor API.
scenario_types- abstract coverage(*, by: Literal['date', 'asset'], metric: Literal['count', 'holding'], stats: list[Literal['min', 'max', 'mean']] | None) DataFrame#
Compute identifier coverage from the coverage cube.
Parameters#
- byLiteral[“date”, “asset”]
The coverage aggregation axis, either by date or by input asset. With
by="asset"values aggregate over the window’s dates, socountis the number of held-day observations per identifier.- metricLiteral[“count”, “holding”]
The metric to compute, either count of held identifiers or sum of holding values in USD. Mapped holdings are repriced daily; an unmapped holding carries its uploaded nav, converted to USD at its snapshot date, or zero when only a quantity was uploaded.
- statslist[CoverageStat] | None
List of ‘min’, ‘max’, ‘mean’; when given, collapses the
byaxis into these stats.
Returns#
- pl.DataFrame
Coverage values in exactly two metric columns:
inputfor raw identifier observations andbayesidfor observations resolved into the dataset. Dimensions areportfolio_group,portfolio_id,asset_id_type, and the selected date or asset axis (replaced bystatwhenstatsis given).