Skip to content

autosummary: Add an option to skip inherited members #4029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

niboshi
Copy link

@niboshi niboshi commented Aug 28, 2017

Add an option to control whether inherited members are included.

Feature or Bugfix

  • Feature

Purpose

Currently autosummary generates documents for inherited members as well.
This PR adds an option to control it.

Detail

  • autosummary_inherited_members = 'all': document all members regardless of inheritance (default)
  • autosummary_inherited_members = 'overridden': document overridden and new members
  • autosummary_inherited_members = 'none': document only new members

Relates

@tk0miya
Copy link
Member

tk0miya commented Aug 28, 2017

What is difference from :inherited-members: option?

@tk0miya tk0miya added this to the 1.7 milestone Aug 28, 2017
@niboshi
Copy link
Author

niboshi commented Aug 29, 2017

Autosummary documents all members by default.
It does not check :inherited-members:, and I think autosummary doesn't have access to it.

@tk0miya
Copy link
Member

tk0miya commented Sep 4, 2017

Ah, you're right. Indeed, autosummary does not have such option.

@shimizukawa could you review this please?

In addition, it seems there are no testcases. could you add them?

@tk0miya tk0miya requested a review from shimizukawa September 4, 2017 13:41
Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@stephenfin stephenfin left a comment

Choose a reason for hiding this comment

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

Needs a mypy fix to fix the build

def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
warn=_simple_warn, info=_simple_info,
base_path=None, builder=None, template_dir=None,
imported_members=False):
imported_members=False, inherited_members=None):
# type: (List[unicode], unicode, unicode, Callable, Callable, unicode, Builder, unicode, bool) -> None # NOQA
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is the cause of your Travis CI build failure. I imagine you need to add unicode to the first tuple, like so:

# type: (List[unicode], unicode, unicode, Callable, Callable, unicode, Builder, unicode, bool, unicode)

@tk0miya
Copy link
Member

tk0miya commented Jan 13, 2018

Any updates? In this weekend, we call feature freeze for 1.7.
Can you work for this? It seems there are some remaining work:

  • adding test cases
  • fix type hints
  • fix conflicts

I feel this is good enhancement. so I'd like to introduce if possible.
Thanks,

@tk0miya tk0miya modified the milestones: 1.7, 1.8 Jan 14, 2018
@tk0miya
Copy link
Member

tk0miya commented Jul 29, 2018

Any updates? The feature freeze of 1.8 will come soon.

@tk0miya tk0miya modified the milestones: 1.8.0, 2.0 Aug 18, 2018
@tk0miya tk0miya modified the milestones: 2.0.0, 2.1.0 Feb 15, 2019
@tk0miya tk0miya modified the milestones: 2.1.0, 2.2.0 Jun 1, 2019
@tk0miya tk0miya modified the milestones: 2.2.0, 2.3.0 Aug 18, 2019
@tk0miya tk0miya modified the milestones: 2.3.0, 2.4.0 Dec 14, 2019
@tk0miya tk0miya modified the milestones: 2.4.0, 3.0.0 Feb 7, 2020
@tk0miya tk0miya removed this from the 3.0.0 milestone Mar 14, 2020
@tk0miya tk0miya added this to the 3.1.0 milestone Mar 14, 2020
@tk0miya tk0miya modified the milestones: 3.1.0, 3.2.0 May 23, 2020
@tk0miya tk0miya modified the milestones: 3.2.0, 3.3.0 Aug 2, 2020
@tk0miya tk0miya modified the milestones: 3.3.0, 3.4.0 Oct 27, 2020
@tk0miya tk0miya modified the milestones: 3.4.0, 4.0.0 Dec 19, 2020
@mhostetter
Copy link

Any update on this? I'm running into the same desire as @niboshi. I'd like for the autosummary Methods/Attributes tables to have an inheritance option.

@tk0miya tk0miya modified the milestones: 4.0.0, 4.1.0 Mar 27, 2021
@tk0miya tk0miya modified the milestones: 4.1.0, 4.2.0 Jul 10, 2021
@tk0miya tk0miya modified the milestones: 4.2.0, 4.3.0 Sep 12, 2021
@tk0miya tk0miya modified the milestones: 4.3.0, 4.4.0 Nov 8, 2021
@tk0miya tk0miya modified the milestones: 4.4.0, 4.5.0 Jan 15, 2022
@tk0miya tk0miya modified the milestones: 4.5.0, 5.0.0 Mar 27, 2022
@tk0miya tk0miya modified the milestones: 5.0.0, 5.x May 2, 2022
@AA-Turner AA-Turner modified the milestones: 5.x, some future version May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants