bitorch.util.build_lookup_dictionary

bitorch.util.build_lookup_dictionary(current_module_name: str, class_strings: ~typing.List[str], filter_by_superclass: ~typing.Optional[~typing.Any] = None, filter_fn: ~typing.Optional[~typing.Callable[[~typing.Any], bool]] = None, key_fn: ~typing.Callable[[~typing.Any], str] = <function <lambda>>) Dict[str, Any][source]

Builds a lookup dictionary based on a list of strings of class names.

Parameters:
  • current_module_name (str) – the module from where the classes are available

  • class_strings (List[str]) – the list of strings

  • filter_by_superclass (Any) – if filter should be based on a common super class

  • filter_fn (Callable[[Any], bool]) – a custom filter function

  • key_fn (Callable[[Any], str]) – a function that provides a mapping from Class to the desired key

Returns:

the lookup dictionary

Return type:

Dict[str, Any]