Skip to content
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `validate_parameter_names`, `validate_cardinality_constraints_are_nonoverlapping`
and `validate_cardinality_constraint_parameter_bounds` are no longer available
as public utilities
- `is_constrained` property removed from `SubspaceDiscrete`, `SubspaceContinuous`,
and `SearchSpace`

### Added
- `narwhals` as a hard dependency
- `CandidatesProtocol` as an interface for candidates generation
- `TableCandidates` and `ProductCandidates` classes implementing `CandidatesProtocol`
- `DiscreteParameter.is_finite` property
- `SubspaceDiscrete.batch_constraints` field for storing batch-level constraints
- `SubspaceDiscrete.from_dataframe` now accepts `batch_constraints`

### Changed
- Internal `Campaign` state model simplified: recommended and excluded experiments
Expand All @@ -26,6 +30,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
and `validate_constraints` as the only remaining public entry points
- `_recommend_discrete` and kin now return a `pd.DataFrame` subselection of the
candidates instead of a `pd.Index`
- `SubspaceDiscrete.from_product` and `SubspaceDiscrete.from_simplex` now split
their `constraints` argument into filtering constraints (applied during construction)
and batch constraints (stored in `batch_constraints`)

### Fixed
- Deserialization with constructor selection now correctly respects converter settings
Expand All @@ -34,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Campaign.n_fits_done` and `Campaign.n_batches_done` attributes
- `SubspaceDiscrete` ignores any `empty_encoding` when provided
- `SubspaceDiscrete` no longer accepts a `comp_rep` argument
- `SubspaceDiscrete.constraints` field
Comment thread
AdrianSosic marked this conversation as resolved.
Outdated

## [0.15.0] - 2026-06-11
### Breaking Changes
Expand Down
1 change: 1 addition & 0 deletions baybe/searchspace/_filtered.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def from_subspace(

# >>>>> Deprecation
kwargs.pop("_empty_encoding", None)
kwargs.pop("_constraints", None)
kwargs.pop("_comp_rep", None)
# <<<<< Deprecation

Expand Down
7 changes: 1 addition & 6 deletions baybe/searchspace/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,6 @@ def _drop_parameters(self, parameter_names: Collection[str]) -> SubspaceContinuo
constraints=[*unaffected_constraints, *reduced_constraints],
)

@property
def is_constrained(self) -> bool:
"""Boolean indicating if the subspace is constrained in any way."""
return bool(self.constraints)

Comment thread
AdrianSosic marked this conversation as resolved.
@property
def has_interpoint_constraints(self) -> bool:
"""Boolean indicating if the subspace has any interpoint constraints."""
Expand Down Expand Up @@ -536,7 +531,7 @@ def sample_uniform(self, batch_size: int = 1) -> pd.DataFrame:
if not self.parameters:
return pd.DataFrame(index=pd.RangeIndex(0, batch_size))

if not self.is_constrained:
if not self.constraints:
return self._sample_from_bounds(batch_size, self.comp_rep_bounds.to_numpy())

if len(self.constraints_cardinality) == 0:
Expand Down
7 changes: 1 addition & 6 deletions baybe/searchspace/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,10 @@ def parameters(self) -> tuple[Parameter, ...]:
def constraints(self) -> tuple[Constraint, ...]:
"""Return the constraints of the search space."""
return (
*self.discrete.constraints,
*self.discrete.batch_constraints,
*self.continuous.constraints,
)

@property
def is_constrained(self) -> bool:
"""Boolean indicating if the search space has any constraints."""
return self.discrete.is_constrained or self.continuous.is_constrained

@property
def type(self) -> SearchSpaceType:
"""Return the type of the search space."""
Expand Down
Loading
Loading