Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
#
# The system has public monitoring data available at the Open Energy Data
# Initiative (OEDI) under `System ID
# 9068 <https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=pvdaq%2F2023-solar-data-prize%2F9068_OEDI%2F>`__.
# 9068 <https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=pvdaq%2F2023-solar-data-prize%2F9068_OEDI%2F>`__. # noqa: E501
# For more information about the system, see its `OEDI
# page <https://openei.org/wiki/PVDAQ/Sites/SR_CO>`__.
#
# .. warning::
# This example requires user-provided credentials to be run at step
# :ref:`Fetch weather data <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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# for generating GH links with linenumbers
import inspect

# to escape special characters in sphinx-gallery OS-dependant regex
import re

# import distutils before calling pd.show_versions()
# https://github.com/pypa/setuptools/issues/3044
import distutils # noqa: F401
Comment on lines 26 to 28

@echedey-ls echedey-ls Jun 20, 2026

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.

This package was deprecated for quite some time, and finally got removed in CPython 3.12 1.
Our pipeline runs on CPython 3.12 too 2, but I guess readthedocs installs some stub to avoid breaking build processes - pure speculation from my side.

I've had to remove the import line in my python setups to compile the docs, both 3.14 (linux) and 3.12 (win). In both cases, I only installed our [doc] optional dependencies.

It was introduced quite some time ago, in #1435. The specific commit is 76972a8 (#1435). I couldn't trace what it attempts to solve, to see if it's now fixed (at pandas, probably?). Nowadays normal people use imporlib.metadata, so my guess is that we are looking at is a digital fossil. Wondering if anybody (presumably @kandersolar or @mikofski) knows if we can safely remove this.

Footnotes

  1. https://docs.python.org/3.12/library/distutils.html

  2. https://github.com/pvlib/pvlib-python/blob/0f7a2051ca154055e5b3f1ec6b3f4cd07f870b1e/readthedocs.yml#L14

Expand Down Expand Up @@ -384,12 +387,19 @@ def setup(app):
# https://github.com/pvlib/pvlib-python/issues/837
suppress_warnings = ['ref.footnote']

os_re_sep = re.escape(os.path.sep)
# settings for sphinx-gallery
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': 'plot_',

# 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
# unix: gallery_conf["filename_pattern"] = '^(.*)/(?!NX_)([^/]*)$'
# windows: gallery_conf["filename_pattern"] = '^(.*)\\\\(?!NX_)([^\\\\]*)$'
'filename_pattern': rf"^(.*){os_re_sep}(?!NX_)([^{os_re_sep}]*)$",

# directory where function/class granular galleries are stored
'backreferences_dir': 'reference/generated/gallery_backreferences',
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/source/whatsnew/v0.15.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Requirements

Maintenance
~~~~~~~~~~~

* Fix some gallery examples not being run. Only gallery examples whose filename begins with ``NX_`` will be excluded. (:issue:`2790`, :pull:`2792`)

Contributors
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading