Skip to content

Commit

Permalink
Fix unintended renamings and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Scienfitz committed Feb 27, 2024
1 parent dd5eb1a commit 6700e6c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- `Recommender`s now share their core logic via their base class
- Remove progress bars in examples
- Strategies are now called `MetaRecommender`'s and part of the recommenders.meta module
- `Recommender`'s are now called `PureRecommender`'s and part of the recommenders.pure
- Strategies are now called `MetaRecommender`'s and part of the `recommenders.meta`
module
- `Recommender`'s are now called `PureRecommender`'s and part of the `recommenders.pure`
module
- `strategy` keyword of `Campaign` renamed to `recommender`
- `NaiveHybridRecommender` renamed to `NaiveHybridSpaceRecommender`
Expand Down
2 changes: 1 addition & 1 deletion baybe/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class PartialAcquisitionFunction:
pinned_part: Tensor
"""The values that will be attached whenever evaluating the acquisition function."""

pin_discrete: Tensor
pin_discrete: bool
"""A flag for denoting whether ``pinned_part`` corresponds to the discrete
subspace."""

Expand Down
6 changes: 3 additions & 3 deletions baybe/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Campaign(SerialMixin):
In particular, a campaign:
* Defines the objective of an experimentation process.
* Defines the search space over which the experimental parameter may vary.
* Defines a recommender for traversing the search space.
* Defines a recommender for exploring the search space.
* Records the measurement data collected during the process.
* Records metadata about the progress of the experimentation process.
"""
Expand Down Expand Up @@ -100,8 +100,8 @@ def _validate_strategy(self, _, value) -> None:
"""Raise a DeprecationError if the strategy attribute is used."""
if value is not None:
raise DeprecationError(
"Passing 'strategy' to the constructor is deprecated. The attribute"
" has been renamed to 'recommender'"
"Passing 'strategy' to the constructor is deprecated. The attribute "
"has been renamed to 'recommender'."
)

@property
Expand Down
2 changes: 1 addition & 1 deletion baybe/parameters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DiscreteParameter(Parameter, ABC):

# class variables
encoding: Optional[ParameterEncoding] = field(init=False, default=None)
"""An optional encoding recommender for the parameter."""
"""An optional encoding for the parameter."""

@property
@abstractmethod
Expand Down
4 changes: 2 additions & 2 deletions baybe/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The term "simulation" can have two slightly different interpretations, depending on the
applied context:
* It can refer to "backtesting" a particular DOE recommender on a fixed (finite)
* It can refer to "backtesting" a particular DOE strategy on a fixed (finite)
dataset. In this context, "simulation" means investigating what experimental
trajectory we would have observed if we had applied the recommender in a certain
defined context and restricted the possible parameter configurations to those
Expand Down Expand Up @@ -492,7 +492,7 @@ def simulate_experiment(
measured = campaign.recommend(batch_size=batch_size)
except NotEnoughPointsLeftError:
# TODO: There can be still N < batch_quantity points left in the search
# space. Once the recommender/recommender refactoring is completed,
# space. Once the recommender/strategy refactoring is completed,
# find an elegant way to return those.
warnings.warn(
"The simulation of the campaign ended because because not sufficiently "
Expand Down
3 changes: 1 addition & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ packages = baybe

; at some point, these excludes should all be gone ...
exclude = (?x)(
baybe/recommenders
| baybe/searchspace
baybe/searchspace
| baybe/serialization
| baybe/strategies
| baybe/surrogates
Expand Down
2 changes: 1 addition & 1 deletion tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_renamed_surrogate():
from baybe.surrogate import GaussianProcessSurrogate # noqa: F401


def test_missing_strategy_type(config):
def test_missing_recommender_type(config):
"""Specifying a recommender without a corresponding type raises a warning."""
dict_ = json.loads(config)
dict_["recommender"].pop("type")
Expand Down

0 comments on commit 6700e6c

Please sign in to comment.