bayesline.api.equity.AsyncPortfolioCoverageReportAccessorImpl#

class bayesline.api.equity.AsyncPortfolioCoverageReportAccessorImpl(accessor: AsyncReportAccessorApi)#
__init__(accessor: AsyncReportAccessorApi)#

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

accessor

The underlying report accessor API.

scenario_types

__init__(accessor: AsyncReportAccessorApi)#
property accessor: AsyncReportAccessorApi#

The underlying report accessor API.

Returns#

AsyncReportAccessorApi

The underlying report accessor API.

async 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, so count is 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 by axis into these stats.

Returns#

pl.DataFrame

Coverage values in exactly two metric columns: input for raw identifier observations and bayesid for observations resolved into the dataset. Dimensions are portfolio_group, portfolio_id, asset_id_type, and the selected date or asset axis (replaced by stat when stats is given).