bayesline.api.SettingsRegistry#

class bayesline.api.SettingsRegistry#

Registry for settings with validation against a settings menu.

__init__()#

Methods

__init__()

available_settings([dataset_name])

Get available settings menu for this registry.

delete(name)

Delete an item from the registry.

get(name)

Get an item by name or ID.

get_all()

Get all valid available settings.

get_all_metadata()

Get all available settings metadata.

get_all_with_metadata()

Get all valid available settings with metadata.

get_metadata(name)

Get metadata for an item by name or ID.

get_raw(name_or_id)

Get raw settings by names or IDs.

ids([mode])

Get mapping of IDs to names.

names([mode])

Get mapping of names to IDs.

save(name, settings)

Save settings with validation.

update(name, settings)

Update settings with validation.

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

Get available settings menu for this registry.

Parameters#

dataset_namestr | None, default=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#

SettingsMenuType

A description of valid settings for this registry.

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

Save settings with validation.

Parameters#

namestr

The name for the settings.

settingsSettingsType

The settings to save.

Returns#

int

The unique identifier for the saved settings.

Raises#

ValueError

If the name consists only of numbers or if validation fails.

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

Update settings with validation.

Parameters#

namestr | int

The name or identifier of the settings to update.

settingsSettingsType

The new settings to update with.

Returns#

RawSettings

The previous raw settings before the update.

Raises#

ValueError

If validation fails.