bayesline.api.equity.PortfolioOverride#

pydantic model bayesline.api.equity.PortfolioOverride#

All overrides for a single portfolio within a scenario.

Show JSON schema
{
   "title": "PortfolioOverride",
   "description": "All overrides for a single portfolio within a scenario.",
   "type": "object",
   "properties": {
      "rebalance_frequency": {
         "$ref": "#/$defs/RebalanceFrequency",
         "default": "never",
         "description": "How often to reapply the overridden holdings within each window."
      },
      "windows": {
         "description": "Time-windowed override sets for this portfolio.",
         "items": {
            "$ref": "#/$defs/HoldingsOverrideWindow"
         },
         "title": "Windows",
         "type": "array"
      }
   },
   "$defs": {
      "HoldingsOverrideWindow": {
         "description": "A time-windowed set of holdings overrides for a single portfolio.",
         "properties": {
            "snapshot_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set, replace the portfolio's holdings within this window with the full holdings as of this date. Overrides are then applied on top. If None, only the explicit overrides are applied.",
               "title": "Snapshot Date"
            },
            "start_date": {
               "description": "Override effective start date.",
               "format": "date",
               "title": "Start Date",
               "type": "string"
            },
            "end_date": {
               "description": "Override effective end date.",
               "format": "date",
               "title": "End Date",
               "type": "string"
            },
            "overrides": {
               "additionalProperties": {
                  "type": "number"
               },
               "description": "Mapping of target_id (a leaf asset_id or a child portfolio_id) to an override value, applied after snapshot replacement. Each value is interpreted per ``override_unit``.",
               "title": "Overrides",
               "type": "object"
            },
            "override_unit": {
               "$ref": "#/$defs/OverrideUnit",
               "default": "nav",
               "description": "How to interpret the ``overrides`` values. NAV (default): an absolute target NAV in the report currency. WEIGHT: a target fraction of the parent portfolio's own total NAV, supported only for child-portfolio targets and for leaf targets on fund-of-fund / source portfolios (a weight on a post-lookthrough / non-cascade leaf target is rejected)."
            }
         },
         "required": [
            "start_date",
            "end_date"
         ],
         "title": "HoldingsOverrideWindow",
         "type": "object"
      },
      "OverrideUnit": {
         "description": "Interpretation of the float values in ``HoldingsOverrideWindow.overrides``.",
         "enum": [
            "nav",
            "weight"
         ],
         "title": "OverrideUnit",
         "type": "string"
      },
      "RebalanceFrequency": {
         "description": "How often to reapply the overridden holdings.",
         "enum": [
            "daily",
            "weekly",
            "monthly",
            "quarterly",
            "semi-annually",
            "annually",
            "never"
         ],
         "title": "RebalanceFrequency",
         "type": "string"
      }
   },
   "required": [
      "windows"
   ]
}

Config:
  • frozen: bool = True

Fields:
  • rebalance_frequency (bayesline.api._src.equity.report.scenarios.RebalanceFrequency)

  • windows (list[bayesline.api._src.equity.report.scenarios.HoldingsOverrideWindow])

Validators:
  • _validate_no_overlapping_windows » all fields

field rebalance_frequency: RebalanceFrequency = RebalanceFrequency.NEVER#

How often to reapply the overridden holdings within each window.

Validated by:
  • _validate_no_overlapping_windows

field windows: list[HoldingsOverrideWindow] [Required]#

Time-windowed override sets for this portfolio.

Validated by:
  • _validate_no_overlapping_windows