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 Aug 3, 2024
1 parent 33b305d commit 3a33fda
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 @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Fixed
- Parameter classes are now slotted due to `cached_property` attrs support
- Parameter and objective classes are now slotted due to `cached_property` attrs support

## [0.10.0] - 2024-08-02
### Breaking Changes
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 @@ -61,7 +61,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 3a33fda

Please sign in to comment.