nvflare.fuel.utils.component_builder module

class ComponentBuilder[source]

Bases: ABC

build_component(config_dict)[source]
build_nested_component(config_dict, arg_name)[source]
get_class_path(config_dict)[source]
abstract get_module_scanner()[source]

Provide the package module scanner.

Returns: module_scanner

is_authorizable_component_config(config_dict: dict, node=None) bool[source]

Return whether this dict should be checked by a component-build authorizer.

config_type: dict means the normal nested builder should pass the dict through without instantiating it. Entries under a components list are different: they are later built as top-level components, and those entries require an id. Treat those explicit component-list entries as authorizable even when they set config_type to dict so the allow-list cannot be bypassed before the later build.

is_class_config(config_dict: dict) bool[source]
class ConfigType[source]

Bases: object

COMPONENT = 'component'
DICT = 'dict'