diff --git a/pvlib/temperature.py b/pvlib/temperature.py index cb487ee77b..668f439124 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -883,7 +883,9 @@ 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) + # ensure floating dtype so intermediate values aren't truncated when the + # inputs are integer-typed (see GH-2608) + 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 e482df6214..2dd59a634a 100644 --- a/tests/test_temperature.py +++ b/tests/test_temperature.py @@ -271,8 +271,10 @@ 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, - name='tmod')) + expected = pd.Series([48.04184255985865, 51.84547131312195, + 51.846427911242756], + index=index, name='tmod') + assert_series_equal(out, expected) def test_noct_sam():