From 16280205280d77d58cdb9b334710ab1eea88df25 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 18 Jun 2026 23:39:44 +0200 Subject: [PATCH 01/14] Exclude gallery files that start with NX_ --- docs/sphinx/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index defbb2cdd0..f76adfaa95 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -22,7 +22,6 @@ # import distutils before calling pd.show_versions() # https://github.com/pypa/setuptools/issues/3044 -import distutils # noqa: F401 import pandas as pd pd.show_versions() @@ -389,7 +388,7 @@ def setup(app): 'examples_dirs': ['../../examples'], # location of gallery scripts 'gallery_dirs': ['gallery'], # location of generated output # execute only files starting with plot_ - 'filename_pattern': 'plot_', + 'filename_pattern': r"^(?!NX_).*$", # directory where function/class granular galleries are stored 'backreferences_dir': 'reference/generated/gallery_backreferences', From d224073279edc94d2c69b2c437c629d510dfee05 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 18 Jun 2026 23:41:34 +0200 Subject: [PATCH 02/14] Rename oedi_9068.py example to NX_... to exclude from sphinx-gallery execution --- docs/examples/system-models/{oedi_9068.py => NX_oedi_9068.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/examples/system-models/{oedi_9068.py => NX_oedi_9068.py} (100%) diff --git a/docs/examples/system-models/oedi_9068.py b/docs/examples/system-models/NX_oedi_9068.py similarity index 100% rename from docs/examples/system-models/oedi_9068.py rename to docs/examples/system-models/NX_oedi_9068.py From 29fd64af0c1866a85e28bdc8ebed96ad47186787 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:07:29 +0200 Subject: [PATCH 03/14] Fix exclusion regex --- docs/sphinx/source/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index f76adfaa95..f1394886e3 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -387,8 +387,11 @@ def setup(app): sphinx_gallery_conf = { 'examples_dirs': ['../../examples'], # location of gallery scripts 'gallery_dirs': ['gallery'], # location of generated output - # execute only files starting with plot_ - 'filename_pattern': r"^(?!NX_).*$", + + # do not execute gallery examples that begin with NX_ + # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns + # left & center ensure only start of filename as remaining group to match by right operand + 'filename_pattern': "^.*" + os.path.sep + "((?!NX_).)*$", # directory where function/class granular galleries are stored 'backreferences_dir': 'reference/generated/gallery_backreferences', From bcb13a38e2cf794d64f732b52f25184953eeb998 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:16:57 +0200 Subject: [PATCH 04/14] =?UTF-8?q?=C2=BF=3F=20Add=20warning=20into=20oedi?= =?UTF-8?q?=20example=20just=20in=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/examples/system-models/NX_oedi_9068.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/examples/system-models/NX_oedi_9068.py b/docs/examples/system-models/NX_oedi_9068.py index 9a73bfa9ce..1ef51b6c5d 100644 --- a/docs/examples/system-models/NX_oedi_9068.py +++ b/docs/examples/system-models/NX_oedi_9068.py @@ -16,6 +16,12 @@ # 9068 `__. # For more information about the system, see its `OEDI # page `__. +# +# .. warning:: +# This example requires user-provided credentials to be run at step +# :ref:`Fetch weather data `. Therefore, it is not executed as part of +# documentation build process and it's more susceptible to API changes. +# Please, report any issues you may find. # sphinx_gallery_thumbnail_path = "_images/OEDI_9068_daily_timeseries.png" import pvlib @@ -132,6 +138,7 @@ # %% # Fetch weather data # ------------------ +# .. _fetch_weather_data: # # The system does have measured plane-of-array irradiance data, but the # measurements suffer from row-to-row shading and tracker stalls. In this From 6105d53a53877fa15f7696851c4c077693607f50 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:30:54 +0200 Subject: [PATCH 05/14] Comment editorial --- docs/sphinx/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index f1394886e3..fffc788d26 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -390,7 +390,7 @@ def setup(app): # do not execute gallery examples that begin with NX_ # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns - # left & center ensure only start of filename as remaining group to match by right operand + # left & center operands ensure only start of filename as remaining group to be matched by right operand 'filename_pattern': "^.*" + os.path.sep + "((?!NX_).)*$", # directory where function/class granular galleries are stored From 66c8386299b6368cb25c44f226c4446f24044289 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:42:00 +0200 Subject: [PATCH 06/14] Flake8 doing its thing. Once again. --- docs/sphinx/source/conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index fffc788d26..d40abbf817 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -389,8 +389,9 @@ def setup(app): 'gallery_dirs': ['gallery'], # location of generated output # do not execute gallery examples that begin with NX_ - # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns - # left & center operands ensure only start of filename as remaining group to be matched by right operand + # left & center operands ensure only start of filename + # is the remaining group to be matched by right operand + # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns # noqa: E501 'filename_pattern': "^.*" + os.path.sep + "((?!NX_).)*$", # directory where function/class granular galleries are stored From 7049fc0ff44389e492f3f2dfda19f67985685122 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:42:58 +0200 Subject: [PATCH 07/14] Flake8 x2 --- docs/examples/system-models/NX_oedi_9068.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/examples/system-models/NX_oedi_9068.py b/docs/examples/system-models/NX_oedi_9068.py index 1ef51b6c5d..eda20a2130 100644 --- a/docs/examples/system-models/NX_oedi_9068.py +++ b/docs/examples/system-models/NX_oedi_9068.py @@ -19,9 +19,9 @@ # # .. warning:: # This example requires user-provided credentials to be run at step -# :ref:`Fetch weather data `. Therefore, it is not executed as part of -# documentation build process and it's more susceptible to API changes. -# Please, report any issues you may find. +# :ref:`Fetch weather data `. Therefore, it is not +# executed as part of documentation build process and it's more +# susceptible to API changes. Please, report any issues you may find. # sphinx_gallery_thumbnail_path = "_images/OEDI_9068_daily_timeseries.png" import pvlib From 60ba786e4bf05b1c638ee9642e5559b0001581e0 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:44:09 +0200 Subject: [PATCH 08/14] Flake8 x3 --- docs/examples/system-models/NX_oedi_9068.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/system-models/NX_oedi_9068.py b/docs/examples/system-models/NX_oedi_9068.py index eda20a2130..f447c123da 100644 --- a/docs/examples/system-models/NX_oedi_9068.py +++ b/docs/examples/system-models/NX_oedi_9068.py @@ -13,7 +13,7 @@ # # The system has public monitoring data available at the Open Energy Data # Initiative (OEDI) under `System ID -# 9068 `__. +# 9068 `__. # noqa: E501 # For more information about the system, see its `OEDI # page `__. # From 636a12bef8298aa3b1a3c6c338e4d9ce53ecd4bc Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:46:51 +0200 Subject: [PATCH 09/14] Pin sphinx-gallery to 0.21 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f359cc846d..002ff1394f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ doc = [ 'matplotlib', 'sphinx == 7.3.7', 'pydata-sphinx-theme == 0.15.4', - 'sphinx-gallery', + 'sphinx-gallery == 0.21', 'docutils == 0.21', 'pillow', 'sphinx-toggleprompt == 0.5.2', From 6c9c0b76097f901d5ff25794a74aaab09bc91ef2 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:54:15 +0200 Subject: [PATCH 10/14] Add whatsnew entry --- docs/sphinx/source/whatsnew/v0.15.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.3.rst b/docs/sphinx/source/whatsnew/v0.15.3.rst index 87ded069ee..24c3f1eadf 100644 --- a/docs/sphinx/source/whatsnew/v0.15.3.rst +++ b/docs/sphinx/source/whatsnew/v0.15.3.rst @@ -38,7 +38,7 @@ Requirements Maintenance ~~~~~~~~~~~ - +* Fix some gallery examples not being run. Now, gallery example whose filename begins with ``NX_`` will be exclusively excluded. (:issue:`2790`, :pull:`2792`) Contributors ~~~~~~~~~~~~ From 55ba37543c3faad6495e137bea0dc462a96e3c91 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 02:05:31 +0200 Subject: [PATCH 11/14] One last ammend to regex --- docs/sphinx/source/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index d40abbf817..aabd2ac2fa 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -389,10 +389,9 @@ def setup(app): 'gallery_dirs': ['gallery'], # location of generated output # do not execute gallery examples that begin with NX_ - # left & center operands ensure only start of filename - # is the remaining group to be matched by right operand + # os.path.sep in negative lookahead ensures exclusive match of filename # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns # noqa: E501 - 'filename_pattern': "^.*" + os.path.sep + "((?!NX_).)*$", + 'filename_pattern': rf"^((?!{os.path.sep}NX_).)*$", # directory where function/class granular galleries are stored 'backreferences_dir': 'reference/generated/gallery_backreferences', From 06d35a6ed3d13d1eefbdd45e86ebb323b1fa2605 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 02:19:13 +0200 Subject: [PATCH 12/14] This is the last ammend to the regex 100% real don't doubt it --- docs/sphinx/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index aabd2ac2fa..bc0f2e85c7 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -384,6 +384,7 @@ def setup(app): suppress_warnings = ['ref.footnote'] # settings for sphinx-gallery +sep = os.path.sep sphinx_gallery_conf = { 'examples_dirs': ['../../examples'], # location of gallery scripts 'gallery_dirs': ['gallery'], # location of generated output @@ -391,7 +392,7 @@ def setup(app): # do not execute gallery examples that begin with NX_ # os.path.sep in negative lookahead ensures exclusive match of filename # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns # noqa: E501 - 'filename_pattern': rf"^((?!{os.path.sep}NX_).)*$", + 'filename_pattern': rf"^(?!{sep}.*?{sep})((?!{sep}NX_).)*$", # directory where function/class granular galleries are stored 'backreferences_dir': 'reference/generated/gallery_backreferences', From 89f17354652ab1f2900be8572e8ec070d957d7dc Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 02:30:15 +0200 Subject: [PATCH 13/14] Guess what. I'm updating the regex once again --- docs/sphinx/source/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index bc0f2e85c7..47306b2406 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -384,15 +384,15 @@ def setup(app): suppress_warnings = ['ref.footnote'] # settings for sphinx-gallery -sep = os.path.sep sphinx_gallery_conf = { 'examples_dirs': ['../../examples'], # location of gallery scripts 'gallery_dirs': ['gallery'], # location of generated output - # do not execute gallery examples that begin with NX_ - # os.path.sep in negative lookahead ensures exclusive match of filename + # do not execute gallery examples filenames that begin with NX_ + # first group + sep := match folders up to filename + # negative lookahead + match anything but sep := match filename (if valid) # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns # noqa: E501 - 'filename_pattern': rf"^(?!{sep}.*?{sep})((?!{sep}NX_).)*$", + 'filename_pattern': rf"^(.*){os.path.sep}(?!NX_)([^{os.path.sep}]*)$", # directory where function/class granular galleries are stored 'backreferences_dir': 'reference/generated/gallery_backreferences', From 3bad2f2ee1258d4fff5f1ba82b0a7b5d9c0607f8 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 19 Jun 2026 16:37:09 +0200 Subject: [PATCH 14/14] Minor edit to whatsnew --- docs/sphinx/source/whatsnew/v0.15.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.3.rst b/docs/sphinx/source/whatsnew/v0.15.3.rst index 24c3f1eadf..d46faf1c90 100644 --- a/docs/sphinx/source/whatsnew/v0.15.3.rst +++ b/docs/sphinx/source/whatsnew/v0.15.3.rst @@ -38,7 +38,7 @@ Requirements Maintenance ~~~~~~~~~~~ -* Fix some gallery examples not being run. Now, gallery example whose filename begins with ``NX_`` will be exclusively excluded. (:issue:`2790`, :pull:`2792`) +* Fix some gallery examples not being run. Only gallery examples whose filename begins with ``NX_`` will be excluded. (:issue:`2790`, :pull:`2792`) Contributors ~~~~~~~~~~~~