param.parameterized.Parameters.method_dependencies#

Parameters.method_dependencies(name: str, intermediate: bool = False) list[PInfo][source]#

Retrieve the parameter dependencies of a specified method.

By default intermediate dependencies on sub-objects are not returned as these are primarily useful for internal use to determine when a sub-object dependency has to be updated.

Parameters:
  • name (str) – The name of the method whose dependencies are to be retrieved.

  • intermediate (bool, optional) – If True, includes intermediate dependencies on sub-objects. These are primarily useful for internal purposes. Default is False.

Returns:

A list of PInfo objects representing the dependencies of the specified method. Each PInfo object contains information about the instance, parameter, and the type of dependency.

Return type:

list[PInfo]

Examples

>>> import param
>>> class MyClass(param.Parameterized):
...     a = param.Parameter()
...     b = param.Parameter()
...
...     @param.depends('a', 'b', watch=True)
...     def test(self):
...         pass

Create an instance and inspect method dependencies:

>>> instance = MyClass()
>>> instance.param.method_dependencies('test')
[PInfo(inst=MyClass(a=None, b=None, name='MyClass...]