designspace.all_#

designspace.all_(*exprs: BoolExpr) BoolExpr#

Combine conditions with and.

Python’s own and cannot be used on expressions, since it would coerce them to a bool and lose the tree, so this is the n-ary form. It also behaves sensibly at zero arguments, which matters when the conditions are generated from a list that may be empty.

Parameters:

*exprs (BoolExpr) – Conditions to combine. With none, the result is the literal True, the identity of and.

Returns:

The conjunction.

Return type:

BoolExpr

Raises:

TypeError – If any argument is not a boolean expression.

Examples

>>> s = ds.space(ds.param("a").bool(), ds.param("b").bool())
>>> s = s.require(ds.all_(ds.param("a"), ds.param("b")))
>>> s.is_feasible({"a": True, "b": True})
True
>>> s.is_feasible({"a": True, "b": False})
False

The empty fold constrains nothing:

>>> ds.space(ds.param("x").bool()).require(ds.all_()).is_feasible({"x": True})
True