Skip to content

Stop using jupyter-sphinx extension in docs builds#9346

Merged
mergify[bot] merged 6 commits intoQiskit:mainfrom
mtreinish:no-more-jupyter-sphinx
Jan 6, 2023
Merged

Stop using jupyter-sphinx extension in docs builds#9346
mergify[bot] merged 6 commits intoQiskit:mainfrom
mtreinish:no-more-jupyter-sphinx

Conversation

@mtreinish
Copy link
Copy Markdown
Member

Summary

The use of the jupyter-sphinx plugin has been increasingly unreliable over time. While convinient to use jupyter to print the code and rendered output in practice this extension is exceedingly fragile. The nature of how the plugin launches jupyter kernels and executes code causes it to be prone to failure and weird issues. A race condition in this machinery is causing a high non-deterministic failure rate in CI right now preventing us from reliably building documentation. This commit removes the use of the jupyter-sphinx extension from the documentation. For the most part a drop-in replacement is the plot directive from matplotlib that enables executing code and visualizing the result as part of the documentation build. But it does this more simply through exec() which will be much more reliable. In many of the cases jupyter-execute wasn't even needed because no output was shown in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where necessary but for historical release notes all jupyter-execute directives are converted to code-blocks. This was done for sanity to avoid having to manually update hundreds of release notes over the past 3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the extension which was unreliable in a parallel context. Doing this can greatly speed up documentation builds (although the impact in CI will be limited as we only have 2 vCPUs in the CI workers).

Details and comments

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).
@qiskit-bot
Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

@mtreinish mtreinish added documentation Something is not clear or an error documentation Changelog: None Do not include in the GitHub Release changelog. labels Jan 5, 2023
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 5, 2023

