bayesline.api.equity.BaseAssetTearsheet#

pydantic model bayesline.api.equity.BaseAssetTearsheet#

What every report’s tearsheet carries: its subject and its date axis.

portfolio_path is the portfolio the subject was taken under, as a list to account for fund-of-funds structures, and is empty when the whole report was taken. The same asset yields a different tearsheet under each portfolio, so a report’s metrics only mean something alongside it.

A tearsheet may roll up across every asset the portfolio holds, in which case its subject is the portfolio rather than an asset: asset_id_type is "portfolio_id", asset_id and asset_name are the portfolio, and the input identifiers – an asset-only notion – are null.

dates is the axis a report’s metrics are given over. A metric requested without history holds a single value, the one at the last of those dates, so a tearsheet asked for no history at all is every metric at its latest date.

Show JSON schema
{
   "title": "BaseAssetTearsheet",
   "description": "What every report's tearsheet carries: its subject and its date axis.\n\n``portfolio_path`` is the portfolio the subject was taken under, as a list to\naccount for fund-of-funds structures, and is empty when the whole report was\ntaken. The same asset yields a different tearsheet under each portfolio, so a\nreport's metrics only mean something alongside it.\n\nA tearsheet may roll up across every asset the portfolio holds, in which case\nits subject is the portfolio rather than an asset: ``asset_id_type`` is\n``\"portfolio_id\"``, ``asset_id`` and ``asset_name`` are the portfolio, and the\ninput identifiers -- an asset-only notion -- are null.\n\n``dates`` is the axis a report's metrics are given over. A metric requested\nwithout history holds a single value, the one at the last of those dates, so\na tearsheet asked for no history at all is every metric at its latest date.",
   "type": "object",
   "properties": {
      "asset_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Asset Id"
      },
      "asset_id_type": {
         "default": "bayesid",
         "enum": [
            "bayesid",
            "portfolio_id"
         ],
         "title": "Asset Id Type",
         "type": "string"
      },
      "asset_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Asset Name"
      },
      "input_asset_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Input Asset Id"
      },
      "input_asset_id_type": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Input Asset Id Type"
      },
      "portfolio_path": {
         "items": {
            "type": "string"
         },
         "title": "Portfolio Path",
         "type": "array"
      },
      "dates": {
         "items": {
            "format": "date",
            "type": "string"
         },
         "title": "Dates",
         "type": "array"
      }
   },
   "required": [
      "asset_id",
      "asset_name",
      "input_asset_id",
      "input_asset_id_type",
      "dates"
   ]
}

Fields:
  • asset_id (str | None)

  • asset_id_type (Literal['bayesid', 'portfolio_id'])

  • asset_name (str | None)

  • dates (list[datetime.date])

  • input_asset_id (str | None)

  • input_asset_id_type (str | None)

  • portfolio_path (list[str])

field asset_id: str | None [Required]#
field asset_id_type: Literal['bayesid', 'portfolio_id'] = 'bayesid'#
field asset_name: str | None [Required]#
field input_asset_id: str | None [Required]#
field input_asset_id_type: str | None [Required]#
field portfolio_path: list[str] [Optional]#
field dates: list[date] [Required]#