@@ -1874,7 +1874,7 @@ def run_model_tests(my_predbat):
18741874 reset_rates (my_predbat , import_rate , export_rate )
18751875 reset_inverter (my_predbat )
18761876 # No clipping when pv_ac_limit is above the actual PV output
1877- failed |= simple_scenario ("pv_ac_limit_no_clip" , my_predbat , 0 , 1.0 , assert_final_metric = - export_rate * 24 , assert_final_soc = 0 , with_battery = False , pv_ac_limit = 2.0 )
1877+ failed |= simple_scenario ("pv_ac_limit_no_clip" , my_predbat , 0 , 1.0 , assert_final_metric = - export_rate * 24 , assert_final_soc = 0 , with_battery = False , pv_ac_limit = 2.0 , assert_clipped = 0 )
18781878 # Clipping when pv_ac_limit is below the actual PV output (non-hybrid AC-coupled)
18791879 failed |= simple_scenario ("pv_ac_limit_ac_clip" , my_predbat , 0 , 2.0 , assert_final_metric = - export_rate * 24 * 1.5 , assert_final_soc = 0 , with_battery = False , pv_ac_limit = 1.5 , assert_clipped = 24 * 0.5 )
18801880 # With a load, clipping still applies; load is met from grid when pv is capped
@@ -1890,9 +1890,7 @@ def run_model_tests(my_predbat):
18901890 assert_clipped = 24 * 0.5 ,
18911891 )
18921892 # pv_ac_limit must NOT apply to hybrid inverters (PV is DC-coupled, clipping handled by inverter_limit)
1893- failed |= simple_scenario ("pv_ac_limit_hybrid_ignored" , my_predbat , 0 , 2.0 , assert_final_metric = - export_rate * 24 , assert_final_soc = 24 , with_battery = True , hybrid = True , pv_ac_limit = 1.5 )
1894- if failed :
1895- return failed
1893+ failed |= simple_scenario ("pv_ac_limit_hybrid_ignored" , my_predbat , 0 , 2.0 , assert_final_metric = - export_rate * 24 , assert_final_soc = 24 , with_battery = True , hybrid = True , pv_ac_limit = 1.5 , assert_clipped = 0 )
18961894
18971895 if failed :
18981896 print ("**** ERROR: Some Model tests failed ****" )
0 commit comments