set_values#

zfit.param.set_values(params, values=None, allow_partial=None, *, clip=None)[source]#

Set the values (using a context manager or not) of multiple parameters.

Parameters:
  • params (Parameter | Iterable[Parameter]) – Parameters to set the values.

  • values (Union[int, float, complex, tf.Tensor, ZfitParameter, Iterable[Union[int, float, complex, tf.Tensor, ZfitParameter]], ZfitResult, Mapping[str | ZfitParameter, Union[int, float, complex, tf.Tensor, ZfitParameter]], None]) – List-like object that supports indexing, a FitResult or a Mapping of parameters or parameter names to values.

  • allow_partial (bool | None) – Allow to set only parts of the parameters in case values is a ZfitResult and not all are present in the values. If False, params not in values will raise an error. Note that setting this to true will also go with an empty values container.

  • clip (bool | None) – If True, clip values to be within parameter limits instead of raising an error. If False, raise an error if values are outside limits (default behavior). If None, use the default behavior (raise error).

Return type:

TemporarilySet

Returns:

An object for a context manager (but can also be used without), can be ignored.

Raises:
  • ValueError – If the value is not between the limits of the parameter and clip is False/None.

  • ValueError – If not all params are in values if values is a FitResult and allow_partial is False.