Skip to content
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

Add alt text to relevant images (backport #45) #48

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions qiskit_addon_obp/utils/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ def plot_accumulated_error(metadata: OBPMetadata, axes: Axes) -> None:
which exists within our context.

.. plot::
:alt: Output from the previous code.
:context:
:nofigs:

>>> from qiskit_addon_obp.utils.metadata import OBPMetadata
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down Expand Up @@ -97,6 +99,7 @@ def plot_left_over_error_budget(metadata: OBPMetadata, axes: Axes) -> None:
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down Expand Up @@ -144,6 +147,7 @@ def plot_slice_errors(metadata: OBPMetadata, axes: Axes) -> None:
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down Expand Up @@ -198,6 +202,7 @@ def plot_num_paulis(metadata: OBPMetadata, axes: Axes) -> None:
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down Expand Up @@ -245,6 +250,7 @@ def plot_num_truncated_paulis(metadata: OBPMetadata, axes: Axes) -> None:
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down Expand Up @@ -299,6 +305,7 @@ def plot_sum_paulis(metadata: OBPMetadata, axes: Axes) -> None:
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down Expand Up @@ -355,6 +362,7 @@ def plot_num_qwc_groups(metadata: OBPMetadata, axes: Axes) -> None:
>>> metadata = OBPMetadata.from_json("docs/_static/dummy_visualization_metadata.json")

.. plot::
:alt: Output from the previous code.
:context: close-figs
:include-source:

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ commands =

[testenv:lint]
image-tester-commit = 7ae965ccf21c39e5170334ec7f4882756883860a
deps =
deps =
git+https://github.com/Qiskit/documentation.git@{[testenv:lint]image-tester-commit}\#egg=sphinx-alt-text-validator&subdirectory=scripts/image-tester
basepython = python3.10
extras =
Expand All @@ -34,7 +34,7 @@ commands =
nbqa ruff docs/
mypy qiskit_addon_obp/
pylint -rn qiskit_addon_obp/ test/
sphinx-alt-text-validator -f qiskit_addon_obp -s qiskit_addon_obp/utils/visualization.py
sphinx-alt-text-validator -f qiskit_addon_obp
nbqa pylint -rn docs/
typos
reno lint
Expand Down
Loading