nvflare.collab.api.proxy module

class Proxy(app, target_name, target_fqn: str, backend: _InvocationDispatcher, target_interface: PublishInterface | Mapping[str, Sequence] | None)[source]

Bases: object

The Proxy represents a target in the App.

add_child(name, p)[source]
adjust_func_args(func_name, args, kwargs)[source]

Based on specified args and kwargs, this method finds corresponding keywords for all positional args based on the interface of the func, and then moves the positional args into kwargs.

Once done, all args will have keywords, which makes it easy for call filters to identify the args to process.

Parameters:
  • func_name – name of the func.

  • args – positional arg values.

  • kwargs – keyword arg values

Returns: the proxy that the func belongs to, interface of the func, empty args, and new kwargs

call_func(call_opt: CallOption, func_name, args, kwargs)[source]

Call the specified function with call options.

Parameters:
  • call_opt – call option that controls the call behavior.

  • func_name – name of func to be called.

  • args – args to be passed to the func.

  • kwargs – kwargs to be passed to the func.

Returns: result of the function, or None when an optional call fails.

get_child(name)[source]

Get the specified child proxy.

Parameters:

name – name of the child proxy.

Returns: the child proxy if defined.

property name