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

Validators:
  • _strip_unknown_on_load » all fields

abstract property menu_type: type[M]#

Get the menu type for this settings object.

Returns#

type[M]

The menu type for this settings object.

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: M | None) None#

Validate the settings against the given menu.

Parameters#

menuM | 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: M) str#

Describe the settings.

Parameters#

menuM

The menu to use to describe the settings.

Returns#

str

A description of the settings.

with_dataset(dataset: str) DatasetAwareSettings[Self]#

Bind this settings object to a dataset.

Parameters#

datasetstr

The dataset to scope the settings to.

Returns#

DatasetAwareSettings[Self]

A wrapper carrying both the dataset and this settings.