Pull Request Test Coverage Report for Build 3855962119

  • 2 of 17 (11.76%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 84.537%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/gate_map.py 2 3 66.67%
qiskit/tools/jupyter/library.py 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit/tools/jupyter/library.py 1 0%
qiskit/visualization/counts_visualization.py 1 79.87%
Totals Coverage Status
Change from base Build 3855353443: -0.05%
Covered Lines: 64006
Relevant Lines: 75714

💛 - Coveralls

Copy link
Copy Markdown
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comments aside, I guess we need to get this in. I'm glad to see the back of jupyter-sphinx in the end. It really has caused a lot of problems, though it isn't ideal that we're losing a lot of the soft doctesting that we had before.

Comment thread qiskit/tools/jupyter/library.py Outdated
Comment thread qiskit/pulse/builder.py

# TODO: This example should use a real mock backend.
backend = FakeOpenPulse3Q()
# TODO: This example should use a real mock backend.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Comment thread qiskit/pulse/builder.py
Comment on lines 2124 to 2284

.. jupyter-execute::
.. code-block::

import math

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code block continues on to use pulse which isn't defined in the block - it was notionally defined in a separate Jupyter kernel a couple of code-blocks above. I think that's probably fine, since the display is the same as it was before, and there's no output for users to copy/paste to see anyway, I'm just mentioning it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did this on purpose because this section of the docs read more like a notebook to me and since we're not actually executing anything I left it as is so the rendering was the same.

Comment thread qiskit/quantum_info/states/statevector.py
Comment thread qiskit/transpiler/__init__.py Outdated
Copy link
Copy Markdown
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! At some point we'll want to propagate the changes in the requirements up to the metapackage, but at the moment IBMQ still uses jupyter-execute a lot. I think that if we're lucky, we should still be able to build with that in place, and we can remove it once IBMQ is completely removed from the metapackage.

@mergify mergify Bot merged commit 95a97ec into Qiskit:main Jan 6, 2023
@mtreinish mtreinish deleted the no-more-jupyter-sphinx branch January 6, 2023 16:32
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Jan 6, 2023
With the recent merge of Qiskit#9346 that stopped using the problematic
jupyter-sphinx plugin we're no long blocked from running sphinx-build in
parallel anymore. We had originally enabled this in Qiskit#4477 to get a speed
boost during docs builds. However, we were forced to revert that in Qiskit#6539
because jupyter-sphinx was unreliable and had a race condition when 2
jupyter-execute blocks were run at the same time (see Qiskit#5904 for more
details). Since we've removed the jupyter-sphinx usage that is no longer
a problem and we can reliably run parallel sphinx builds again. This
commit makes that change and changes the default sphinx-build behavior
when run via tox (as is done via ci) to use all available system cores
to perform a sphinx build. Annecdoteally this provides a nice speed up,
on my local workstation a full docs build went from taking 8min 42
seconds for a serial build to 2min 35sec with a parallel build.
mergify Bot added a commit that referenced this pull request Jan 6, 2023
With the recent merge of #9346 that stopped using the problematic
jupyter-sphinx plugin we're no long blocked from running sphinx-build in
parallel anymore. We had originally enabled this in #4477 to get a speed
boost during docs builds. However, we were forced to revert that in #6539
because jupyter-sphinx was unreliable and had a race condition when 2
jupyter-execute blocks were run at the same time (see #5904 for more
details). Since we've removed the jupyter-sphinx usage that is no longer
a problem and we can reliably run parallel sphinx builds again. This
commit makes that change and changes the default sphinx-build behavior
when run via tox (as is done via ci) to use all available system cores
to perform a sphinx build. Annecdoteally this provides a nice speed up,
on my local workstation a full docs build went from taking 8min 42
seconds for a serial build to 2min 35sec with a parallel build.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request Jan 11, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request Jan 11, 2023
With the recent merge of Qiskit#9346 that stopped using the problematic
jupyter-sphinx plugin we're no long blocked from running sphinx-build in
parallel anymore. We had originally enabled this in Qiskit#4477 to get a speed
boost during docs builds. However, we were forced to revert that in Qiskit#6539
because jupyter-sphinx was unreliable and had a race condition when 2
jupyter-execute blocks were run at the same time (see Qiskit#5904 for more
details). Since we've removed the jupyter-sphinx usage that is no longer
a problem and we can reliably run parallel sphinx builds again. This
commit makes that change and changes the default sphinx-build behavior
when run via tox (as is done via ci) to use all available system cores
to perform a sphinx build. Annecdoteally this provides a nice speed up,
on my local workstation a full docs build went from taking 8min 42
seconds for a serial build to 2min 35sec with a parallel build.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Cryoris pushed a commit to Cryoris/qiskit-terra that referenced this pull request Jan 12, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
Cryoris pushed a commit to Cryoris/qiskit-terra that referenced this pull request Jan 12, 2023
With the recent merge of Qiskit#9346 that stopped using the problematic
jupyter-sphinx plugin we're no long blocked from running sphinx-build in
parallel anymore. We had originally enabled this in Qiskit#4477 to get a speed
boost during docs builds. However, we were forced to revert that in Qiskit#6539
because jupyter-sphinx was unreliable and had a race condition when 2
jupyter-execute blocks were run at the same time (see Qiskit#5904 for more
details). Since we've removed the jupyter-sphinx usage that is no longer
a problem and we can reliably run parallel sphinx builds again. This
commit makes that change and changes the default sphinx-build behavior
when run via tox (as is done via ci) to use all available system cores
to perform a sphinx build. Annecdoteally this provides a nice speed up,
on my local workstation a full docs build went from taking 8min 42
seconds for a serial build to 2min 35sec with a parallel build.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mrossinek added a commit to mrossinek/qiskit-nature that referenced this pull request Feb 6, 2023
The Jupyter Sphinx integration is currently unable to properly suppress
warnings resulting in prints to stderr [1]. This causes the docs to fail
building properly.
Qiskit Terra already removed the usage of `jupyter-execute` statements a
while ago [2], so we are following suit in this regard, too.

[1]: jupyter/jupyter-sphinx#178
[2]: Qiskit/qiskit#9346
mrossinek added a commit to mrossinek/qiskit-nature that referenced this pull request Feb 6, 2023
The Jupyter Sphinx integration is currently unable to properly suppress
warnings resulting in prints to stderr [1]. This causes the docs to fail
building properly.
Qiskit Terra already removed the usage of `jupyter-execute` statements a
while ago [2], so we are following suit in this regard, too.

[1]: jupyter/jupyter-sphinx#178
[2]: Qiskit/qiskit#9346
mrossinek added a commit to mrossinek/qiskit-nature that referenced this pull request Feb 7, 2023
The Jupyter Sphinx integration is currently unable to properly suppress
warnings resulting in prints to stderr [1]. This causes the docs to fail
building properly.
Qiskit Terra already removed the usage of `jupyter-execute` statements a
while ago [2], so we are following suit in this regard, too.

[1]: jupyter/jupyter-sphinx#178
[2]: Qiskit/qiskit#9346
mrossinek added a commit to mrossinek/qiskit-nature that referenced this pull request Feb 9, 2023
The Jupyter Sphinx integration is currently unable to properly suppress
warnings resulting in prints to stderr [1]. This causes the docs to fail
building properly.
Qiskit Terra already removed the usage of `jupyter-execute` statements a
while ago [2], so we are following suit in this regard, too.

[1]: jupyter/jupyter-sphinx#178
[2]: Qiskit/qiskit#9346
mergify Bot added a commit to qiskit-community/qiskit-nature that referenced this pull request Feb 10, 2023
* Implement the Tensor class

* Always wrap scalar numbers into numpy array

This matches what we did in the PolynomialTensor and avoids unnecessary
complicated code to deal with Number objects where otherwise one always
encounters an array.

* Add qiskit_nature.settings.tensor_wrapping

* Add release note

* fix: remove jupyter-execute blocks

The Jupyter Sphinx integration is currently unable to properly suppress
warnings resulting in prints to stderr [1]. This causes the docs to fail
building properly.
Qiskit Terra already removed the usage of `jupyter-execute` statements a
while ago [2], so we are following suit in this regard, too.

[1]: jupyter/jupyter-sphinx#178
[2]: Qiskit/qiskit#9346

* fix: rework settings.tensor_wrapping as settings.tensor_unwrapping

* docs: update documentaiton of PolynomialTensor now that Tensor exists

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Apr 11, 2023
This has not been used since the switch away from using
`jupyter-execute` in Qiskitgh-9346, so is neither maintained nor necessary.
Any improvements to styling should be made to the new paths, not to
these.  These objects were originally intended only for the
documentation so we expect user impact to be minimal, and the objects
are not maintained anyway.
mtreinish pushed a commit that referenced this pull request May 12, 2023
* Deprecate circuit-library Jupyter magic

This has not been used since the switch away from using
`jupyter-execute` in gh-9346, so is neither maintained nor necessary.
Any improvements to styling should be made to the new paths, not to
these.  These objects were originally intended only for the
documentation so we expect user impact to be minimal, and the objects
are not maintained anyway.

* Correct versions for deprecation

* Add missing import
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
* Deprecate circuit-library Jupyter magic

This has not been used since the switch away from using
`jupyter-execute` in Qiskitgh-9346, so is neither maintained nor necessary.
Any improvements to styling should be made to the new paths, not to
these.  These objects were originally intended only for the
documentation so we expect user impact to be minimal, and the objects
are not maintained anyway.

* Correct versions for deprecation

* Add missing import
Anthony-Gandon pushed a commit to Anthony-Gandon/qiskit-nature that referenced this pull request May 25, 2023
* Implement the Tensor class

* Always wrap scalar numbers into numpy array

This matches what we did in the PolynomialTensor and avoids unnecessary
complicated code to deal with Number objects where otherwise one always
encounters an array.

* Add qiskit_nature.settings.tensor_wrapping

* Add release note

* fix: remove jupyter-execute blocks

The Jupyter Sphinx integration is currently unable to properly suppress
warnings resulting in prints to stderr [1]. This causes the docs to fail
building properly.
Qiskit Terra already removed the usage of `jupyter-execute` statements a
while ago [2], so we are following suit in this regard, too.

[1]: jupyter/jupyter-sphinx#178
[2]: Qiskit/qiskit#9346

* fix: rework settings.tensor_wrapping as settings.tensor_unwrapping

* docs: update documentaiton of PolynomialTensor now that Tensor exists

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
ElePT pushed a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
ElePT pushed a commit to ElePT/qiskit-ibm-provider that referenced this pull request Oct 4, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
ElePT pushed a commit to ElePT/qiskit-ibm-runtime that referenced this pull request Oct 10, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Oct 12, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
ElePT pushed a commit to ElePT/qiskit-ibm-runtime that referenced this pull request Dec 8, 2023
* Stop using jupyter-sphinx extension in docs builds

The use of the jupyter-sphinx plugin has been increasingly unreliable
over time. While convinient to use jupyter to print the code and
rendered output in practice this extension is exceedingly fragile. The
nature of how the plugin launches jupyter kernels and executes code
causes it to be prone to failure and weird issues. A race condition in
this machinery is causing a high non-deterministic failure rate in CI
right now preventing us from reliably building documentation. This
commit removes the use of the jupyter-sphinx extension from the
documentation. For the most part a drop-in replacement is the ``plot``
directive from matplotlib that enables executing code and visualizing
the result as part of the documentation build. But it does this more
simply through ``exec()`` which will be much more reliable. In many of
the cases jupyter-execute wasn't even needed because no output was shown
in those cases a simple code-block is used instead.

For release notes, new release notes are updated to use plot where
necessary but for historical release notes all jupyter-execute
directives are converted to code-blocks. This was done for sanity to
avoid having to manually update hundreds of release notes over the past
3 years.

This also enables us to enable parallel builds as jupyter-sphinx was the
extension which was unreliable in a parallel context. Doing this can
greatly speed up documentation builds (although the impact in CI will be
limited as we only have 2 vCPUs in the CI workers).

* Fix tests and lint

* Revert accidental change to tox.ini

* Fix capitalization of GHZ circuit

* Cleanup circuit library visualization function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: None Do not include in the GitHub Release changelog. documentation Something is not clear or an error documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants