From f5bd6349e1172782a42473c467a4d5422af34622 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Tue, 29 Sep 2026 10:29:40 +0200 Subject: [PATCH 1/2] Add pvlib.spa.transit_sunrise_sunset to documentation --- docs/sphinx/source/reference/solarposition.rst | 1 + docs/sphinx/source/whatsnew/v0.16.2.rst | 2 ++ pvlib/spa.py | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/reference/solarposition.rst b/docs/sphinx/source/reference/solarposition.rst index dbe93d5392..42d02c5de1 100644 --- a/docs/sphinx/source/reference/solarposition.rst +++ b/docs/sphinx/source/reference/solarposition.rst @@ -41,6 +41,7 @@ Functions for calculating sunrise, sunset and transit times. solarposition.sun_rise_set_transit_ephem solarposition.sun_rise_set_transit_spa solarposition.sun_rise_set_transit_geometric + spa.transit_sunrise_sunset The spa module contains the implementation of the built-in NREL SPA diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index f704525a12..833da40157 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -22,6 +22,8 @@ Enhancements Documentation ~~~~~~~~~~~~~ +* Add :py:func:`pvlib.spa.transit_sunrise_sunset` to the API reference. + (:issue:`2255`) Testing diff --git a/pvlib/spa.py b/pvlib/spa.py index fe072b2cc9..18c7843f45 100644 --- a/pvlib/spa.py +++ b/pvlib/spa.py @@ -1108,7 +1108,7 @@ def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t, def transit_sunrise_sunset(dates, lat, lon, delta_t, numthreads): """ Calculate the sun transit, sunrise, and sunset - for a set of dates at a given location. + for a set of dates at a given location using the NREL SPA [1]_. Parameters ---------- @@ -1129,6 +1129,11 @@ def transit_sunrise_sunset(dates, lat, lon, delta_t, numthreads): ------- tuple : (transit, sunrise, sunset) localized to UTC + References + ---------- + .. [1] I. Reda and A. Andreas, Solar position algorithm for solar + radiation applications. Solar Energy, vol. 76, no. 5, pp. 577-589, + 2004. :doi:`10.1016/j.solener.2003.12.003` """ if ((dates % 86400) != 0.0).any(): From 48f95c56a89bb15cb038f9899b102c3ea4a42156 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Tue, 29 Sep 2026 10:31:27 +0200 Subject: [PATCH 2/2] Update v0.16.2.rst --- docs/sphinx/source/whatsnew/v0.16.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index 833da40157..6cc4056a0a 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -23,7 +23,7 @@ Enhancements Documentation ~~~~~~~~~~~~~ * Add :py:func:`pvlib.spa.transit_sunrise_sunset` to the API reference. - (:issue:`2255`) + (:issue:`2255`, :pull:`2873`) Testing