Settings

class baybe.settings.Settings[source]

Bases: _SlottedContextDecorator

BayBE settings.

Public methods

__init__(*[, restore_defaults, ...])

Method generated by attrs for class Settings.

activate()

Activate the settings globally.

overwrite(target)

Overwrite the settings of another Settings object.

restore_previous()

Restore the previous settings.

Public attributes and properties

cache_campaign_recommendations

Controls if campaigns cache their latest recommendation.

cache_directory

The directory used for caching.

float_precision_numpy

The floating point precision used for NumPy arrays.

float_precision_torch

The floating point precision used for Torch tensors.

parallelize_simulations

Controls if simulation runs in xyzpy are executed in parallel.

preprocess_dataframes

Controls if dataframe content is validated and normalized before used.

random_seed

The used random seed.

DTypeFloatNumpy

The floating point data type used for NumPy arrays.

DTypeFloatTorch

The floating point data type used for Torch tensors.

use_fpsample

Indicates if fpsample is enabled (i.e., installed and set to be used).

use_polars_for_constraints

Indicates if Polars is enabled (i.e., installed and set to be used).

__init__(*, restore_defaults: bool = False, restore_environment: bool = False, cache_campaign_recommendations: bool = NOTHING, cache_directory: str | Path | None = NOTHING, float_precision_numpy=NOTHING, float_precision_torch=NOTHING, parallelize_simulations: bool = NOTHING, preprocess_dataframes: bool = NOTHING, random_seed: int | None = NOTHING, use_fpsample: AutoBool | bool | str | None = NOTHING, use_polars_for_constraints: AutoBool | bool | str | None = NOTHING)

Method generated by attrs for class Settings.

For details on the parameters, see Public attributes and properties.

activate()[source]

Activate the settings globally.

Return type:

Settings

overwrite(target: Settings)[source]

Overwrite the settings of another Settings object.

Return type:

None

restore_previous()[source]

Restore the previous settings.

Return type:

None

property DTypeFloatNumpy: type[floating]

The floating point data type used for NumPy arrays.

property DTypeFloatTorch: dtype

The floating point data type used for Torch tensors.

cache_campaign_recommendations: bool

Controls if campaigns cache their latest recommendation.

cache_directory: Path | None

The directory used for caching. Set to “” or None to disable caching.

float_precision_numpy: int

The floating point precision used for NumPy arrays.

float_precision_torch: int

The floating point precision used for Torch tensors.

parallelize_simulations: bool

Controls if simulation runs in xyzpy are executed in parallel.

preprocess_dataframes: bool

Controls if dataframe content is validated and normalized before used.

random_seed: int | None

The used random seed.

property use_fpsample: bool

Indicates if fpsample is enabled (i.e., installed and set to be used).

property use_polars_for_constraints: bool

Indicates if Polars is enabled (i.e., installed and set to be used).