diff --git a/baybe/campaign.py b/baybe/campaign.py index f2fe36532..74ce658bc 100644 --- a/baybe/campaign.py +++ b/baybe/campaign.py @@ -314,7 +314,8 @@ def toggle_discrete_candidates( # noqa: DOC501 Useful for setting up the correct filtering mechanism. Returns: - The discrete candidate set passing through the specified filter. + A new dataframe containing the discrete candidate set passing through the + specified filter. """ raise NotImplementedError( f"Candidate toggling is not implemented for constraint specifications of " @@ -334,7 +335,7 @@ def _( idx = constraint.get_valid(df) # Determine the candidate subset to be toggled - points = df.drop(index=idx) if anti else df.loc[idx] + points = df.drop(index=idx) if anti else df.loc[idx].copy() if not dry_run: self._searchspace_metadata.loc[points.index, _EXCLUDED] = exclude