Skip to content

Commit

Permalink
Fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Nov 10, 2024
1 parent 13156cc commit 16c7568
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions baybe/constraints/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand All @@ -43,15 +43,15 @@ 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.
"""
return np.logical_not(_is_close(x, y, rtol=rtol, atol=atol))


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:
Expand All @@ -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.
"""
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion baybe/constraints/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion baybe/surrogates/bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions baybe/utils/boolean.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Functions implementing boolean checks."""
"""Functions implementing Boolean checks."""

from abc import ABC
from typing import Any
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/campaigns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|---:|:----------------|:----------------|-------------:|
Expand Down
4 changes: 2 additions & 2 deletions docs/userguide/envvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`)

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ BayBE objects typically appear as part of a larger object hierarchy.
For instance, a
{class}`SearchSpace <baybe.searchspace.core.SearchSpace>` can hold one or several
{class}`Parameters <baybe.parameters.base.Parameter>`, just like an
{class}`Objective <baybe.objectives.base.Objective>` can hold one ore several
{class}`Objective <baybe.objectives.base.Objective>` can hold one or several
{class}`Targets <baybe.targets.base.Target>`.
This hierarchical structure can be directly replicated in the serialization string:

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/surrogates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/Basics/recommenders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
]
keywords = [
"Active Learning",
"Bayesian Optmization",
"Bayesian Optimization",
"Design of Experiments",
"DOE",
"Optimization",
Expand Down
2 changes: 1 addition & 1 deletion tests/simulate_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iterations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion tests/validation/test_acqf_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 16c7568

Please sign in to comment.