Skip to content

Commit 2c8a925

Browse files
committed
better inspection of values
1 parent f0320cf commit 2c8a925

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_modelchain.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,12 @@ def test_ac_models(sapm_dc_snl_ac_system, cec_dc_adr_ac_system,
13821382
'adr': 'adr',
13831383
'pvwatts': 'pvwatts',
13841384
'pvwatts_multi': 'pvwatts'}
1385+
inverter_to_ac_model_param = {
1386+
'sandia': 'Paco',
1387+
'sandia_multi': 'Paco',
1388+
'adr': 'Pnom',
1389+
'pvwatts': 'pdc0',
1390+
'pvwatts_multi': 'pdc0'}
13851391
ac_model = inverter_to_ac_model[inverter_model]
13861392
system = ac_systems[inverter_model]
13871393

@@ -1398,7 +1404,12 @@ def test_ac_models(sapm_dc_snl_ac_system, cec_dc_adr_ac_system,
13981404
assert m.call_count == 1
13991405
assert isinstance(mc.results.ac, pd.Series)
14001406
assert not mc.results.ac.empty
1401-
assert mc.results.ac.iloc[1] < 1
1407+
# irradiance 800 W/m2 at 1st timestamp
1408+
inv_param = mc.system.inverter_parameters[
1409+
inverter_to_ac_model_param[inverter_model]]
1410+
assert (mc.results.ac.iloc[0] > inv_param / 2.)
1411+
# irradiance 0 W/m2 at the 2nd timestamp
1412+
assert (np.isnan(mc.results.ac.iloc[1]) or (mc.results.ac.iloc[1] < 1))
14021413

14031414

14041415
def test_ac_model_user_func(pvwatts_dc_pvwatts_ac_system, location, weather,

0 commit comments

Comments
 (0)