From de85b8680dfa060394fb72fb5920a6b906ef321b Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Wed, 29 Apr 2026 16:32:11 -0700 Subject: [PATCH 1/6] fix dtype bug --- pvlib/temperature.py | 3 +-- tests/test_temperature.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pvlib/temperature.py b/pvlib/temperature.py index cb487ee77b..55222c0fb1 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -6,7 +6,6 @@ import numpy as np import pandas as pd from pvlib.tools import sind -from pvlib._deprecation import warn_deprecated from pvlib.tools import _get_sample_intervals import scipy import scipy.constants @@ -883,7 +882,7 @@ def fuentes(poa_global, temp_air, wind_speed, noct_installed, module_height=5, windmod_array = wind_speed * (module_height/wind_height)**0.2 + 1e-4 tmod0 = 293.15 - tmod_array = np.zeros_like(poa_global) + tmod_array = np.zeros_like(poa_global, dtype=float) iterator = zip(tamb_array, sun_array, windmod_array, tsky_array, timedelta_hours) diff --git a/tests/test_temperature.py b/tests/test_temperature.py index e238183600..34d9af5b82 100644 --- a/tests/test_temperature.py +++ b/tests/test_temperature.py @@ -271,7 +271,7 @@ def test_fuentes_timezone(tz): out = temperature.fuentes(df['poa_global'], df['temp_air'], df['wind_speed'], noct_installed=45) - assert_series_equal(out, pd.Series([47.85, 50.85, 50.85], index=index, + assert_series_equal(out, pd.Series([48.042, 51.845, 51.846], index=index, name='tmod')) From 7047d0a419341fb4c496f29acb7838392ef41227 Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Wed, 29 Apr 2026 16:36:45 -0700 Subject: [PATCH 2/6] whatsnew --- docs/sphinx/source/whatsnew/v0.15.2.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.2.rst b/docs/sphinx/source/whatsnew/v0.15.2.rst index 0f32b734ef..2f6df955fe 100644 --- a/docs/sphinx/source/whatsnew/v0.15.2.rst +++ b/docs/sphinx/source/whatsnew/v0.15.2.rst @@ -14,7 +14,9 @@ Deprecations Bug fixes ~~~~~~~~~ - +* Corrects a bug in :py:func:`pvlib.temperature.fuentes`. Users can expect + modeled cell temperature values to increase slightly. + (:issue:`2608`, :pull:``) Enhancements ~~~~~~~~~~~~ @@ -46,3 +48,4 @@ Maintenance Contributors ~~~~~~~~~~~~ * :ghuser:`Omesh37` +* Cliff Hansen :ghuser:`cwhanse` From cad9b17328b46719a89b5494eb8841fffe2a5cc2 Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Wed, 29 Apr 2026 16:37:08 -0700 Subject: [PATCH 3/6] add new test --- tests/test_temperature.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_temperature.py b/tests/test_temperature.py index 34d9af5b82..c5654b0bd2 100644 --- a/tests/test_temperature.py +++ b/tests/test_temperature.py @@ -273,6 +273,15 @@ def test_fuentes_timezone(tz): assert_series_equal(out, pd.Series([48.042, 51.845, 51.846], index=index, name='tmod')) + # GH 2608 + df = pd.DataFrame({'poa_global': 1000., 'temp_air': 20., 'wind_speed': 1.}, + index) + + out = temperature.fuentes(df['poa_global'], df['temp_air'], + df['wind_speed'], noct_installed=45) + + assert_series_equal(out, pd.Series([48.042, 51.845, 51.846], index=index, + name='tmod')) def test_noct_sam(): From f1aadd727b9f08fcb326e6b55a892205c50c4d4e Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Thu, 30 Apr 2026 07:37:01 -0700 Subject: [PATCH 4/6] Update tests/test_temperature.py Co-authored-by: Kevin Anderson --- tests/test_temperature.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_temperature.py b/tests/test_temperature.py index c5654b0bd2..f7cc242477 100644 --- a/tests/test_temperature.py +++ b/tests/test_temperature.py @@ -275,7 +275,7 @@ def test_fuentes_timezone(tz): name='tmod')) # GH 2608 df = pd.DataFrame({'poa_global': 1000., 'temp_air': 20., 'wind_speed': 1.}, - index) + index) out = temperature.fuentes(df['poa_global'], df['temp_air'], df['wind_speed'], noct_installed=45) From 599a040364d98c23a384dddd78eb6edd5ea47151 Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Thu, 30 Apr 2026 07:37:12 -0700 Subject: [PATCH 5/6] Update docs/sphinx/source/whatsnew/v0.15.2.rst Co-authored-by: Kevin Anderson --- docs/sphinx/source/whatsnew/v0.15.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.2.rst b/docs/sphinx/source/whatsnew/v0.15.2.rst index 2f6df955fe..689cb71e89 100644 --- a/docs/sphinx/source/whatsnew/v0.15.2.rst +++ b/docs/sphinx/source/whatsnew/v0.15.2.rst @@ -48,4 +48,4 @@ Maintenance Contributors ~~~~~~~~~~~~ * :ghuser:`Omesh37` -* Cliff Hansen :ghuser:`cwhanse` +* Cliff Hansen (:ghuser:`cwhanse`) From c426d2c5297146e86b2d27ec23f0e9549f107d86 Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Thu, 30 Apr 2026 08:40:57 -0700 Subject: [PATCH 6/6] pvsystem test --- docs/sphinx/source/whatsnew/v0.15.2.rst | 5 +++-- tests/test_pvsystem.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.2.rst b/docs/sphinx/source/whatsnew/v0.15.2.rst index 689cb71e89..5588026463 100644 --- a/docs/sphinx/source/whatsnew/v0.15.2.rst +++ b/docs/sphinx/source/whatsnew/v0.15.2.rst @@ -14,8 +14,9 @@ Deprecations Bug fixes ~~~~~~~~~ -* Corrects a bug in :py:func:`pvlib.temperature.fuentes`. Users can expect - modeled cell temperature values to increase slightly. +* Corrects a bug in :py:func:`pvlib.temperature.fuentes`. If inputs were + data type integer, users can expect modeled cell temperature values to + increase slightly. (:issue:`2608`, :pull:``) Enhancements diff --git a/tests/test_pvsystem.py b/tests/test_pvsystem.py index 9257b769f3..267d3b14c9 100644 --- a/tests/test_pvsystem.py +++ b/tests/test_pvsystem.py @@ -711,7 +711,7 @@ def test_PVSystem_fuentes_celltemp(mocker): assert_series_equal(spy.call_args[0][1], temps) assert_series_equal(spy.call_args[0][2], winds) assert spy.call_args[0][3] == noct_installed - assert_series_equal(out, pd.Series([52.85, 55.85, 55.85], index, + assert_series_equal(out, pd.Series([52.884, 56.835, 56.836], index, name='tmod'))