88
99from nose .tools import assert_equals , assert_almost_equals
1010from pandas .util .testing import assert_series_equal , assert_frame_equal
11- from . import incompatible_conda_linux_py3
11+ from . import incompatible_conda_linux_py3 , incompatible_pandas_0180
1212
1313from pvlib import tmy
1414from pvlib import pvsystem
@@ -61,7 +61,7 @@ def test_systemdef_tmy3():
6161 'surface_azimuth' : 0 ,
6262 'surface_tilt' : 0 }
6363 assert_equals (expected , pvsystem .systemdef (tmy3_metadata , 0 , 0 , .1 , 5 , 5 ))
64-
64+
6565def test_systemdef_tmy2 ():
6666 expected = {'tz' : - 5 ,
6767 'albedo' : 0.1 ,
@@ -76,7 +76,7 @@ def test_systemdef_tmy2():
7676 assert_equals (expected , pvsystem .systemdef (tmy2_metadata , 0 , 0 , .1 , 5 , 5 ))
7777
7878def test_systemdef_dict ():
79- expected = {'tz' : - 8 , ## Note that TZ is float, but Location sets tz as string
79+ expected = {'tz' : - 8 , ## Note that TZ is float, but Location sets tz as string
8080 'albedo' : 0.1 ,
8181 'altitude' : 10 ,
8282 'latitude' : 37.8 ,
@@ -87,7 +87,7 @@ def test_systemdef_dict():
8787 'surface_azimuth' : 0 ,
8888 'surface_tilt' : 5 }
8989 assert_equals (expected , pvsystem .systemdef (meta , 5 , 0 , .1 , 5 , 5 ))
90-
90+
9191
9292def test_ashraeiam ():
9393 thetas = np .linspace (- 90 , 90 , 9 )
@@ -143,10 +143,10 @@ def test_sapm():
143143 index = times )
144144 am = pd .Series ([0 , 2.25 ], index = times )
145145 aoi = pd .Series ([180 , 30 ], index = times )
146-
146+
147147 sapm = pvsystem .sapm (module_parameters , irrad_data ['dni' ],
148148 irrad_data ['dhi' ], 25 , am , aoi )
149-
149+
150150 expected = pd .DataFrame (np .array (
151151 [[ 0. , 0. , 0. , 0. ,
152152 0. , 0. , 0. , 0. ],
@@ -155,7 +155,7 @@ def test_sapm():
155155 columns = ['i_sc' , 'i_mp' , 'v_oc' , 'v_mp' , 'p_mp' , 'i_x' , 'i_xx' ,
156156 'effective_irradiance' ],
157157 index = times )
158-
158+
159159 assert_frame_equal (sapm , expected )
160160
161161 # just make sure it works with a dict input
@@ -174,9 +174,9 @@ def test_PVSystem_sapm():
174174 index = times )
175175 am = pd .Series ([0 , 2.25 ], index = times )
176176 aoi = pd .Series ([180 , 30 ], index = times )
177-
177+
178178 sapm = system .sapm (irrad_data ['dni' ], irrad_data ['dhi' ], 25 , am , aoi )
179-
179+
180180 expected = pd .DataFrame (np .array (
181181 [[ 0. , 0. , 0. , 0. ,
182182 0. , 0. , 0. , 0. ],
@@ -185,13 +185,14 @@ def test_PVSystem_sapm():
185185 columns = ['i_sc' , 'i_mp' , 'v_oc' , 'v_mp' , 'p_mp' , 'i_x' , 'i_xx' ,
186186 'effective_irradiance' ],
187187 index = times )
188-
188+
189189 assert_frame_equal (sapm , expected )
190190
191191
192+ @incompatible_pandas_0180
192193def test_calcparams_desoto ():
193- module = 'Example_Module'
194- module_parameters = sam_data ['cecmod' ][module ]
194+ module = 'Example_Module'
195+ module_parameters = sam_data ['cecmod' ][module ]
195196 times = pd .DatetimeIndex (start = '2015-01-01' , periods = 2 , freq = '12H' )
196197 poa_data = pd .Series ([0 , 800 ], index = times )
197198
@@ -210,8 +211,9 @@ def test_calcparams_desoto():
210211 assert_almost_equals (nNsVth , 0.473 )
211212
212213
214+ @incompatible_pandas_0180
213215def test_PVSystem_calcparams_desoto ():
214- module = 'Example_Module'
216+ module = 'Example_Module'
215217 module_parameters = sam_data ['cecmod' ][module ].copy ()
216218 module_parameters ['EgRef' ] = 1.121
217219 module_parameters ['dEgdT' ] = - 0.0002677
@@ -238,7 +240,7 @@ def test_i_from_v():
238240
239241@incompatible_conda_linux_py3
240242def test_PVSystem_i_from_v ():
241- module = 'Example_Module'
243+ module = 'Example_Module'
242244 module_parameters = sam_data ['cecmod' ][module ]
243245 system = pvsystem .PVSystem (module = module ,
244246 module_parameters = module_parameters )
@@ -247,7 +249,7 @@ def test_PVSystem_i_from_v():
247249
248250
249251def test_singlediode_series ():
250- module = 'Example_Module'
252+ module = 'Example_Module'
251253 module_parameters = sam_data ['cecmod' ][module ]
252254 times = pd .DatetimeIndex (start = '2015-01-01' , periods = 2 , freq = '12H' )
253255 poa_data = pd .Series ([0 , 800 ], index = times )
@@ -257,15 +259,15 @@ def test_singlediode_series():
257259 alpha_isc = module_parameters ['alpha_sc' ],
258260 module_parameters = module_parameters ,
259261 EgRef = 1.121 ,
260- dEgdT = - 0.0002677 )
262+ dEgdT = - 0.0002677 )
261263 out = pvsystem .singlediode (module_parameters , IL , I0 , Rs , Rsh , nNsVth )
262264 assert isinstance (out , pd .DataFrame )
263265
264266
265267@incompatible_conda_linux_py3
266- def test_singlediode_floats ():
267- module = 'Example_Module'
268- module_parameters = sam_data ['cecmod' ][module ]
268+ def test_singlediode_floats ():
269+ module = 'Example_Module'
270+ module_parameters = sam_data ['cecmod' ][module ]
269271 out = pvsystem .singlediode (module_parameters , 7 , 6e-7 , .1 , 20 , .5 )
270272 expected = {'i_xx' : 4.2549732697234193 ,
271273 'i_mp' : 6.1390251797935704 ,
@@ -280,11 +282,11 @@ def test_singlediode_floats():
280282
281283
282284@incompatible_conda_linux_py3
283- def test_PVSystem_singlediode_floats ():
284- module = 'Example_Module'
285+ def test_PVSystem_singlediode_floats ():
286+ module = 'Example_Module'
285287 module_parameters = sam_data ['cecmod' ][module ]
286288 system = pvsystem .PVSystem (module = module ,
287- module_parameters = module_parameters )
289+ module_parameters = module_parameters )
288290 out = system .singlediode (7 , 6e-7 , .1 , 20 , .5 )
289291 expected = {'i_xx' : 4.2549732697234193 ,
290292 'i_mp' : 6.1390251797935704 ,
@@ -323,11 +325,11 @@ def test_sapm_celltemp_with_index():
323325 winds = pd .Series ([10 , 5 , 0 ], index = times )
324326
325327 pvtemps = pvsystem .sapm_celltemp (irrads , winds , temps )
326-
328+
327329 expected = pd .DataFrame ({'temp_cell' :[0. , 23.06066166 , 5. ],
328330 'temp_module' :[0. , 21.56066166 , 5. ]},
329331 index = times )
330-
332+
331333 assert_frame_equal (expected , pvtemps )
332334
333335
@@ -380,7 +382,7 @@ def test_snlinverter_float():
380382
381383 pacs = pvsystem .snlinverter (inverters [testinv ], vdcs , pdcs )
382384 assert_almost_equals (pacs , 132.004278 , 5 )
383-
385+
384386
385387def test_PVSystem_creation ():
386388 pv_system = pvsystem .PVSystem (module = 'blah' , inverter = 'blarg' )
@@ -400,13 +402,13 @@ def test_PVSystem_get_irradiance():
400402 solar_position = location .get_solarposition (times )
401403 irrads = pd .DataFrame ({'dni' :[900 ,0 ], 'ghi' :[600 ,0 ], 'dhi' :[100 ,0 ]},
402404 index = times )
403-
405+
404406 irradiance = system .get_irradiance (solar_position ['apparent_zenith' ],
405407 solar_position ['azimuth' ],
406408 irrads ['dni' ],
407409 irrads ['ghi' ],
408410 irrads ['dhi' ])
409-
411+
410412 expected = pd .DataFrame (data = np .array (
411413 [[ 883.65494055 , 745.86141676 , 137.79352379 , 126.397131 ,
412414 11.39639279 ],
@@ -415,7 +417,7 @@ def test_PVSystem_get_irradiance():
415417 'poa_diffuse' , 'poa_sky_diffuse' ,
416418 'poa_ground_diffuse' ],
417419 index = times )
418-
420+
419421 irradiance = np .round (irradiance , 4 )
420422 expected = np .round (expected , 4 )
421423 assert_frame_equal (irradiance , expected )
@@ -425,7 +427,7 @@ def test_PVSystem_localize_with_location():
425427 system = pvsystem .PVSystem (module = 'blah' , inverter = 'blarg' )
426428 location = Location (latitude = 32 , longitude = - 111 )
427429 localized_system = system .localize (location = location )
428-
430+
429431 assert localized_system .module == 'blah'
430432 assert localized_system .inverter == 'blarg'
431433 assert localized_system .latitude == 32
@@ -435,7 +437,7 @@ def test_PVSystem_localize_with_location():
435437def test_PVSystem_localize_with_latlon ():
436438 system = pvsystem .PVSystem (module = 'blah' , inverter = 'blarg' )
437439 localized_system = system .localize (latitude = 32 , longitude = - 111 )
438-
440+
439441 assert localized_system .module == 'blah'
440442 assert localized_system .inverter == 'blarg'
441443 assert localized_system .latitude == 32
0 commit comments