param.parameterized.Parameters.outputs#

Parameters.outputs() dict[str, tuple][source]#

Retrieve a mapping of declared outputs for the Parameterized object.

Parameters are declared as outputs using the :meth`output` decorator.

Returns:

A dictionary mapping output names to a tuple of: - Parameter type (Parameter). - Bound method of the output. - Index into the output, or None if there is no specific index.

Return type:

dict

Examples

Declare a single output in a Parameterized class:

>>> import param
>>> class P(param.Parameterized):
...     @param.output()
...     def single_output(self):
...         return 1

Access the outputs:

>>> p = P()
>>> p.param.outputs()
{'single_output': (<param.parameterized.Parameter at 0x...>,
  <bound method P.single_output of P(name='P...')>,
  None)}

Declare multiple outputs:

>>> class Q(param.Parameterized):
...     @param.output(('output1', param.Number), ('output2', param.String))
...     def multi_output(self):
...         return 42, "hello"

Access the outputs:

>>> q = Q()
>>> q.param.outputs()
{'output1': (<param.parameters.Number at 0x...>,
  <bound method Q.multi_output of Q(name='Q...')>,
  0),
 'output2': (<param.parameterized.String at 0x...>,
  <bound method Q.multi_output of Q(name='Q...')>,
  1)}