bayesline.api.equity.HierarchyGroups

bayesline.api.equity.HierarchyGroups#

pydantic model bayesline.api.equity.HierarchyGroups#

The hierarchy group description allows for a nested definition of groupings. The top level groupings will turn into factors, whereas any nested groupings will be retained for other uses (e.g. risk decomposition).

Show JSON schema
{
   "title": "HierarchyGroups",
   "description": "The hierarchy group description allows for a nested definition\nof groupings.\nThe top level groupings will turn into factors, whereas any nested\ngroupings will be retained for other uses (e.g. risk decomposition).",
   "type": "object",
   "properties": {
      "hierarchy": {
         "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": "Hierarchy",
         "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"
      }
   },
   "$defs": {
      "Hierarchy": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "additionalProperties": {
                  "$ref": "#/$defs/Hierarchy"
               },
               "type": "object"
            }
         ]
      }
   },
   "required": [
      "hierarchy",
      "groupings"
   ]
}

Fields:
  • groupings (collections.abc.Mapping[str, Hierarchy])

field groupings: Mapping[str, TypeAliasType] [Required]#

A nested structure of groupings where the keys are the group names and the leaf level is a list of hierarchy codes or labels (at any level) to include for this group.