Skip to content

Commit

Permalink
Added test to verify that error indicating inability to infer tempera…
Browse files Browse the repository at this point in the history
…ture model is raised when not providing temperature model to arrays
  • Loading branch information
matsuobasho committed Jan 19, 2024
1 parent 17e6ee2 commit 5cde61f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pvlib/tests/test_modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,21 @@ def test_temperature_model_inconsistent(location, sapm_dc_snl_ac_system):
spectral_model='no_loss', temperature_model='pvsyst')


def test_temperature_model_not_specified():
# GH 1759 -- ensure correct error is raised when temperature model params
# are specified on the PVSystem instead of the Arrays
location = Location(latitude=32.2, longitude=-110.9)
arrays = [pvsystem.Array(pvsystem.FixedMount(),
module_parameters={'pdc0': 1, 'gamma_pdc': 0})]
system = pvsystem.PVSystem(arrays,
temperature_model_parameters={'u0': 1, 'u1': 1},
inverter_parameters={'pdc0': 1})
with pytest.raises(ValueError,
match='could not infer temperature model '
'from system.temperature_model_parameters'):
_ = ModelChain(system, location,
aoi_model='no_loss', spectral_model='no_loss')

def test_dc_model_user_func(pvwatts_dc_pvwatts_ac_system, location, weather,

Check failure on line 1323 in pvlib/tests/test_modelchain.py

View workflow job for this annotation

GitHub Actions / flake8-linter

E302 expected 2 blank lines, found 1
mocker):
m = mocker.spy(sys.modules[__name__], 'poadc')
Expand Down

0 comments on commit 5cde61f

Please sign in to comment.