From eb677ae701f6c65b413d1c20aad7c5c8597d14d7 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Date: Thu, 19 Dec 2024 02:08:06 -0600 Subject: [PATCH] Add alt text to relevant images (#45) (cherry picked from commit 0208caeb80835dbc07c0bccf9e20e1829051bfe4) --- qiskit_addon_obp/utils/visualization.py | 8 ++++++++ tox.ini | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/qiskit_addon_obp/utils/visualization.py b/qiskit_addon_obp/utils/visualization.py index 84af7d3..cdc326b 100644 --- a/qiskit_addon_obp/utils/visualization.py +++ b/qiskit_addon_obp/utils/visualization.py @@ -29,6 +29,7 @@ def plot_accumulated_error(metadata: OBPMetadata, axes: Axes) -> None: which exists within our context. .. plot:: + :alt: Output from the previous code. :context: :nofigs: @@ -36,6 +37,7 @@ def plot_accumulated_error(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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/tox.ini b/tox.ini index f4dcff8..8fb92c2 100644 --- a/tox.ini +++ b/tox.ini @@ -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 = @@ -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