Skip to content

Commit

Permalink
Make objective classes slotted
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Apr 18, 2024
1 parent 5b4a598 commit 4b98c3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
parameter configurations
- Simulation no longer fails for targets in `MATCH` mode
- `closest_element` now works for array-like input of all kinds
- Parameter classes are now slotted due to `cached_property` attrs support
- Parameter and objective classes are now slotted due to `cached_property` attrs support

### Deprecations
- The former `baybe.objective.Objective` class has been replaced with
Expand Down
5 changes: 1 addition & 4 deletions baybe/objectives/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
from baybe.serialization.mixin import SerialMixin
from baybe.targets.base import Target

# TODO: Reactive slots in all classes once cached_property is supported:
# https://github.com/python-attrs/attrs/issues/164


@define(frozen=True, slots=False)
@define(frozen=True)
class Objective(ABC, SerialMixin):
"""Abstract base class for all objectives."""

Expand Down
2 changes: 1 addition & 1 deletion baybe/objectives/desirability.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def scalarize(
return func(values, weights=weights)


@define(frozen=True, slots=False)
@define(frozen=True)
class DesirabilityObjective(Objective):
"""An objective scalarizing multiple targets using desirability values."""

Expand Down

0 comments on commit 4b98c3f

Please sign in to comment.