Skip to content

Commit

Permalink
Merge pull request #604 from voxel51/release/v0.12.1
Browse files Browse the repository at this point in the history
Release/v0.12.1
  • Loading branch information
benjaminpkane authored Dec 19, 2023
2 parents a198897 + 21d7c7c commit 1d703d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion eta/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ def get_function_name(fcn):
the fully-qualified function name string, such as
"eta.core.utils.function_name"
"""
if inspect.ismethod(fcn):
return fcn.__module__ + "." + fcn.__qualname__

return fcn.__module__ + "." + fcn.__name__


Expand Down Expand Up @@ -605,7 +608,16 @@ def get_function(function_name, module_name=None):
Raises:
ImportError: if the function could not be imported
"""
return get_class(function_name, module_name=module_name)
try:
return get_class(function_name, module_name=module_name)
except Exception as e:
try:
# try treating as a class method
class_name, function_name = function_name.rsplit(".", 1)
cls = get_class(class_name, module_name=module_name)
return getattr(cls, function_name)
except:
raise e


def install_package(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from wheel.bdist_wheel import bdist_wheel


VERSION = "0.12.0"
VERSION = "0.12.1"


class BdistWheelCustom(bdist_wheel):
Expand Down

0 comments on commit 1d703d9

Please sign in to comment.