diff --git a/baybe/constraints/conditions.py b/baybe/constraints/conditions.py index e6c14a3f5..942f93a3d 100644 --- a/baybe/constraints/conditions.py +++ b/baybe/constraints/conditions.py @@ -32,7 +32,7 @@ def _is_not_close(x: ArrayLike, y: ArrayLike, rtol: float, atol: float) -> np.ndarray: - """Return a boolean array indicating where ``x`` and ``y`` are not close. + """Return a Boolean array indicating where ``x`` and ``y`` are not close. The counterpart to ``numpy.isclose``. @@ -43,7 +43,7 @@ def _is_not_close(x: ArrayLike, y: ArrayLike, rtol: float, atol: float) -> np.nd atol: The absolute tolerance parameter. Returns: - A boolean array of where ``x`` and ``y`` are not equal within the + A Boolean array of where ``x`` and ``y`` are not equal within the given tolerances. """ @@ -51,7 +51,7 @@ def _is_not_close(x: ArrayLike, y: ArrayLike, rtol: float, atol: float) -> np.nd def _is_close(x: ArrayLike, y: ArrayLike, rtol: float, atol: float) -> np.ndarray: - """Return a boolean array indicating where ``x`` and ``y`` are close. + """Return a Boolean array indicating where ``x`` and ``y`` are close. The equivalent to :func:``numpy.isclose``. Using ``numpy.isclose`` with Polars dataframes results in this error: @@ -64,7 +64,7 @@ def _is_close(x: ArrayLike, y: ArrayLike, rtol: float, atol: float) -> np.ndarra atol: The absolute tolerance parameter. Returns: - A boolean array of where ``x`` and ``y`` are equal within the + A Boolean array of where ``x`` and ``y`` are equal within the given tolerances. """ @@ -107,7 +107,7 @@ def evaluate(self, data: pd.Series) -> pd.Series: data: A series containing parameter values. Returns: - A boolean series indicating which elements satisfy the condition. + A Boolean series indicating which elements satisfy the condition. """ @abstractmethod diff --git a/baybe/constraints/discrete.py b/baybe/constraints/discrete.py index 143566683..261624c54 100644 --- a/baybe/constraints/discrete.py +++ b/baybe/constraints/discrete.py @@ -346,7 +346,7 @@ class DiscreteCustomConstraint(DiscreteConstraint): # object variables validator: Callable[[pd.DataFrame], pd.Series] = field() """A user-defined function modeling the validation of the constraint. The expected - return is a pandas series with boolean entries True/False for search space elements + return is a pandas series with Boolean entries True/False for search space elements you want to keep/remove.""" @override diff --git a/baybe/surrogates/bandit.py b/baybe/surrogates/bandit.py index e4fe7c0c7..f576c9dfb 100644 --- a/baybe/surrogates/bandit.py +++ b/baybe/surrogates/bandit.py @@ -151,7 +151,7 @@ def _fit(self, train_x: Tensor, train_y: Tensor, _: Any = None) -> None: import torch # IMPROVE: The training inputs/targets can actually be represented as - # integers/boolean values but the transformation pipeline currently + # integers / Boolean values but the transformation pipeline currently # converts them float. Potentially, this can be improved by making # the type conversion configurable. diff --git a/baybe/utils/boolean.py b/baybe/utils/boolean.py index e1d1318fe..17adb52b7 100644 --- a/baybe/utils/boolean.py +++ b/baybe/utils/boolean.py @@ -1,4 +1,4 @@ -"""Functions implementing boolean checks.""" +"""Functions implementing Boolean checks.""" from abc import ABC from typing import Any @@ -45,7 +45,7 @@ def strtobool(val: str) -> bool: The ``bool`` value of the corresponding string representation. Raises: - ValueError: If ``val`` cannot be evaluated to a suitable boolean value. + ValueError: If ``val`` cannot be evaluated to a suitable Boolean value. """ if val.lower() in ("y", "yes", "t", "true", "on", "1"): return True diff --git a/docs/userguide/campaigns.md b/docs/userguide/campaigns.md index 6e36e4a46..19535f6c7 100644 --- a/docs/userguide/campaigns.md +++ b/docs/userguide/campaigns.md @@ -68,7 +68,7 @@ rec = campaign.recommend(batch_size=3) Calling the function returns a `DataFrame` with `batch_size` many rows, each representing a particular parameter configuration from the campaign's search space. Thus, the following might be a `DataFrame` returned by `recommend` in a search space -with the three parameters `Categorial_1`, `Categorical_2` and `Num_disc_1`: +with the three parameters `Categorical_1`, `Categorical_2` and `Num_disc_1`: | | Categorical_1 | Categorical_2 | Num_disc_1 | |---:|:----------------|:----------------|-------------:| diff --git a/docs/userguide/envvars.md b/docs/userguide/envvars.md index 75a37b9f1..e0c865cdc 100644 --- a/docs/userguide/envvars.md +++ b/docs/userguide/envvars.md @@ -16,7 +16,7 @@ set ENVAR_NAME=my_value ``` Note that variables set in this manner are interpreted as text, but converted internally to the needed format. See for instance the [`strtobool`](baybe.utils.boolean.strtobool) -converter for values that can be set so BayBE can interpret them as booleans. +converter for values that can be set so BayBE can interpret them as Booleans. It is also possible to set environment variables in Python: ```python @@ -108,7 +108,7 @@ In general, double precision is recommended because numerical stability during o can be bad when single precision is used. This impacts gradient-based optimization, i.e. search spaces with continuous parameters, more than optimization without gradients. -If you still want to use single precision, you can set the following boolean variables: +If you still want to use single precision, you can set the following Boolean variables: - `BAYBE_NUMPY_USE_SINGLE_PRECISION` (defaults to `False`) - `BAYBE_TORCH_USE_SINGLE_PRECISION` (defaults to `False`) diff --git a/docs/userguide/serialization.md b/docs/userguide/serialization.md index 2525b873e..6f96a31de 100644 --- a/docs/userguide/serialization.md +++ b/docs/userguide/serialization.md @@ -252,7 +252,7 @@ BayBE objects typically appear as part of a larger object hierarchy. For instance, a {class}`SearchSpace ` can hold one or several {class}`Parameters `, just like an -{class}`Objective ` can hold one ore several +{class}`Objective ` can hold one or several {class}`Targets `. This hierarchical structure can be directly replicated in the serialization string: diff --git a/docs/userguide/surrogates.md b/docs/userguide/surrogates.md index 50965e332..26a471f2b 100644 --- a/docs/userguide/surrogates.md +++ b/docs/userguide/surrogates.md @@ -23,7 +23,7 @@ available within BayBE: In principle, the surrogate model does not need to be a persistent object during Bayesian optimization since each iteration performs a new fit anyway. However, for advanced study, such as investigating the posterior predictions, acquisition functions -or feature importance, it can be useful to diretly extract the current surrogate model. +or feature importance, it can be useful to directly extract the current surrogate model. For this, BayBE provides the ``get_surrogate`` method, which is available for the [``Campaign``](baybe.campaign.Campaign.get_surrogate) or for diff --git a/docs/userguide/targets.md b/docs/userguide/targets.md index 99f8bab89..a3d5737b1 100644 --- a/docs/userguide/targets.md +++ b/docs/userguide/targets.md @@ -77,7 +77,7 @@ Targets are used in nearly all [examples](../../examples/examples). ```{important} At the moment, BayBE's only option for targets is the `NumericalTarget`. This enables many use cases due to the real-valued nature of most measurements. -But it can also be used to model categorial targets if they are ordinal. +But it can also be used to model categorical targets if they are ordinal. For example: If your experimental outcome is a categorical ranking into "bad", "mediocre" and "good", you could use a NumericalTarget with bounds (1, 3), where the categories correspond to values 1, 2 and 3 respectively. diff --git a/examples/Basics/recommenders.py b/examples/Basics/recommenders.py index 80ac03f41..324654e1c 100644 --- a/examples/Basics/recommenders.py +++ b/examples/Basics/recommenders.py @@ -79,7 +79,7 @@ "UCB", # upper confidence bound with beta of 1.0 ] -# Note that the qvailability of the acquisition functions might depend on the `batch_size`: +# Note that the availability of the acquisition functions might depend on the `batch_size`: # - If `batch_size` is set to 1, all available acquisition functions can be chosen # - If a larger value is chosen, only those that allow batching. # That is, 'q'-variants of the acquisition functions must be chosen. diff --git a/pyproject.toml b/pyproject.toml index 61186692d..8f416e7dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ ] keywords = [ "Active Learning", - "Bayesian Optmization", + "Bayesian Optimization", "Design of Experiments", "DOE", "Optimization", diff --git a/tests/simulate_telemetry.py b/tests/simulate_telemetry.py index 495f043d9..14527c0b0 100644 --- a/tests/simulate_telemetry.py +++ b/tests/simulate_telemetry.py @@ -97,7 +97,7 @@ add_fake_measurements(dat, campaign.targets) campaign.add_measurements(dat) -# Fake User1a - Adds recommenations before calling recommend +# Fake User1a - Adds recommendations before calling recommend print("Fake User1a") os.environ[VARNAME_TELEMETRY_USERNAME] = "FAKE_USER_1a" campaign = Campaign(**config) diff --git a/tests/test_iterations.py b/tests/test_iterations.py index d3b9ae7fb..fe056469f 100644 --- a/tests/test_iterations.py +++ b/tests/test_iterations.py @@ -90,7 +90,7 @@ valid_nonmc_acqfs = [a() for a in get_subclasses(AcquisitionFunction) if not a.is_mc] # List of all hybrid recommenders with default attributes. Is extended with other lists -# of hybird recommenders like naive ones or recommenders not using default arguments +# of hybrid recommenders like naive ones or recommenders not using default arguments # TODO the TwoPhaseMetaRecommender below can be removed if the SeqGreedy recommender # allows no training data valid_hybrid_recommenders = [ diff --git a/tests/validation/test_acqf_validation.py b/tests/validation/test_acqf_validation.py index 1377cf1b7..061e686bb 100644 --- a/tests/validation/test_acqf_validation.py +++ b/tests/validation/test_acqf_validation.py @@ -41,7 +41,7 @@ def test_qNIPV(sampling_n_points, sampling_fraction, sampling_method, error, mat @pytest.mark.parametrize("acqf", [qNEI, qLogNEI]) def test_EI(acqf): - """Providing a non-boolean argument to `prune_baseline` raises an error.""" + """Providing a non-Boolean argument to `prune_baseline` raises an error.""" with pytest.raises(TypeError): acqf(1)