Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Methods live on class pages (#789) (#790)
Browse files Browse the repository at this point in the history
Currently, methods live on dedicated HTML pages rather than their class pages. 

But in qiskit/documentation, we merge those methods to live on the class page because it's a better user experience. While we do have code to do that, it's simpler to change Provider's config to have Sphinx do the right thing from the start.

This template is copied from qiskit-ibm-runtime.
  • Loading branch information
Eric-Arellano committed Jan 12, 2024
1 parent 381cd2c commit 37d0814
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
33 changes: 10 additions & 23 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,25 @@
:no-inherited-members:
:no-special-members:

{% block attributes_summary %}
{% block attributes_summary %}
{% if attributes %}

.. rubric:: Attributes

.. autosummary::
:toctree: ../stubs/
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
.. autoattribute:: {{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}
{% endblock %}

{% block methods_summary %}
{% block methods_summary %}
{% if methods %}

.. rubric:: Methods

.. autosummary::
:toctree: ../stubs/
{% for item in all_methods %}
{%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% for item in inherited_members %}
{%- if item in ['__call__', '__mul__', '__getitem__', '__len__'] %}
{{ name }}.{{ item }}
.. automethod:: {{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}

{% endif %}
{% endblock %}
{% endblock %}
6 changes: 3 additions & 3 deletions qiskit_ibm_provider/ibm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def properties(
The schema for backend properties can be found in
`Qiskit/ibm-quantum-schemas
<https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_properties_schema.json>`_.
<https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_properties_schema.json>`__.
Args:
refresh: If ``True``, re-query the server for the backend properties.
Expand Down Expand Up @@ -665,7 +665,7 @@ def defaults(self, refresh: bool = False) -> Optional[PulseDefaults]:
The schema for default pulse configuration can be found in
`Qiskit/ibm-quantum-schemas
<https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/default_pulse_configuration_schema.json>`_.
<https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/default_pulse_configuration_schema.json>`__.
Args:
refresh: If ``True``, re-query the server for the backend pulse defaults.
Expand Down Expand Up @@ -695,7 +695,7 @@ def configuration(
The schema for backend configuration can be found in
`Qiskit/ibm-quantum-schemas
<https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_configuration_schema.json>`_.
<https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_configuration_schema.json>`__.
Returns:
The configuration for the backend.
Expand Down

0 comments on commit 37d0814

Please sign in to comment.