@@ -57,7 +57,7 @@ def test_get_nsrdb_psm4_tmy(nrel_api_key):
5757 """test get_nsrdb_psm4_tmy with a TMY"""
5858 data , metadata = psm4 .get_nsrdb_psm4_tmy (LATITUDE , LONGITUDE ,
5959 nrel_api_key , PVLIB_EMAIL ,
60- names = 'tmy-2023' ,
60+ year = 'tmy-2023' ,
6161 leap_day = False ,
6262 map_variables = False )
6363 expected = pd .read_csv (TMY_TEST_DATA )
@@ -71,7 +71,7 @@ def test_get_nsrdb_psm4_conus_singleyear(nrel_api_key):
7171 data , metadata = psm4 .get_nsrdb_psm4_aggregated (LATITUDE , LONGITUDE ,
7272 nrel_api_key ,
7373 PVLIB_EMAIL ,
74- names = '2023' ,
74+ year = '2023' ,
7575 leap_day = False ,
7676 map_variables = False ,
7777 interval = 30 )
@@ -85,7 +85,7 @@ def test_get_nsrdb_psm4_conus_5min(nrel_api_key):
8585 """test get_nsrdb_psm4_conus for 5-minute data"""
8686 data , metadata = psm4 .get_nsrdb_psm4_conus (LATITUDE , LONGITUDE ,
8787 nrel_api_key , PVLIB_EMAIL ,
88- names = '2023' , interval = 5 ,
88+ year = '2023' , interval = 5 ,
8989 leap_day = False ,
9090 map_variables = False )
9191 assert len (data ) == 525600 / 5
@@ -100,13 +100,13 @@ def test_get_nsrdb_psm4_aggregated_check_leap_day(nrel_api_key):
100100 """test get_nsrdb_psm4_aggregated for leap day"""
101101 data_2012 , _ = psm4 .get_nsrdb_psm4_aggregated (LATITUDE , LONGITUDE ,
102102 nrel_api_key , PVLIB_EMAIL ,
103- names = "2012" , interval = 60 ,
103+ year = "2012" , interval = 60 ,
104104 leap_day = True ,
105105 map_variables = False )
106106 assert len (data_2012 ) == (8760 + 24 )
107107
108108
109- @pytest .mark .parametrize ('latitude, longitude, api_key, names , interval' ,
109+ @pytest .mark .parametrize ('latitude, longitude, api_key, year , interval' ,
110110 [(LATITUDE , LONGITUDE , 'BAD' , '2023' , 60 ),
111111 (51 , - 5 , nrel_api_key , '2023' , 60 ),
112112 (LATITUDE , LONGITUDE , nrel_api_key , 'bad' , 60 ),
@@ -115,7 +115,7 @@ def test_get_nsrdb_psm4_aggregated_check_leap_day(nrel_api_key):
115115@pytest .mark .remote_data
116116@pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
117117def test_get_nsrdb_psm4_aggregated_errors (
118- latitude , longitude , api_key , names , interval
118+ latitude , longitude , api_key , year , interval
119119):
120120 """Test get_nsrdb_psm4_aggregated() for multiple erroneous input scenarios.
121121
@@ -127,7 +127,7 @@ def test_get_nsrdb_psm4_aggregated_errors(
127127 """
128128 with pytest .raises (HTTPError ) as excinfo :
129129 psm4 .get_nsrdb_psm4_aggregated (latitude , longitude , api_key ,
130- PVLIB_EMAIL , names = names ,
130+ PVLIB_EMAIL , year = year ,
131131 interval = interval , leap_day = False ,
132132 map_variables = False )
133133 # ensure the HTTPError caught isn't due to overuse of the API key
@@ -162,12 +162,11 @@ def test_read_nsrdb_psm4_map_variables():
162162 """test read_nsrdb_psm4 map_variables=True"""
163163 data , metadata = psm4 .read_nsrdb_psm4 (MANUAL_TEST_DATA , map_variables = True )
164164 columns_mapped = ['Year' , 'Month' , 'Day' , 'Hour' , 'Minute' , 'temp_air' ,
165- 'alpha' , 'aod' , 'asymmetry' , 'dhi_clear' , 'dni_clear' ,
166- 'ghi_clear' , 'Cloud Fill Flag' , 'Cloud Type' ,
167- 'temp_dew' , 'dhi' , 'dni' , 'Fill Flag' , 'ghi' , 'Ozone' ,
168- 'relative_humidity' , 'solar_zenith' , 'SSA' , 'albedo' ,
169- 'pressure' , 'precipitable_water' , 'wind_direction' ,
170- 'wind_speed' ]
165+ 'aod' , 'dhi_clear' , 'dni_clear' , 'ghi_clear' ,
166+ 'Cloud Fill Flag' , 'Cloud Type' , 'temp_dew' , 'dhi' ,
167+ 'dni' , 'Fill Flag' , 'ghi' , 'Ozone' , 'relative_humidity' ,
168+ 'solar_zenith' , 'SSA' , 'albedo' , 'pressure' ,
169+ 'precipitable_water' , 'wind_direction' , 'wind_speed' ]
171170 assert_index_equal (data .columns , pd .Index (columns_mapped ))
172171
173172
@@ -177,7 +176,7 @@ def test_get_nsrdb_psm4_aggregated_attribute_mapping(nrel_api_key):
177176 """Test that pvlib names can be passed in as attributes and get correctly
178177 reverse mapped to psm4 names"""
179178 data , meta = psm4 .get_nsrdb_psm4_aggregated (
180- LATITUDE , LONGITUDE , nrel_api_key , PVLIB_EMAIL , names = '2019' ,
179+ LATITUDE , LONGITUDE , nrel_api_key , PVLIB_EMAIL , year = '2019' ,
181180 interval = 60 , attributes = ['ghi' , 'wind_speed' ], leap_day = False ,
182181 map_variables = True )
183182 # Check that columns are in the correct order (GH1647)
0 commit comments