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 6feb950 commit 0d2e7e8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 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
2 changes: 1 addition & 1 deletion baybe/objectives/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from baybe.targets.base import Target


@define(frozen=True, slots=False)
@define(frozen=True)
class SingleTargetObjective(Objective):
"""An objective focusing on a single target."""

Expand Down

0 comments on commit 0d2e7e8

Please sign in to comment.