bayesline.api.equity.ExposureSettings#

pydantic model bayesline.api.equity.ExposureSettings#

Defines exposures as hierarchy of selected styles and substyles.

Show JSON schema
{
   "title": "ExposureSettings",
   "description": "Defines exposures as hierarchy of selected styles and substyles.",
   "type": "object",
   "properties": {
      "exposures": {
         "default": [],
         "description": "The exposures to build the factor risk model on.",
         "items": {
            "discriminator": {
               "mapping": {
                  "categorical": "#/$defs/CategoricalExposureGroupSettings",
                  "continuous": "#/$defs/ContinuousExposureGroupSettings",
                  "inline_uploaded": "#/$defs/InlineUploadedExposureGroupSettings",
                  "interaction": "#/$defs/InteractionExposureGroupSettings",
                  "tsbeta": "#/$defs/TSBetaExposureGroupSettings"
               },
               "propertyName": "exposure_type"
            },
            "oneOf": [
               {
                  "$ref": "#/$defs/ContinuousExposureGroupSettings"
               },
               {
                  "$ref": "#/$defs/CategoricalExposureGroupSettings"
               },
               {
                  "$ref": "#/$defs/TSBetaExposureGroupSettings"
               },
               {
                  "$ref": "#/$defs/InlineUploadedExposureGroupSettings"
               },
               {
                  "$ref": "#/$defs/InteractionExposureGroupSettings"
               }
            ]
         },
         "title": "Exposures",
         "type": "array"
      },
      "orthogonalization_weights": {
         "default": "SqrtCap",
         "description": "The weighting scheme of the net-of projections declared by this settings' exposure groups (see the groups' net_of field), taken over the consuming context's estimation universe. Only dense factor groups (continuous, tsbeta or uploaded) can carry net_of; any group can be named as a source, and multiple net_of-bearing groups project in their declaration order. Owned by the exposures so an orthogonalized exposure is one well-defined derived exposure, identical wherever it is consumed: a consuming factor model always estimates in this projection basis, whatever its own regression weights \u2014 the source factors' returns and statistics absorb what the targets carried on shared directions, while same-date residuals, idiosyncratic returns and R-squared are unchanged. Predicted total risk through the factor covariance can move, because the covariance is estimated across dates in the rotated basis. A model whose regression weights differ is valid \u2014 same fit, same served exposures \u2014 but its source factor returns then only approximate the source-only small model, and a warning is logged when the model is built.",
         "enum": [
            "SqrtCap",
            "InvIdioVar",
            "Cap"
         ],
         "title": "Orthogonalization Weights",
         "type": "string"
      }
   },
   "$defs": {
      "CategoricalExposureGroupSettings": {
         "additionalProperties": false,
         "description": "The settings for a categorical exposure group.\n\nCategorical exposures are exposures to a categorical variable, e.g. industry,\ncountry, etc. For example, an asset exposure may be to a single industry factor,\nand we say the exposure is to the industry category factor \"Materials\". The exposure\nitself may be continuous (e.g. not 0.0 or 1.0), and an asset may be exposed to\nmultiple industry factors (but typically not all of them). The distinction with\ncontinuous exposures is primarily in the settings that are available.",
         "properties": {
            "exposure_type": {
               "const": "categorical",
               "default": "categorical",
               "title": "Exposure Type",
               "type": "string"
            },
            "hierarchy": {
               "description": "The hierarchy to use for the categorical exposures. This is either aHierarchyLevel or HierarchyGroups object. If a string is passed, the value is converted to a HierarchyLevel of that hierarchy with level=1.",
               "discriminator": {
                  "mapping": {
                     "groups": "#/$defs/HierarchyGroups",
                     "level": "#/$defs/HierarchyLevel"
                  },
                  "propertyName": "hierarchy_type"
               },
               "examples": [
                  "trbc",
                  {
                     "hierarchy_type": "level",
                     "level": 2,
                     "name": "trbc"
                  },
                  {
                     "groupings": {
                        "MyGroup1": [
                           "Energy"
                        ],
                        "MyGroup2": [
                           "Materials",
                           "Chemicals"
                        ]
                     },
                     "hierarchy_type": "groups",
                     "name": "style"
                  }
               ],
               "oneOf": [
                  {
                     "$ref": "#/$defs/HierarchyLevel"
                  },
                  {
                     "$ref": "#/$defs/HierarchyGroups"
                  }
               ],
               "title": "Hierarchy"
            },
            "factor_group": {
               "default": "",
               "description": "By default, the name of the factor group will be the name of the hierarchy. But we can override this by specifying an alias here.",
               "examples": [
                  "industry",
                  "some_country_group"
               ],
               "title": "Factor Group",
               "type": "string"
            },
            "include": {
               "anyOf": [
                  {
                     "const": "All",
                     "type": "string"
                  },
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  }
               ],
               "default": "All",
               "description": "Valid industry codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the highest level is used. If 'All', all codes are included.",
               "examples": [
                  [
                     "3571"
                  ],
                  "All",
                  [
                     "Materials",
                     "1010"
                  ],
                  [
                     "Europe",
                     "CAN"
                  ]
               ],
               "title": "Include"
            },
            "exclude": {
               "description": "Valid industry codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the lowest level is used.",
               "examples": [
                  [
                     "3571"
                  ],
                  [
                     "Materials",
                     "1010"
                  ],
                  [
                     "JPN"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Exclude",
               "type": "array"
            }
         },
         "required": [
            "hierarchy"
         ],
         "title": "CategoricalExposureGroupSettings",
         "type": "object"
      },
      "ContinuousExposureGroupSettings": {
         "additionalProperties": false,
         "description": "The settings for a continuous exposure group.\n\nContinuous exposures are exposures that are measured on a continuous scale,\ne.g. market, size, momentum, etc., and are typically available for most assets.",
         "properties": {
            "exposure_type": {
               "const": "continuous",
               "default": "continuous",
               "title": "Exposure Type",
               "type": "string"
            },
            "hierarchy": {
               "description": "The hierarchy to use for the continuous exposures. This is either aHierarchyLevel or HierarchyGroups object. If a string is passed, the value is converted to a HierarchyLevel of that hierarchy with level=1.",
               "discriminator": {
                  "mapping": {
                     "groups": "#/$defs/HierarchyGroups",
                     "level": "#/$defs/HierarchyLevel"
                  },
                  "propertyName": "hierarchy_type"
               },
               "examples": [
                  "market",
                  {
                     "hierarchy_type": "level",
                     "level": 2,
                     "name": "style"
                  },
                  {
                     "groupings": {
                        "momentum": [
                           "mom6"
                        ],
                        "size": [
                           "size"
                        ]
                     },
                     "hierarchy_type": "groups",
                     "name": "style"
                  }
               ],
               "oneOf": [
                  {
                     "$ref": "#/$defs/HierarchyLevel"
                  },
                  {
                     "$ref": "#/$defs/HierarchyGroups"
                  }
               ],
               "title": "Hierarchy"
            },
            "factor_group": {
               "default": "",
               "description": "By default, the name of the factor group will be the name of the hierarchy. But we can override this by specifying an alias here.",
               "examples": [
                  "style",
                  "some_style_group"
               ],
               "title": "Factor Group",
               "type": "string"
            },
            "include": {
               "anyOf": [
                  {
                     "const": "All",
                     "type": "string"
                  },
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  }
               ],
               "default": "All",
               "description": "Valid hierarchy codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the highest level is used. If 'All', all codes are included.",
               "examples": [
                  [
                     "momentum"
                  ],
                  "All",
                  [
                     "Size",
                     "value"
                  ]
               ],
               "title": "Include"
            },
            "exclude": {
               "description": "Valid hierarchy codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the lowest level is used.",
               "examples": [
                  [
                     "momentum"
                  ],
                  [
                     "Size",
                     "value"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Exclude",
               "type": "array"
            },
            "standardize_method": {
               "default": "none",
               "description": "The method to use for standardizing the exposures. If 'none', no standardization is applied. If 'equal_weighted', then the exposures are standardized with the mean and standard deviation of the estimation universe.",
               "enum": [
                  "none",
                  "equal_weighted"
               ],
               "examples": [
                  "none",
                  "equal_weighted"
               ],
               "title": "Standardize Method",
               "type": "string"
            },
            "net_of": {
               "description": "Factor groups this group's exposures are taken net of (weighted-orthogonalized against) under the exposure settings' orthogonalization_weights, e.g. a style block net of ['market', 'industry']. See orthogonalization_weights for what moves in a consuming model and the covariance caveat.",
               "examples": [
                  [
                     "market",
                     "industry"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Net Of",
               "type": "array"
            }
         },
         "required": [
            "hierarchy"
         ],
         "title": "ContinuousExposureGroupSettings",
         "type": "object"
      },
      "Hierarchy": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "additionalProperties": {
                  "$ref": "#/$defs/Hierarchy"
               },
               "type": "object"
            }
         ]
      },
      "HierarchyGroups": {
         "additionalProperties": false,
         "description": "The hierarchy decscription for a custom nested grouping of the hierarchy.\n\nThe top level groupings will turn into factors, whereas any nested\ngroupings will be retained for other uses (e.g. risk decomposition).",
         "properties": {
            "hierarchy_type": {
               "const": "groups",
               "default": "groups",
               "title": "Hierarchy Type",
               "type": "string"
            },
            "name": {
               "description": "\n        The name of the hierarchy to use, e.g. 'trbc' or 'continent'.\n        If it is not given then the default hierarchy will be used.\n        ",
               "examples": [
                  "trbc",
                  "continent"
               ],
               "minLength": 1,
               "title": "Name",
               "type": "string"
            },
            "groupings": {
               "additionalProperties": {
                  "$ref": "#/$defs/Hierarchy"
               },
               "description": "\n        A nested structure of groupings where the keys are the group names\n        and the leaf level is a list of hierarchy codes or labels (at any level)\n        to include for this group.\n        ",
               "title": "Groupings",
               "type": "object"
            }
         },
         "required": [
            "name",
            "groupings"
         ],
         "title": "HierarchyGroups",
         "type": "object"
      },
      "HierarchyLevel": {
         "additionalProperties": false,
         "description": "The hierarchy decscription for a level in the hierarchy.\n\nE.g. for industries specifying level `1` would\ncreate top level sector factors.",
         "properties": {
            "hierarchy_type": {
               "const": "level",
               "default": "level",
               "title": "Hierarchy Type",
               "type": "string"
            },
            "name": {
               "description": "\n        The name of the hierarchy to use, e.g. 'trbc' or 'continent'.\n        If it is not given then the default hierarchy will be used.\n        ",
               "examples": [
                  "trbc",
                  "continent"
               ],
               "minLength": 1,
               "title": "Name",
               "type": "string"
            },
            "level": {
               "default": 1,
               "description": "The level of the hierarchy to use, e.g. 1\n        to use all level 1 names (i.e. sectors for industries or\n        continents for regions) or 2 to use all level 2\n        names (i.e. sub-sectors for industries and\n        countries for regions).\n        ",
               "examples": [
                  1,
                  2
               ],
               "minimum": 1,
               "title": "Level",
               "type": "integer"
            }
         },
         "required": [
            "name"
         ],
         "title": "HierarchyLevel",
         "type": "object"
      },
      "InlineUploadedExposureGroupSettings": {
         "additionalProperties": false,
         "description": "Exposure group settings for exposures taken directly from an uploaded dataset.\n\nReads one factor group of an uploaded exposures dataset at report time, without\nrequiring a risk dataset rebuild. Assets in the upload that are not part of the\nrisk dataset are dropped with a warning when the report is built.\n\nUploaded exposures are stored as 16 bit floats, so the exposures used here are\nthe 16 bit round trip of the uploaded values.",
         "properties": {
            "exposure_type": {
               "const": "inline_uploaded",
               "default": "inline_uploaded",
               "title": "Exposure Type",
               "type": "string"
            },
            "exposure_source": {
               "description": "The name of the uploaded exposures dataset.",
               "minLength": 1,
               "pattern": "^(?:[^/\\s]+/)?[A-Za-z][A-Za-z0-9_-]*$",
               "title": "Exposure Source",
               "type": "string"
            },
            "factor_group": {
               "description": "The factor group in the uploaded dataset to take exposures from.",
               "minLength": 1,
               "pattern": "^[A-Za-z][A-Za-z0-9_-]*$",
               "title": "Factor Group",
               "type": "string"
            },
            "include": {
               "anyOf": [
                  {
                     "const": "All",
                     "type": "string"
                  },
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  }
               ],
               "default": "All",
               "description": "Factor names to include from the uploaded dataset. 'All' includes all.",
               "title": "Include"
            },
            "exclude": {
               "description": "Factor names to exclude from the uploaded dataset.",
               "items": {
                  "type": "string"
               },
               "title": "Exclude",
               "type": "array"
            },
            "forward_fill": {
               "default": false,
               "description": "Whether to forward-fill the exposures along time, gated by the priced-day mask (no fill on days the asset is not in the modeling universe). Applied before gaussianizing and filling missing values.",
               "title": "Forward Fill",
               "type": "boolean"
            },
            "gaussianize": {
               "default": false,
               "description": "Whether to gaussianize the exposures.",
               "title": "Gaussianize",
               "type": "boolean"
            },
            "gaussianize_maintain_zeros": {
               "default": false,
               "description": "Whether to maintain zeros when gaussianizing the exposures. This only takes effect during gaussianization, so it requires ``gaussianize``.",
               "title": "Gaussianize Maintain Zeros",
               "type": "boolean"
            },
            "fill_miss": {
               "default": false,
               "description": "Whether to fill in missing exposures.",
               "title": "Fill Miss",
               "type": "boolean"
            },
            "standardize_method": {
               "default": "none",
               "description": "The method to use for standardizing the exposures. If 'none', no standardization is applied. If 'equal_weighted', then the exposures are standardized with the mean and standard deviation of the estimation universe.",
               "enum": [
                  "none",
                  "equal_weighted"
               ],
               "examples": [
                  "none",
                  "equal_weighted"
               ],
               "title": "Standardize Method",
               "type": "string"
            },
            "net_of": {
               "description": "Factor groups this group's exposures are taken net of (weighted-orthogonalized against) under the exposure settings' orthogonalization_weights, e.g. a style block net of ['market', 'industry']. See orthogonalization_weights for what moves in a consuming model and the covariance caveat.",
               "examples": [
                  [
                     "market",
                     "industry"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Net Of",
               "type": "array"
            }
         },
         "required": [
            "exposure_source",
            "factor_group"
         ],
         "title": "InlineUploadedExposureGroupSettings",
         "type": "object"
      },
      "InteractionExposureGroupSettings": {
         "additionalProperties": false,
         "description": "The settings for an interaction exposure group.\n\nInteraction exposures are exposures that are a combination of two or more\nexposure groups. For example, we may want to create industry-specific style factors.",
         "properties": {
            "exposure_type": {
               "const": "interaction",
               "default": "interaction",
               "title": "Exposure Type",
               "type": "string"
            },
            "exposure_groups": {
               "default": [],
               "description": "The exposure groups to use for the Cartesian product.",
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/ContinuousExposureGroupSettings"
                     },
                     {
                        "$ref": "#/$defs/CategoricalExposureGroupSettings"
                     }
                  ]
               },
               "minItems": 2,
               "title": "Exposure Groups",
               "type": "array"
            },
            "factor_group": {
               "default": "",
               "description": "By default, the name of the factor group will be a concatenation of the names of the exposure groups separated by the a colon.",
               "examples": [
                  "industry:style"
               ],
               "title": "Factor Group",
               "type": "string"
            }
         },
         "title": "InteractionExposureGroupSettings",
         "type": "object"
      },
      "RollingBetaSettings": {
         "description": "OLS rolling beta (univariate per factor).",
         "properties": {
            "method": {
               "const": "ols",
               "default": "ols",
               "title": "Method",
               "type": "string"
            },
            "overlap": {
               "default": 5,
               "description": "Overlap (convolution) window for overlapped returns before beta computation.",
               "minimum": 1,
               "title": "Overlap",
               "type": "integer"
            }
         },
         "title": "RollingBetaSettings",
         "type": "object"
      },
      "RollingHuberBetaSettings": {
         "description": "Robust Huber rolling beta (univariate per factor, with intercept).",
         "properties": {
            "method": {
               "const": "huber",
               "default": "huber",
               "title": "Method",
               "type": "string"
            },
            "max_iter": {
               "default": 10,
               "minimum": 1,
               "title": "Max Iter",
               "type": "integer"
            },
            "level": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Student t-test level for shrinking insignificant betas to zero.",
               "title": "Level"
            },
            "epsilon": {
               "default": 1.35,
               "exclusiveMinimum": 0,
               "title": "Epsilon",
               "type": "number"
            },
            "alpha": {
               "default": 0.0001,
               "minimum": 0,
               "title": "Alpha",
               "type": "number"
            }
         },
         "title": "RollingHuberBetaSettings",
         "type": "object"
      },
      "TSBetaExposureGroupSettings": {
         "additionalProperties": false,
         "description": "Exposure group settings for time-series beta exposures from uploaded time-series.\n\nComputes rolling betas between asset returns and uploaded factor\ntime-series at report time, without requiring a risk dataset rebuild.",
         "properties": {
            "exposure_type": {
               "const": "tsbeta",
               "default": "tsbeta",
               "title": "Exposure Type",
               "type": "string"
            },
            "tsfactors_source": {
               "description": "The name of the uploaded time-series factors dataset.",
               "title": "Tsfactors Source",
               "type": "string"
            },
            "factor_group": {
               "description": "The output factor group name for these exposures.",
               "title": "Factor Group",
               "type": "string"
            },
            "include": {
               "anyOf": [
                  {
                     "const": "All",
                     "type": "string"
                  },
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  }
               ],
               "default": "All",
               "description": "Factor names to include from the uploaded dataset. 'All' includes all.",
               "title": "Include"
            },
            "exclude": {
               "description": "Factor names to exclude from the uploaded dataset.",
               "items": {
                  "type": "string"
               },
               "title": "Exclude",
               "type": "array"
            },
            "currency": {
               "default": "USD",
               "description": "Currency for computing asset returns.",
               "title": "Currency",
               "type": "string"
            },
            "window": {
               "default": 252,
               "description": "Rolling window size for time-series beta computation.",
               "minimum": 2,
               "title": "Window",
               "type": "integer"
            },
            "return_clip_bounds": {
               "default": [
                  null,
                  null
               ],
               "description": "Clip asset returns to (lower, upper) before regression. None means no clip.",
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ]
                  },
                  {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ]
                  }
               ],
               "title": "Return Clip Bounds",
               "type": "array"
            },
            "rolling_regression": {
               "description": "Rolling regression method for beta computation.",
               "discriminator": {
                  "mapping": {
                     "huber": "#/$defs/RollingHuberBetaSettings",
                     "ols": "#/$defs/RollingBetaSettings"
                  },
                  "propertyName": "method"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/RollingBetaSettings"
                  },
                  {
                     "$ref": "#/$defs/RollingHuberBetaSettings"
                  }
               ],
               "title": "Rolling Regression"
            },
            "gaussianize": {
               "default": true,
               "description": "Whether to gaussianize the resulting exposures.",
               "title": "Gaussianize",
               "type": "boolean"
            },
            "gaussianize_maintain_zeros": {
               "default": false,
               "description": "Whether to maintain zeros when gaussianizing the exposures.",
               "title": "Gaussianize Maintain Zeros",
               "type": "boolean"
            },
            "net_of": {
               "description": "Factor groups this group's exposures are taken net of (weighted-orthogonalized against) under the exposure settings' orthogonalization_weights, e.g. a style block net of ['market', 'industry']. See orthogonalization_weights for what moves in a consuming model and the covariance caveat.",
               "examples": [
                  [
                     "market",
                     "industry"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Net Of",
               "type": "array"
            }
         },
         "required": [
            "tsfactors_source",
            "factor_group"
         ],
         "title": "TSBetaExposureGroupSettings",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Config:
  • frozen: bool = True

  • extra: str = forbid

Fields:
  • exposures (list[bayesline.api._src.equity.exposure_settings.ContinuousExposureGroupSettings | bayesline.api._src.equity.exposure_settings.CategoricalExposureGroupSettings | bayesline.api._src.equity.exposure_settings.TSBetaExposureGroupSettings | bayesline.api._src.equity.exposure_settings.InlineUploadedExposureGroupSettings | bayesline.api._src.equity.exposure_settings.InteractionExposureGroupSettings])

  • orthogonalization_weights (Literal['SqrtCap', 'InvIdioVar', 'Cap'])

Validators:
  • _validate_net_of » all fields

  • validate_exposure_groups » exposures

field exposures: Annotated[list[ExposureGroupSettings], BeforeValidator(_ensure_list), Field(description='The exposures to build the factor risk model on.')] = []#

The exposures to build the factor risk model on.

Constraints:
  • func = <function _ensure_list at 0x7f452fa1c900>

  • json_schema_input_type = PydanticUndefined

Validated by:
  • _strip_unknown_on_load

  • _validate_net_of

  • validate_exposure_groups

field orthogonalization_weights: WeightingScheme = 'SqrtCap'#

The weighting scheme of the net-of projections declared by this settings’ exposure groups (see the groups’ net_of field), taken over the consuming context’s estimation universe. Only dense factor groups (continuous, tsbeta or uploaded) can carry net_of; any group can be named as a source, and multiple net_of-bearing groups project in their declaration order. Owned by the exposures so an orthogonalized exposure is one well-defined derived exposure, identical wherever it is consumed: a consuming factor model always estimates in this projection basis, whatever its own regression weights — the source factors’ returns and statistics absorb what the targets carried on shared directions, while same-date residuals, idiosyncratic returns and R-squared are unchanged. Predicted total risk through the factor covariance can move, because the covariance is estimated across dates in the rotated basis. A model whose regression weights differ is valid — same fit, same served exposures — but its source factor returns then only approximate the source-only small model, and a warning is logged when the model is built.

Validated by:
  • _strip_unknown_on_load

  • _validate_net_of

get_references() Sequence[str | int]#

Get references for this settings object.

Only exposure groups that are resolved from uploaded data carry a reference: tsbeta groups reference the uploaded time-series factors dataset, inline uploaded groups the uploaded exposures dataset. The other group types are defined entirely by system hierarchies. Interaction groups can only nest continuous/categorical groups, so they carry no references.

Returns#

Sequence[str | int]

A sequence of references (strings or integers) for this settings object.

map_references(fn: Callable[[str | int], str | int]) Self#

Return a copy with every reference rewritten by fn.

The structural dual of get_references(): it applies fn to each reference this settings object holds — recursing into nested settings — and returns a rewritten copy, leaving all non-reference fields untouched. The base implementation has no references and returns self unchanged, mirroring get_references() (whose default is []); a subclass that overrides one must override the other in lockstep so the two stay consistent (a parity test enforces this).

fn is applied purely structurally — this object knows where its references live, not what a rewrite means. Any resolution context (e.g. a current user or a user directory) must be captured by the caller in the fn closure; the settings layer never learns of it.

Parameters#

fnCallable[[str | int], str | int]

Applied to each reference leaf. Must preserve a reference’s kind (a name stays a name, an id stays an id).

Returns#

Self

A copy with references rewritten.

property menu_type: type[ExposureSettingsMenu]#

Get the menu type for this settings object.

Returns#

type[M]

The menu type for this settings object.

describe(menu: ExposureSettingsMenu) str#

Describe the exposure settings.

Parameters#

menuExposureSettingsMenu

The menu to get context information from.

Returns#

str

The description of the exposure settings.

validator validate_exposure_groups list[Annotated[ContinuousExposureGroupSettings | CategoricalExposureGroupSettings | TSBetaExposureGroupSettings | InlineUploadedExposureGroupSettings | InteractionExposureGroupSettings, FieldInfo(annotation=NoneType, required=True, discriminator='exposure_type')]]  »  exposures#
normalize(universe_settings: UniverseSettings | None, exposure_settings_menu: ExposureSettingsMenu) ExposureSettings#

Normalize the given exposure settings.

Normalize the given exposure settings by converting all exposure hierarchies to a HierarchyGroups object, and then filtering the hierarchy groupings based on the include and exclude statements in the exposure settings, and possibly the universe filters.

This means that if the UniverseSettings have a filter that trims down to just the North American region, and the ExposureSettings include factors from the same country hierarchy, then the factors will be trimmed down to just include the ones corresponding to the North American region.

Parameters#

universe_settings: UniverseSettings | None

the universe settings to use for normalization. If None, then no normalization is performed in relation to the filters in the universe.

exposure_settings_menu: ExposureSettingsMenu

The menu to get the total factors from.

Returns#

ExposureSettings

A new exposure settings object with all exposure hierarchies converted to HierarchyGroups objects, and the hierarchy groupings filtered based on the include and exclude statements in the exposure settings, and possibly the universe filters. This normalized object is also validated.