From 1a3d09827075e61b06d2481bce24c2acbd6a812a Mon Sep 17 00:00:00 2001 From: Bill Little Date: Mon, 1 Aug 2022 15:16:12 +0100 Subject: [PATCH 1/2] fix sphinx-gallery --- docs/src/conf.py | 5 +++++ requirements/ci/py310.yml | 2 +- requirements/ci/py38.yml | 2 +- requirements/ci/py39.yml | 2 +- setup.cfg | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/src/conf.py b/docs/src/conf.py index 6b11e83a8c..082d7eb384 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -368,6 +368,11 @@ def _dotv(version): "ignore_pattern": r"__init__\.py", # force gallery building, unless overridden (see src/Makefile) "plot_gallery": "'True'", + # force re-registering of nc-time-axis with matplotlib for each example, + # required for sphinx-gallery>=0.11.0 + "reset_modules": ( + lambda gallery_conf, fname: sys.modules.pop("nc_time_axis", None), + ), } # ----------------------------------------------------------------------------- diff --git a/requirements/ci/py310.yml b/requirements/ci/py310.yml index 19d4e90c22..5ba9988c92 100644 --- a/requirements/ci/py310.yml +++ b/requirements/ci/py310.yml @@ -45,6 +45,6 @@ dependencies: - sphinx - sphinxcontrib-napoleon - sphinx-copybutton - - sphinx-gallery + - sphinx-gallery >=0.11.0 - sphinx-panels - pydata-sphinx-theme = 0.8.1 diff --git a/requirements/ci/py38.yml b/requirements/ci/py38.yml index 55a64676bf..016a986d9f 100644 --- a/requirements/ci/py38.yml +++ b/requirements/ci/py38.yml @@ -45,6 +45,6 @@ dependencies: - sphinx - sphinxcontrib-napoleon - sphinx-copybutton - - sphinx-gallery + - sphinx-gallery >=0.11.0 - sphinx-panels - pydata-sphinx-theme = 0.8.1 diff --git a/requirements/ci/py39.yml b/requirements/ci/py39.yml index abd11e48a2..171d2a88e3 100644 --- a/requirements/ci/py39.yml +++ b/requirements/ci/py39.yml @@ -45,6 +45,6 @@ dependencies: - sphinx - sphinxcontrib-napoleon - sphinx-copybutton - - sphinx-gallery + - sphinx-gallery >=0.11.0 - sphinx-panels - pydata-sphinx-theme = 0.8.1 diff --git a/setup.cfg b/setup.cfg index a60d107835..2fe615e72a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -68,7 +68,7 @@ where = lib docs = sphinx sphinx-copybutton - sphinx-gallery + sphinx-gallery>=0.11.0 sphinx_rtd_theme sphinxcontrib-napoleon sphinx-panels From 4b8f7a0bcc4cf5801ae4a8b807ef45c2663c8984 Mon Sep 17 00:00:00 2001 From: Bill Little Date: Mon, 1 Aug 2022 15:51:04 +0100 Subject: [PATCH 2/2] change gallery index reference --- docs/src/developers_guide/contributing_documentation_full.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/developers_guide/contributing_documentation_full.rst b/docs/src/developers_guide/contributing_documentation_full.rst index 46f9c563d1..a98ff0a7e9 100755 --- a/docs/src/developers_guide/contributing_documentation_full.rst +++ b/docs/src/developers_guide/contributing_documentation_full.rst @@ -147,7 +147,7 @@ can exclude the module from the API documentation. Add the entry to the Gallery ~~~~~~~ -The Iris :ref:`sphx_glr_generated_gallery` uses a sphinx extension named +The Iris :ref:`gallery_index` uses a sphinx extension named `sphinx-gallery `_ that auto generates reStructuredText (rst) files based upon a gallery source directory that abides directory and filename convention.