From 8cc4230181674f47bfdc2a03b3c53015b84fc21a Mon Sep 17 00:00:00 2001 From: ChenYi-Nnergy Date: Mon, 19 Oct 2026 12:14:08 +0800 Subject: [PATCH 1/2] Add files via upload --- pvlib/solarposition.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 4441ed01f1..2974ffc8d3 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -1144,8 +1144,7 @@ def equation_of_time_pvcdrom(dayofyear): equation_of_time_spencer71 """ # day angle relative to Vernal Equinox, typically March 22 (day number 81) - bday = \ - _calculate_simple_day_angle(dayofyear) - (2.0 * np.pi / 365.0) * 80.0 + bday = _calculate_simple_day_angle(dayofyear, offset=81) # same value but about 2x faster than Spencer (1971) return 9.87 * np.sin(2.0 * bday) - 7.53 * np.cos(bday) - 1.5 * np.sin(bday) @@ -1236,8 +1235,8 @@ def declination_cooper69(dayofyear): -------- declination_spencer71 """ - day_angle = _calculate_simple_day_angle(dayofyear) - dec = np.deg2rad(23.45 * np.sin(day_angle + (2.0 * np.pi / 365.0) * 285.0)) + day_angle = _calculate_simple_day_angle(dayofyear, offset=-284) + dec = np.deg2rad(23.45 * np.sin(day_angle)) return dec From b4544f1366b5dffc5dd985dc371c1d6f63e03529 Mon Sep 17 00:00:00 2001 From: ChenYi-Nnergy Date: Mon, 19 Oct 2026 18:42:32 +0800 Subject: [PATCH 2/2] Add whatsnew entry for #2911 Added new enhancement details and fixed formatting issues. --- docs/sphinx/source/whatsnew/v0.16.2.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index fff7ba5d46..fe4de057b5 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -7,13 +7,13 @@ v0.16.2 (Anticipated December, 2026) Breaking Changes ~~~~~~~~~~~~~~~~ - Deprecations ~~~~~~~~~~~~ Bug fixes ~~~~~~~~~ + * :py:func:`pvlib.tracking.calc_surface_orientation` returns scalar when input is scalar (:issue:`2881`, :pull:`2882`) @@ -23,6 +23,12 @@ Enhancements allowing for choosing between ERA5 and ERA5-Land datasets. (:pull:`2780`) +* Pass ``offset`` directly to ``_calculate_simple_day_angle`` in + :py:func:`pvlib.solarposition.equation_of_time_pvcdrom` and + :py:func:`pvlib.solarposition.declination_cooper69` instead of + adding or subtracting equivalent multiples of 2*pi/365 afterwards. + (:issue:`2902`, :pull:`2911`) + Documentation ~~~~~~~~~~~~~ * Clarified in :py:func:`pvlib.tracking.singleaxis` that the tracker @@ -62,6 +68,3 @@ Contributors * Chen Yi (:ghuser:`chenyi6758-source`) * Rajiv Daxini (:ghuser:`rdaxini`) * jason-writer (:ghuser:`jason-writer`) - - -