1717from attrs .validators import instance_of
1818from typing_extensions import override
1919
20- from baybe .constraints .base import DiscreteConstraint , DiscreteFilteringConstraint
20+ from baybe .constraints .base import DiscreteFilteringConstraint
2121from baybe .exceptions import (
2222 IncompatibilityError ,
2323 NoMeasurementsError ,
@@ -426,7 +426,7 @@ def update_measurements(
426426
427427 def toggle_discrete_candidates ( # noqa: DOC501
428428 self ,
429- constraints : Collection [DiscreteConstraint ] | pd .DataFrame ,
429+ constraints : Collection [DiscreteFilteringConstraint ] | pd .DataFrame ,
430430 exclude : bool ,
431431 complement : bool = False ,
432432 dry_run : bool = False ,
@@ -436,8 +436,8 @@ def toggle_discrete_candidates( # noqa: DOC501
436436 Args:
437437 constraints: A filtering mechanism determining the candidates subset to be
438438 in-/excluded. Can be either a collection of
439- :class:`~baybe.constraints.base.DiscreteConstraint ` or a dataframe.
440- For the latter, see :func:`~baybe.utils.dataframe.filter_df`
439+ :class:`~baybe.constraints.base.DiscreteFilteringConstraint ` or a
440+ dataframe. For the latter, see :func:`~baybe.utils.dataframe.filter_df`
441441 for details.
442442 exclude: If ``True``, the specified candidates are excluded.
443443 If ``False``, the candidates are considered for recommendation.
@@ -483,8 +483,8 @@ def toggle_discrete_candidates( # noqa: DOC501
483483
484484 else :
485485 raise TypeError (
486- "Candidate toggling is not implemented for the given type of "
487- "constraint specifications ."
486+ f "Candidate toggling requires a dataframe or a collection of "
487+ f"' { DiscreteFilteringConstraint . __name__ } ' instances ."
488488 )
489489
490490 if not dry_run :
0 commit comments