bayesline.api.Settings#

pydantic model bayesline.api.Settings#

Base class for all settings objects.

Show JSON schema
{
   "title": "Settings",
   "description": "Base class for all settings objects.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

Config:
  • frozen: bool = True

  • extra: str = forbid

abstract property menu_type: type[SettingsMenuType]#

Get the menu type for this settings object.

Returns#

type[SettingsMenuType]

The menu type for this settings object.

references() dict[str, dict[type[Settings], list[str | int]]]#

Get all other settings that are referenced by this settings.

For example, if a risk model references a universe.

Returns#

dict[str, dict[type[Settings], list[str | int]]]

A dict of the field name to a dict of the referenced settings type to the list of referenced settings (either by name or id).

get_references() Sequence[str | int]#

Get references for this settings object.

Returns#

Sequence[str | int]

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

validate_settings(menu: SettingsMenuType | None) None#

Validate the settings against the given menu.

Parameters#

menuSettingsMenuType | None

The menu to validate against. If None, the settings are validated against without having the menu context. This means that less validation is done.

Raises#

AttributeError

If the menu type does not match the settings type.

describe(menu: SettingsMenuType) str#

Describe the settings.

Parameters#

menuSettingsMenuType

The menu to use to describe the settings.

Returns#

str

A description of the settings.