bayesline.api.equity.HierarchyLevel#

pydantic model bayesline.api.equity.HierarchyLevel#

The hierarchy decscription for a level in the hierarchy.

E.g. for industries specifying level 1 would create top level sector factors.

Show JSON schema
{
   "title": "HierarchyLevel",
   "description": "The hierarchy decscription for a level in the hierarchy.\n\nE.g. for industries specifying level `1` would\ncreate top level sector factors.",
   "type": "object",
   "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"
      }
   },
   "additionalProperties": false,
   "required": [
      "name"
   ]
}

Config:
  • frozen: bool = True

  • extra: str = forbid

Fields:
  • hierarchy_type (Literal['level'])

  • level (int)

Validators:
  • check_valid_level » level

field hierarchy_type: Literal['level'] = 'level'#
field level: int = 1#

The level of the hierarchy to use, e.g. 1 to use all level 1 names (i.e. sectors for industries or continents for regions) or 2 to use all level 2 names (i.e. sub-sectors for industries and countries for regions).

Constraints:
  • ge = 1

Validated by:
  • check_valid_level

validator check_valid_level int  »  level#