importing#

Methods for importing things from modules based on their name.

hsr4hci.importing.get_member_by_name(module_name, member_name)[source]#

Take the name of a module (e.g., sklearn.linear_model) and the name of a member (e.g., a class or a function from that module; e.g., Ridge) as the inputs, and try to import said member from the given module. If no such member exists in the module, an AttributeError is raised.

Parameters:
  • module_name (str) โ€“ Name of the module from which to import.

  • member_name (str) โ€“ Name of the member to import.

Returns:

The specified module member, which can be virtually anything, that is, a variable, a function, a class, and so on.

Return type:

Any