Skip to content

Commit 5cde61f

Browse files
committed
Added test to verify that error indicating inability to infer temperature model is raised when not providing temperature model to arrays
1 parent 17e6ee2 commit 5cde61f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pvlib/tests/test_modelchain.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,21 @@ def test_temperature_model_inconsistent(location, sapm_dc_snl_ac_system):
13051305
spectral_model='no_loss', temperature_model='pvsyst')
13061306

13071307

1308+
def test_temperature_model_not_specified():
1309+
# GH 1759 -- ensure correct error is raised when temperature model params
1310+
# are specified on the PVSystem instead of the Arrays
1311+
location = Location(latitude=32.2, longitude=-110.9)
1312+
arrays = [pvsystem.Array(pvsystem.FixedMount(),
1313+
module_parameters={'pdc0': 1, 'gamma_pdc': 0})]
1314+
system = pvsystem.PVSystem(arrays,
1315+
temperature_model_parameters={'u0': 1, 'u1': 1},
1316+
inverter_parameters={'pdc0': 1})
1317+
with pytest.raises(ValueError,
1318+
match='could not infer temperature model '
1319+
'from system.temperature_model_parameters'):
1320+
_ = ModelChain(system, location,
1321+
aoi_model='no_loss', spectral_model='no_loss')
1322+
13081323
def test_dc_model_user_func(pvwatts_dc_pvwatts_ac_system, location, weather,
13091324
mocker):
13101325
m = mocker.spy(sys.modules[__name__], 'poadc')

0 commit comments

Comments
 (0)