[docs]defdefault_constraint_error(params:Iterable[Parameter],desc:str)->str:return('the following constraint on parameters [%s] was not satisfied: %s'%(join_param_labels(params),desc))
[docs]classUnsatisfiableConstraint(Exception):"""Raised if a constraint cannot be satisfied by a group of parameters independently from their values at runtime; e.g. ``mutually_exclusive`` cannot be satisfied if multiple of the parameters are required."""def__init__(self,constraint:'Constraint',params:Iterable[Parameter],reason:str):self.constraint=constraintself.params=paramsself.reason=reasonparam_names=join_param_labels(params)message=(f"\nthe constraint {constraint}\n"f"defined on parameters [{param_names}]\n"f"cannot be satisfied because {reason}")super().__init__(message)