Skip to content

Add __call__ to Sphinx API docs - #2135

Merged
astrofrog merged 1 commit into
astropy:masterfrom
cdeil:issue_1817
Mar 3, 2014
Merged

astrofrog merged 1 commit into
astropy:masterfrom
cdeil:issue_1817

Conversation

@cdeil

@cdeil cdeil commented Feb 26, 2014

Copy link
Copy Markdown
Member

This PR fixes #1817.

@astrofrog

Copy link
Copy Markdown
Member

cc @eteq @nden

@nden

nden commented Feb 26, 2014

Copy link
Copy Markdown
Contributor

I tried figuring this out a year ago and gave up so I'm glad to see this working! 👍 to merging and having this work for all __call__ methods.

Comment thread astropy/sphinx/ext/automodsumm.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right somehow - it's going to ignore ns['methods'] from the previous line. Would:

ns['methods'], ns['all_methods'] = get_members_class(obj, 'method', ['__init__', '__call__'])

not work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this (by amending my previous commit) ... it doesn't seem to change the generated html though as far as I can see?!

@cdeil

cdeil commented Feb 26, 2014

Copy link
Copy Markdown
Member Author

@astrofrog You can find the html version corresponding to the latest d893d79
here if you don't want to generate it locally.

@eteq

eteq commented Feb 27, 2014

Copy link
Copy Markdown
Member

Nice @cdeil ! Last time I tried to fix this, I spent a bunch of timing delving through the templates... But I now realize from your patch that was totally the wrong place to look.

Can you add an entry to the change log, @cdeil ? Once you've done that I think this is good to go.

cdeil added a commit to cdeil/astropy that referenced this pull request Feb 27, 2014
@cdeil

cdeil commented Feb 27, 2014

Copy link
Copy Markdown
Member Author

@eteq It was @astrofrog that figured this out ... I just tried out his suggestions and it works.

I've added an entry to the change log.

@astrofrog

Copy link
Copy Markdown
Member

@cdeil - I think this needs to be rebased. Also while you do that, could you fix the second commit message to say __call__ instead of __init__?

@eteq

eteq commented Feb 27, 2014

Copy link
Copy Markdown
Member

Ah, well, then nice job @astrofrog , and nice job @cdeil for implementing it 😃

@cdeil

cdeil commented Feb 27, 2014

Copy link
Copy Markdown
Member Author

@astrofrog Rebased and second commit squashed.

@eteq

eteq commented Feb 27, 2014

Copy link
Copy Markdown
Member

Looks good to me - @astrofrog, good to merge?

@cdeil

cdeil commented Mar 2, 2014

Copy link
Copy Markdown
Member Author

@astrofrog Is this OK or should I rebase again?

@astrofrog

Copy link
Copy Markdown
Member

Looks good!

astrofrog added a commit that referenced this pull request Mar 3, 2014
Add __call__ to Sphinx API docs
@astrofrog
astrofrog merged commit 468fc24 into astropy:master Mar 3, 2014
@embray embray added this to the v0.4.0 milestone Mar 4, 2014
astrofrog added a commit to astropy/sphinx-automodapi that referenced this pull request Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

astropy autodoc templates should document __call__ method

5 participants