@@ -346,7 +346,7 @@ def test_with_pvwatts(pvwatts_dc_pvwatts_ac_system, location, weather):
346346
347347
348348def  test_run_model_with_irradiance (sapm_dc_snl_ac_system , location ):
349-     mc  =  ModelChain (sapm_dc_snl_ac_system , location )
349+     mc  =  ModelChain (sapm_dc_snl_ac_system , location ,  spectral_model = 'sapm' )
350350    times  =  pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h' )
351351    irradiance  =  pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
352352                              index = times )
@@ -629,9 +629,13 @@ def test_run_model_arrays_weather(sapm_dc_snl_ac_system_same_arrays,
629629
630630
631631def  test_run_model_perez (sapm_dc_snl_ac_system , location ):
632-     mc  =  ModelChain (sapm_dc_snl_ac_system , location ,
633-                     transposition_model = 'perez' )
634-     times  =  pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h' )
632+     mc  =  ModelChain (
633+         sapm_dc_snl_ac_system ,
634+         location ,
635+         transposition_model = "perez" ,
636+         spectral_model = "sapm" ,
637+     )
638+     times  =  pd .date_range ("20160101 1200-0700" , periods = 2 , freq = "6h" )
635639    irradiance  =  pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
636640                              index = times )
637641    ac  =  mc .run_model (irradiance ).results .ac 
@@ -642,10 +646,14 @@ def test_run_model_perez(sapm_dc_snl_ac_system, location):
642646
643647
644648def  test_run_model_gueymard_perez (sapm_dc_snl_ac_system , location ):
645-     mc  =  ModelChain (sapm_dc_snl_ac_system , location ,
646-                     airmass_model = 'gueymard1993' ,
647-                     transposition_model = 'perez' )
648-     times  =  pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h' )
649+     mc  =  ModelChain (
650+         sapm_dc_snl_ac_system ,
651+         location ,
652+         airmass_model = "gueymard1993" ,
653+         transposition_model = "perez" ,
654+         spectral_model = "sapm" ,
655+     )
656+     times  =  pd .date_range ("20160101 1200-0700" , periods = 2 , freq = "6h" )
649657    irradiance  =  pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
650658                              index = times )
651659    ac  =  mc .run_model (irradiance ).results .ac 
@@ -1271,12 +1279,16 @@ def test_infer_spectral_model(location, sapm_dc_snl_ac_system,
12711279def  test_infer_spectral_model_with_weather (location , sapm_dc_snl_ac_system ,
12721280                                           cec_dc_snl_ac_system , weather ):
12731281    # instantiate example ModelChain to get the default spectral model 
1274-     # inferred without weather available by default 
1275-     # - should resolve to sapm 
1282+     # default should resolve to no loss 
12761283    mc  =  ModelChain (sapm_dc_snl_ac_system , location , aoi_model = 'physical' )
12771284    assert  mc .spectral_model  ==  mc .sapm_spectral_loss 
1278-     # - should resolve to no loss 
1279-     mc  =  ModelChain (cec_dc_snl_ac_system , location , aoi_model = 'physical' )
1285+     # - next inference should resolve to no loss 
1286+     mc  =  ModelChain (
1287+         cec_dc_snl_ac_system ,
1288+         location ,
1289+         aoi_model = "physical" ,
1290+         spectral_model = None ,
1291+     )
12801292    assert  mc .spectral_model  ==  mc .no_spectral_loss 
12811293
12821294    # infer spectral model from weather 
@@ -2008,9 +2020,9 @@ def test__irrad_for_celltemp():
20082020
20092021
20102022def  test_ModelChain___repr__ (sapm_dc_snl_ac_system , location ):
2011- 
2012-     mc   =   ModelChain ( sapm_dc_snl_ac_system , location ,
2013-                      name = 'my mc' )
2023+      mc   =   ModelChain ( 
2024+          sapm_dc_snl_ac_system , location ,  name = "my mc" ,  spectral_model = "sapm" 
2025+     )
20142026
20152027    expected  =  '\n ' .join ([
20162028        'ModelChain: ' ,
0 commit comments