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[, keep_random_state])

Overwrite the settings of another Settings object.

restore_previous()

Restore the previous settings.

Public attributes and properties

cache_campaign_recommendations

Controls if Campaign objects cache their latest set of recommendations.

cache_directory

The directory used for persistent caching on disk.

parallelize_simulation_runs

Controls if simulation runs with xyzpy are executed in parallel.

preprocess_dataframes

Controls if incoming user dataframes are preprocessed (i.e., dtype-converted and validated) before use.

random_seed

The used random seed.

use_single_precision_numpy

Controls the floating point precision used for numpy arrays.

use_single_precision_torch

Controls the floating point precision used for torch tensors.

DTypeFloatNumpy

The floating point precision used for numpy arrays.

DTypeFloatTorch

The floating point precision 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, parallelize_simulation_runs: bool = NOTHING, preprocess_dataframes: bool = NOTHING, random_seed: int | None = None, use_fpsample: AutoBool | bool | str | None = NOTHING, use_polars_for_constraints: AutoBool | bool | str | None = NOTHING, use_single_precision_numpy: bool = NOTHING, use_single_precision_torch: bool = 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, keep_random_state: bool = False)[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 precision used for numpy arrays.

property DTypeFloatTorch: dtype

The floating point precision used for torch tensors.

cache_campaign_recommendations: bool

Controls if Campaign objects cache their latest set of recommendations.

cache_directory: Path | None

The directory used for persistent caching on disk. Set to "" or None to disable caching.

parallelize_simulation_runs: bool

Controls if simulation runs with xyzpy are executed in parallel.

preprocess_dataframes: bool

Controls if incoming user dataframes are preprocessed (i.e., dtype-converted and validated) before use.

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).

use_single_precision_numpy: bool

Controls the floating point precision used for numpy arrays.

use_single_precision_torch: bool

Controls the floating point precision used for torch tensors.