bayesline.api.equity.HierarchyGroups

bayesline.api.equity.HierarchyGroups#

model HierarchyGroups#

The hierarchy decscription for a custom nested grouping of the hierarchy.

The top level groupings will turn into factors, whereas any nested groupings will be retained for other uses (e.g. risk decomposition).

Fields#

Field

Type

Required

Default

Constraints

groupings

Mapping[str, Hierarchy]

Yes

hierarchy_type

Literal[‘groups’]

No

'groups'

name

str

Yes

min_length=1

Validators#

Validator

Mode

Fields

check_valid_groupings

after

groupings

field groupings: Mapping[str, Hierarchy] [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.

Validated by:

check_valid_groupings

field hierarchy_type: Literal['groups'] [Optional]#
field name: str [Required]#

The name of the hierarchy to use, e.g. ‘trbc’ or ‘continent’. If it is not given then the default hierarchy will be used.

Constraints:
  • min_length = 1

validator check_valid_groupings(mode=after)#
Validates:

groupings