-
Notifications
You must be signed in to change notification settings - Fork 127
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
Move methods into class pages for docs #1290
Merged
coruscating
merged 10 commits into
qiskit-community:main
from
arnaucasau:no-method-pages
Nov 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9f14926
Move methods into class pages for docs
arnaucasau a8b85be
More templates modified
arnaucasau 620c912
Recover count logic
arnaucasau 908f692
Merge branch 'main' into no-method-pages
arnaucasau a722d8b
Pre-process attributes and methods
arnaucasau af27c21
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
arnaucasau fa8ef7e
Merge branch 'Qiskit-Extensions:main' into no-method-pages
arnaucasau 71c328c
Merge branch 'no-method-pages' of https://github.com/arnaucasau/qiski…
arnaucasau 3baf342
Merge branch 'main' into no-method-pages
arnaucasau 339e6c5
Merge branch 'main' into no-method-pages
arnaucasau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/_templates/autosummary/class_no_inherited_members.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{# This is identical to class.rst, except for the filtering of the inherited_members. -#} | ||
|
||
{% if referencefile %} | ||
.. include:: {{ referencefile }} | ||
{% endif %} | ||
|
||
{{ objname }} | ||
{{ underline }} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
:show-inheritance: | ||
|
||
{% block attributes_summary %} | ||
{% if attributes %} | ||
.. rubric:: Attributes | ||
{% for item in all_attributes %} | ||
{%- if not item.startswith('_') %} | ||
.. autoattribute:: {{ name }}.{{ item }} | ||
{%- endif -%} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block methods_summary %} | ||
{% if methods %} | ||
.. rubric:: Methods | ||
{% for item in all_methods %} | ||
{%- if item not in inherited_members %} | ||
{%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %} | ||
.. automethod:: {{ name }}.{{ item }} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor %} | ||
|
||
{% endif %} | ||
{% endblock %} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? With my original PR, I was too eager in copying over exactly what Qiskit did. You did a better job in your PRs for other repos with making the minimum change necessary to get methods on class pages. It might be possible to get this diff more focused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Eric-Arellano! You are right, I was using another template and I let the show-inheritance by error. It's fixed now. This file changes a lot because I removed the counter logic following your PR. Do you think I should add it again? As you can see, in the other templates I made now the minimum changes possible =)