Skip to content

Commit

Permalink
Make sig less selfish
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Feb 12, 2025
1 parent 2b25f97 commit cdfd69b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,12 @@ def __init__(self, app, tray_instance=False, **kwargs):
def get_api_text(name, obj):
if type(obj).__name__ == 'method':
if hasattr(obj, "__wrapped__"):
return f"{name}{inspect.signature(obj.__wrapped__)}"
orig_sig = str(inspect.signature(obj.__wrapped__))
if "(self)" in orig_sig:
orig_sig = orig_sig.replace("(self)", "()")
elif "(self, " in orig_sig:
orig_sig = orig_sig.replace("(self, ", "(")
return f"{name}{orig_sig}"
return f"{name}{inspect.signature(obj)}"
return name
with warnings.catch_warnings():
Expand Down

0 comments on commit cdfd69b

Please sign in to comment.