bayesline.api.AsyncSettingsRegistry#

class bayesline.api.AsyncSettingsRegistry#

Bases: AsyncRegistry[SettingsType], Generic[SettingsType, SettingsMenuType]

Methods

__init__()

available_settings([dataset_name])

Parameters dataset_name str | None The name of the dataset to use when retrieving the settings menu. If not provided, the settings menu will be retrieved for the default dataset.

delete(name)

Parameters name str | int The unique name or int identifier of the settings to delete.

get(name)

Parameters name str | int The unique name or int identifier of the item to retrieve.

get_all()

Returns A dictionary of all valid available settings.

get_all_metadata()

Returns A dictionary of all available settings metadata, valid or invalid.

get_all_with_metadata()

Returns A dictionary of all valid available settings with metadata.

get_metadata(name)

Parameters name str | int The unique name or int identifier of the item to retrieve.

get_raw(name_or_id)

Parameters name_or_id list[str | int] The unique names or int identifiers of the items to retrieve.

ids([mode])

Parameters mode Mode The mode to use when retrieving the ids.

names([mode])

Parameters mode Mode The mode to use when retrieving the ids.

save(name, settings)

Parameters name str The unique name of the item to save. The name cannot be all numbers. settings T The item to save.

update(name, settings)

Parameters name str | int The unique name or int identifier of the item to update. settings T The item to update.

abstract async available_settings(dataset_name: str | None = None) SettingsMenuType#

Parameters#

dataset_namestr | None

The name of the dataset to use when retrieving the settings menu. If not provided, the settings menu will be retrieved for the default dataset.

Returns#

A description of valid settings for this registry.

async save(name: str, settings: SettingsType) int#

Parameters#

namestr

The unique name of the item to save. The name cannot be all numbers.

settingsT

The item to save.

Raises#

ValueError

If the item name already exists or is all numbers.

Returns#

a unique identifier for the saved item.

async update(name: str | int, settings: SettingsType) RawSettings#

Parameters#

namestr | int

The unique name or int identifier of the item to update.

settingsT

The item to update.

Raises#

KeyError

If the item does not exist.

Returns#

The previous raw settings item for the given name.