param.bind#

param.bind(function, *args, watch=False, **kwargs)[source]#

Given a function, returns a wrapper function that binds the values of some or all arguments to Parameter values and expresses Param dependencies on those values, so that the function can be invoked whenever the underlying values change and the output will reflect those updated values.

As for functools.partial, arguments can also be bound to constants, which allows all of the arguments to be bound, leaving a simple callable object.

Parameters:
  • function (callable) – The function to bind constant or dynamic args and kwargs to.

  • args (object, param.Parameter) – Positional arguments to bind to the function.

  • watch (boolean) – Whether to evaluate the function automatically whenever one of the bound parameters changes.

  • kwargs (object, param.Parameter) – Keyword arguments to bind to the function.

Returns:

  • Returns a new function with the args and kwargs bound to it and

  • annotated with all dependencies.