Qiskit / documentation

The documentation content home for https://docs.quantum.ibm.com.
https://docs.quantum.ibm.com
Apache License 2.0
38 stars 81 forks source link

Sphinx template for no inheritance can set missing rubric #2329

Open Eric-Arellano opened 4 hours ago

Eric-Arellano commented 4 hours ago

From https://github.com/Qiskit/documentation/pull/2328, we have some pages like this:

Image

This happens because of this config

{% block attributes_summary %}
  {% if attributes %}
   .. rubric:: Attributes
    {% for item in attributes %}
      {%- if item not in inherited_members %}
   .. autoattribute:: {{ item }}
      {%- endif -%}
    {%- endfor %}
  {% endif %}
{% endblock -%}

We set if attributes, but it is checking any attributes rather than only inherited attributes. We need to only set .. rubric:: Attributes if there are inherited members.

This fix belongs in the Sphinx template in qiskit-addon-mpf. Also update Qiskit SDK, which is the only other repo with this template.

Eric-Arellano commented 3 hours ago

Fixed by https://github.com/Qiskit/qiskit-addon-mpf/pull/33/commits/9e5bf5591e39dc2d2af94d50478e1513f154eeca. I want to apply this change to Qiskit SDK before closing this.

I also want to ensure Qiskit SDK, qiskit-ibm-runtime, and qiskit-ibm-transpiler are using the Sphinx improvements made to the addons with the below

autodoc_default_options = {
    "inherited-members": None,
}
autodoc_typehints_description_target = "all"