@@ -268,7 +268,7 @@ def location():
268
268
269
269
@pytest .fixture
270
270
def weather ():
271
- times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6H ' )
271
+ times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h ' )
272
272
weather = pd .DataFrame ({'ghi' : [500 , 0 ], 'dni' : [800 , 0 ], 'dhi' : [100 , 0 ]},
273
273
index = times )
274
274
return weather
@@ -350,7 +350,7 @@ def test_with_pvwatts(pvwatts_dc_pvwatts_ac_system, location, weather):
350
350
351
351
def test_run_model_with_irradiance (sapm_dc_snl_ac_system , location ):
352
352
mc = ModelChain (sapm_dc_snl_ac_system , location )
353
- times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6H ' )
353
+ times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h ' )
354
354
irradiance = pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
355
355
index = times )
356
356
ac = mc .run_model (irradiance ).results .ac
@@ -417,7 +417,7 @@ def test_run_model_from_irradiance_arrays_no_loss(
417
417
spectral_model = 'no_loss' ,
418
418
losses_model = 'no_loss'
419
419
)
420
- times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6H ' )
420
+ times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h ' )
421
421
irradiance = pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
422
422
index = times )
423
423
mc_one .run_model (irradiance )
@@ -457,7 +457,7 @@ def test_run_model_from_irradiance_arrays_no_loss_input_type(
457
457
spectral_model = 'no_loss' ,
458
458
losses_model = 'no_loss'
459
459
)
460
- times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6H ' )
460
+ times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h ' )
461
461
irradiance = pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
462
462
index = times )
463
463
mc_one .run_model (irradiance )
@@ -487,7 +487,7 @@ def test_ModelChain_invalid_inverter_params_arrays(
487
487
def test_prepare_inputs_multi_weather (
488
488
sapm_dc_snl_ac_system_Array , location , input_type ):
489
489
times = pd .date_range (start = '20160101 1200-0700' ,
490
- end = '20160101 1800-0700' , freq = '6H ' )
490
+ end = '20160101 1800-0700' , freq = '6h ' )
491
491
mc = ModelChain (sapm_dc_snl_ac_system_Array , location )
492
492
weather = pd .DataFrame ({'ghi' : 1 , 'dhi' : 1 , 'dni' : 1 },
493
493
index = times )
@@ -502,7 +502,7 @@ def test_prepare_inputs_multi_weather(
502
502
def test_prepare_inputs_albedo_in_weather (
503
503
sapm_dc_snl_ac_system_Array , location , input_type ):
504
504
times = pd .date_range (start = '20160101 1200-0700' ,
505
- end = '20160101 1800-0700' , freq = '6H ' )
505
+ end = '20160101 1800-0700' , freq = '6h ' )
506
506
mc = ModelChain (sapm_dc_snl_ac_system_Array , location )
507
507
weather = pd .DataFrame ({'ghi' : 1 , 'dhi' : 1 , 'dni' : 1 , 'albedo' : 0.5 },
508
508
index = times )
@@ -564,14 +564,14 @@ def test_ModelChain_times_error_arrays(sapm_dc_snl_ac_system_Array, location):
564
564
error_str = r"Input DataFrames must have same index\."
565
565
mc = ModelChain (sapm_dc_snl_ac_system_Array , location )
566
566
irradiance = {'ghi' : [1 , 2 ], 'dhi' : [1 , 2 ], 'dni' : [1 , 2 ]}
567
- times_one = pd .date_range (start = '1/1/2020' , freq = '6H ' , periods = 2 )
568
- times_two = pd .date_range (start = '1/1/2020 00:15' , freq = '6H ' , periods = 2 )
567
+ times_one = pd .date_range (start = '1/1/2020' , freq = '6h ' , periods = 2 )
568
+ times_two = pd .date_range (start = '1/1/2020 00:15' , freq = '6h ' , periods = 2 )
569
569
weather_one = pd .DataFrame (irradiance , index = times_one )
570
570
weather_two = pd .DataFrame (irradiance , index = times_two )
571
571
with pytest .raises (ValueError , match = error_str ):
572
572
mc .prepare_inputs ((weather_one , weather_two ))
573
573
# test with overlapping, but differently sized indices.
574
- times_three = pd .date_range (start = '1/1/2020' , freq = '6H ' , periods = 3 )
574
+ times_three = pd .date_range (start = '1/1/2020' , freq = '6h ' , periods = 3 )
575
575
irradiance_three = irradiance
576
576
irradiance_three ['ghi' ].append (3 )
577
577
irradiance_three ['dhi' ].append (3 )
@@ -588,7 +588,7 @@ def test_ModelChain_times_arrays(sapm_dc_snl_ac_system_Array, location):
588
588
mc = ModelChain (sapm_dc_snl_ac_system_Array , location )
589
589
irradiance_one = {'ghi' : [1 , 2 ], 'dhi' : [1 , 2 ], 'dni' : [1 , 2 ]}
590
590
irradiance_two = {'ghi' : [2 , 1 ], 'dhi' : [2 , 1 ], 'dni' : [2 , 1 ]}
591
- times = pd .date_range (start = '1/1/2020' , freq = '6H ' , periods = 2 )
591
+ times = pd .date_range (start = '1/1/2020' , freq = '6h ' , periods = 2 )
592
592
weather_one = pd .DataFrame (irradiance_one , index = times )
593
593
weather_two = pd .DataFrame (irradiance_two , index = times )
594
594
mc .prepare_inputs ((weather_one , weather_two ))
@@ -617,7 +617,7 @@ def test_run_model_arrays_weather(sapm_dc_snl_ac_system_same_arrays,
617
617
'pvwatts' : pvwatts_dc_pvwatts_ac_system_arrays }
618
618
mc = ModelChain (system [ac_model ], location , aoi_model = 'no_loss' ,
619
619
spectral_model = 'no_loss' )
620
- times = pd .date_range ('20200101 1200-0700' , periods = 2 , freq = '2H ' )
620
+ times = pd .date_range ('20200101 1200-0700' , periods = 2 , freq = '2h ' )
621
621
weather_one = pd .DataFrame ({'dni' : [900 , 800 ],
622
622
'ghi' : [600 , 500 ],
623
623
'dhi' : [150 , 100 ]},
@@ -634,7 +634,7 @@ def test_run_model_arrays_weather(sapm_dc_snl_ac_system_same_arrays,
634
634
def test_run_model_perez (sapm_dc_snl_ac_system , location ):
635
635
mc = ModelChain (sapm_dc_snl_ac_system , location ,
636
636
transposition_model = 'perez' )
637
- times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6H ' )
637
+ times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h ' )
638
638
irradiance = pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
639
639
index = times )
640
640
ac = mc .run_model (irradiance ).results .ac
@@ -648,7 +648,7 @@ def test_run_model_gueymard_perez(sapm_dc_snl_ac_system, location):
648
648
mc = ModelChain (sapm_dc_snl_ac_system , location ,
649
649
airmass_model = 'gueymard1993' ,
650
650
transposition_model = 'perez' )
651
- times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6H ' )
651
+ times = pd .date_range ('20160101 1200-0700' , periods = 2 , freq = '6h ' )
652
652
irradiance = pd .DataFrame ({'dni' : 900 , 'ghi' : 600 , 'dhi' : 150 },
653
653
index = times )
654
654
ac = mc .run_model (irradiance ).results .ac
@@ -812,7 +812,7 @@ def test_prepare_inputs_from_poa_arrays_different_indices(
812
812
mc = ModelChain (sapm_dc_snl_ac_system_Array , location )
813
813
poa = pd .concat ([weather , total_irrad ], axis = 1 )
814
814
with pytest .raises (ValueError , match = error_str ):
815
- mc .prepare_inputs_from_poa ((poa , poa .shift (periods = 1 , freq = '6H ' )))
815
+ mc .prepare_inputs_from_poa ((poa , poa .shift (periods = 1 , freq = '6h ' )))
816
816
817
817
818
818
def test_prepare_inputs_from_poa_arrays_missing_column (
@@ -1078,7 +1078,7 @@ def test_run_model_from_effective_irradiance_arrays_error(
1078
1078
with pytest .raises (ValueError ,
1079
1079
match = r"Input DataFrames must have same index\." ):
1080
1080
mc .run_model_from_effective_irradiance (
1081
- (data , data .shift (periods = 1 , freq = '6H ' ))
1081
+ (data , data .shift (periods = 1 , freq = '6h ' ))
1082
1082
)
1083
1083
1084
1084
@@ -1790,7 +1790,7 @@ def test_ModelChain_no_extra_kwargs(sapm_dc_snl_ac_system, location):
1790
1790
def test_basic_chain_alt_az (sam_data , cec_inverter_parameters ,
1791
1791
sapm_temperature_cs5p_220m ):
1792
1792
times = pd .date_range (start = '20160101 1200-0700' ,
1793
- end = '20160101 1800-0700' , freq = '6H ' )
1793
+ end = '20160101 1800-0700' , freq = '6h ' )
1794
1794
latitude = 32.2
1795
1795
longitude = - 111
1796
1796
surface_tilt = 0
@@ -1812,7 +1812,7 @@ def test_basic_chain_alt_az(sam_data, cec_inverter_parameters,
1812
1812
def test_basic_chain_altitude_pressure (sam_data , cec_inverter_parameters ,
1813
1813
sapm_temperature_cs5p_220m ):
1814
1814
times = pd .date_range (start = '20160101 1200-0700' ,
1815
- end = '20160101 1800-0700' , freq = '6H ' )
1815
+ end = '20160101 1800-0700' , freq = '6h ' )
1816
1816
latitude = 32.2
1817
1817
longitude = - 111
1818
1818
altitude = 700
@@ -1847,7 +1847,7 @@ def test_basic_chain_altitude_pressure(sam_data, cec_inverter_parameters,
1847
1847
def test_complete_irradiance_clean_run (sapm_dc_snl_ac_system , location ):
1848
1848
"""The DataFrame should not change if all columns are passed"""
1849
1849
mc = ModelChain (sapm_dc_snl_ac_system , location )
1850
- times = pd .date_range ('2010-07-05 9:00:00' , periods = 2 , freq = 'H ' )
1850
+ times = pd .date_range ('2010-07-05 9:00:00' , periods = 2 , freq = 'h ' )
1851
1851
i = pd .DataFrame (
1852
1852
{'dni' : [2 , 3 ], 'dhi' : [4 , 6 ], 'ghi' : [9 , 5 ]}, index = times )
1853
1853
@@ -1864,7 +1864,7 @@ def test_complete_irradiance_clean_run(sapm_dc_snl_ac_system, location):
1864
1864
def test_complete_irradiance (sapm_dc_snl_ac_system , location , mocker ):
1865
1865
"""Check calculations"""
1866
1866
mc = ModelChain (sapm_dc_snl_ac_system , location )
1867
- times = pd .date_range ('2010-07-05 7:00:00-0700' , periods = 2 , freq = 'H ' )
1867
+ times = pd .date_range ('2010-07-05 7:00:00-0700' , periods = 2 , freq = 'h ' )
1868
1868
i = pd .DataFrame ({'dni' : [49.756966 , 62.153947 ],
1869
1869
'ghi' : [372.103976116 , 497.087579068 ],
1870
1870
'dhi' : [356.543700 , 465.44400 ]}, index = times )
@@ -1897,7 +1897,7 @@ def test_complete_irradiance_arrays(
1897
1897
sapm_dc_snl_ac_system_same_arrays , location , input_type ):
1898
1898
"""ModelChain.complete_irradiance can accept a tuple of weather
1899
1899
DataFrames."""
1900
- times = pd .date_range (start = '2020-01-01 0700-0700' , periods = 2 , freq = 'H ' )
1900
+ times = pd .date_range (start = '2020-01-01 0700-0700' , periods = 2 , freq = 'h ' )
1901
1901
weather = pd .DataFrame ({'dni' : [2 , 3 ],
1902
1902
'dhi' : [4 , 6 ],
1903
1903
'ghi' : [9 , 5 ]}, index = times )
@@ -1932,7 +1932,7 @@ def test_complete_irradiance_arrays(
1932
1932
def test_complete_irradiance_arrays_wrong_length (
1933
1933
sapm_dc_snl_ac_system_same_arrays , location , input_type ):
1934
1934
mc = ModelChain (sapm_dc_snl_ac_system_same_arrays , location )
1935
- times = pd .date_range (start = '2020-01-01 0700-0700' , periods = 2 , freq = 'H ' )
1935
+ times = pd .date_range (start = '2020-01-01 0700-0700' , periods = 2 , freq = 'h ' )
1936
1936
weather = pd .DataFrame ({'dni' : [2 , 3 ],
1937
1937
'dhi' : [4 , 6 ],
1938
1938
'ghi' : [9 , 5 ]}, index = times )
0 commit comments