nvflare.fuel.utils.class_utils module

class ModuleScanner(base_pkgs: List[str], module_names: List[str], exclude_libs=True)[source]

Bases: object

Loads specified modules from base packages and then constructs a class to module name mapping.

  • base_pkgs – base packages to look for modules in

  • module_names – module names to load

  • exclude_libs – excludes modules containing .libs if True. Defaults to True.

get_module_name(class_name) str | None[source]

Gets the name of the module that contains this class.


class_name – The name of the class


The module name if found.

instantiate_class(class_path, init_params)[source]

Method for creating an instance for the class.

  • class_path – full path of the class

  • init_params – A dictionary that contains the name of the transform and constructor input

  • a (arguments. The transform name will be appended to medical.common.transforms to make) –

  • built. (full name of the transform to be) –