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
6 changes: 5 additions & 1 deletion docs/sphinx/source/whatsnew/v0.15.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ Deprecations

Bug fixes
~~~~~~~~~

* 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
~~~~~~~~~~~~
Expand Down Expand Up @@ -46,3 +49,4 @@ Maintenance
Contributors
~~~~~~~~~~~~
* :ghuser:`Omesh37`
* Cliff Hansen (:ghuser:`cwhanse`)
3 changes: 1 addition & 2 deletions pvlib/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))


Expand Down
11 changes: 10 additions & 1 deletion tests/test_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,16 @@ 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'))
# 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'))


Expand Down
Loading