Skip to content

Commit bc6b9fe

Browse files
committed
Add __call__ to Sphinx API docs (fixes astropy#1817)
1 parent a4d082e commit bc6b9fe

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎CHANGES.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ New Features
6464
- Reference documentation now shows functions/class docstrings at the
6565
inteded user-facing API location rather than the actual file where
6666
the implementation is found. [#1826]
67+
- The `automodsumm` extension configuration was changed to generate
68+
documentation of class `__call__` member functions. [#1817, #2135]
6769

6870
- ``astropy.table``
6971

‎astropy/sphinx/ext/automodsumm.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,10 @@ def get_members_class(obj, typ, include_public=[],
476476
ns['exceptions'], ns['all_exceptions'] = \
477477
get_members_mod(obj, 'exception')
478478
elif doc.objtype == 'class':
479+
api_class_methods = ['__init__', '__call__']
479480
ns['members'] = get_members_class(obj, None)
480481
ns['methods'], ns['all_methods'] = \
481-
get_members_class(obj, 'method', ['__init__'])
482+
get_members_class(obj, 'method', api_class_methods)
482483
ns['attributes'], ns['all_attributes'] = \
483484
get_members_class(obj, 'attribute')
484485
ns['methods'].sort()

0 commit comments

Comments
 (0)