Skip to content

Commit 7ab38cd

Browse files
committed
error message, test, docs
1 parent ad30ffe commit 7ab38cd

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

docs/sphinx/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ PV temperature models
238238
temperature.faiman
239239
temperature.fuentes
240240
temperature.ross
241+
temperature.noct
241242
pvsystem.PVSystem.sapm_celltemp
242243
pvsystem.PVSystem.pvsyst_celltemp
243244
pvsystem.PVSystem.faiman_celltemp

docs/sphinx/source/whatsnew/v0.9.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Enhancements
9696
* :py:meth:`~pvlib.pvsystem.PVSystem.get_ac` is added to calculate AC power
9797
from DC power. Use parameter ``model`` to specify which inverter model to use.
9898
(:pull:`1147`, :issue:`998`, :pull:`1150`)
99+
* Added :py:func:`~pvlib.temperature.noct`, a cell temperature model
100+
implemented in SAM (:pull:`1177`)
99101

100102
Bug fixes
101103
~~~~~~~~~

pvlib/tests/test_temperature.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,45 @@ def test_fuentes_timezone(tz):
212212

213213
assert_series_equal(out, pd.Series([47.85, 50.85, 50.85], index=index,
214214
name='tmod'))
215+
216+
217+
def test_noct():
218+
poa_global, temp_air, wind_speed, noct, eta_m_ref = (1000., 25., 1., 45.,
219+
0.2)
220+
expected = 54.41542289
221+
result = temperature.noct(poa_global, temp_air, wind_speed, noct,
222+
eta_m_ref)
223+
assert np.isclose(result, expected)
224+
# test with different types
225+
result = temperature.noct(np.array(poa_global), np.array(temp_air),
226+
np.array(wind_speed), np.array(noct),
227+
np.array(eta_m_ref))
228+
assert np.isclose(result, expected)
229+
dr = pd.date_range(start='2020-01-01 12:00:00', end='2020-01-01 13:00:00',
230+
freq='1H')
231+
result = temperature.noct(pd.Series(index=dr, data=poa_global),
232+
pd.Series(index=dr, data=temp_air),
233+
pd.Series(index=dr, data=wind_speed),
234+
pd.Series(index=dr, data=noct),
235+
eta_m_ref)
236+
assert_series_equal(result, pd.Series(index=dr, data=expected))
237+
238+
239+
def test_noct_options():
240+
poa_global, temp_air, wind_speed, noct, eta_m_ref = (1000., 25., 1., 45.,
241+
0.2)
242+
effective_irradiance = 1100.
243+
transmittance_absorbtance = 0.8
244+
array_height = 2
245+
mount_standoff = 2.0
246+
result = temperature.noct(poa_global, temp_air, wind_speed, noct,
247+
eta_m_ref, effective_irradiance,
248+
transmittance_absorbtance, array_height,
249+
mount_standoff)
250+
expected = 58.36654459
251+
assert np.isclose(result, expected)
252+
253+
254+
def test_noct_errors():
255+
with pytest.raises(ValueError):
256+
temperature.noct(1000., 25., 1., 34., 0.2, array_height=3)

0 commit comments

Comments
 (0)