bayesline.api.equity.RiskDatasetLoaderApi#

class bayesline.api.equity.RiskDatasetLoaderApi#

Bases: RegistryBasedApi[RiskDatasetSettings, RiskDatasetSettingsMenu, RiskDatasetApi]

Methods

__init__()

create_dataset(name, settings)

Creates a new dataset with the given name and settings.

create_dataset_as_task(name, settings)

create_or_replace_dataset(name, settings)

delete_dataset(name)

Deletes the given dataset.

delete_dataset_if_exists(name)

Deletes the given dataset if it exists.

get_dataset_names(*[, mode])

Returns the names of all available datasets.

get_default_dataset_name()

Returns str The default dataset name that will be populated into settings if no dataset name is provided.

load(ref_or_settings, *args, **kwargs)

Attributes

abstract get_default_dataset_name() str#

Returns#

str

The default dataset name that will be populated into settings if no dataset name is provided.

abstract get_dataset_names(*, mode: Literal['System', 'User', 'All'] = 'All') list[str]#

Returns the names of all available datasets.

Parameters#

mode: Literal[“System”, “User”, “All”]

System: only system wide datasets (available to all users and provided by the system).

User: only user specific datasets (available to the current user). All: all datasets (system wide and user specific).

Returns#

list[str]

The names of all available datasets.

create_or_replace_dataset(name: str, settings: RiskDatasetSettings) RiskDatasetApi#
abstract create_dataset(name: str, settings: RiskDatasetSettings) RiskDatasetApi#

Creates a new dataset with the given name and settings.

Parameters#

namestr

The name of the dataset to create.

settingsRiskDatasetSettings

The settings for the dataset to create.

Raises#

DatasetError

if a dataset with the given name already exists or if the settings are otherwise invalid

Returns#

RiskDatasetApi

the API of the newly created dataset

abstract create_dataset_as_task(name: str, settings: RiskDatasetSettings) Task[RiskDatasetApi]#
abstract delete_dataset(name: str) RawSettings#

Deletes the given dataset.

Parameters#

namestr

The name of the dataset to delete.

Raises#

KeyError

if the dataset does not exist

DatasetError

if the dataset could not be deleted

Returns#

RawSettings

The raw settings of the deleted dataset.

delete_dataset_if_exists(name: str) RawSettings | None#

Deletes the given dataset if it exists.

Parameters#

namestr

The name of the dataset to delete.

Raises#

DatasetError

if the dataset could not be deleted

Returns#

RawSettings | None

The raw settings of the deleted dataset if dataset existed.