Closed
Description
Is your feature request related to a problem? Please describe.
Originally posted by @ericspod in #6181 (review):
I see you're using pydoc.locate
and I wonder if we should have our own function in monai.utils.module
for doing this. This is a topic for some other time and place but I had used something like this in the past that worked well enough:
def find_type_def(qualified_name: str):
if "." not in qualified_name:
modname, defname = "builtins", qualified_name
else:
modname, defname = qualified_name.rsplit(".", 1)
mod = __import__(modname)
return getattr(mod, defname)