@@ -435,38 +435,52 @@ def test_modelchain_with_power_coefficient_curve_as_dict(self):
435435
436436 def test_heigths_as_string (self ):
437437 """Test run_model if data heights are of type string."""
438- test_turbine = {'hub_height' : 100 ,
439- 'rotor_diameter' : 80 ,
440- 'turbine_type' : 'E-126/4200' }
438+ test_turbine = {
439+ "hub_height" : 100 ,
440+ "rotor_diameter" : 80 ,
441+ "turbine_type" : "E-126/4200" ,
442+ }
441443
442444 # Convert data heights to str
443445 string_weather = self .weather_df .copy ()
444- string_weather .columns = pd .MultiIndex .from_arrays ([
445- string_weather .columns .get_level_values (0 ),
446- string_weather .columns .get_level_values (1 ).astype (str )])
446+ string_weather .columns = pd .MultiIndex .from_arrays (
447+ [
448+ string_weather .columns .get_level_values (0 ),
449+ string_weather .columns .get_level_values (1 ).astype (str ),
450+ ]
451+ )
447452
448453 # Heights in the original DataFrame are of type np.int64
449- assert isinstance (self .weather_df .columns .get_level_values (1 )[0 ],
450- np .int64 )
454+ assert isinstance (
455+ self .weather_df .columns .get_level_values (1 )[0 ], np .int64
456+ )
451457 assert isinstance (string_weather .columns .get_level_values (1 )[0 ], str )
452458
453- test_modelchain = {'power_output_model' : 'power_curve' ,
454- 'density_corr' : True }
455- test_mc = mc .ModelChain (wt .WindTurbine (** test_turbine ),
456- ** test_modelchain )
459+ test_modelchain = {
460+ "power_output_model" : "power_curve" ,
461+ "density_corr" : True ,
462+ }
463+ test_mc = mc .ModelChain (
464+ wt .WindTurbine (** test_turbine ), ** test_modelchain
465+ )
457466 test_mc .run_model (string_weather )
458467
459468 def test_weather_with_nan_values (self , recwarn ):
460469 """Test warning if weather data contain nan values."""
461- test_turbine = {'hub_height' : 100 ,
462- 'rotor_diameter' : 80 ,
463- 'turbine_type' : 'E-126/4200' }
470+ test_turbine = {
471+ "hub_height" : 100 ,
472+ "rotor_diameter" : 80 ,
473+ "turbine_type" : "E-126/4200" ,
474+ }
464475 nan_weather = self .weather_df .copy ()
465476 nan_weather .loc [1 , ("temperature" , 10 )] = np .nan
466- test_modelchain = {'power_output_model' : 'power_curve' ,
467- 'density_corr' : True }
468- test_mc = mc .ModelChain (wt .WindTurbine (** test_turbine ),
469- ** test_modelchain )
477+ test_modelchain = {
478+ "power_output_model" : "power_curve" ,
479+ "density_corr" : True ,
480+ }
481+ test_mc = mc .ModelChain (
482+ wt .WindTurbine (** test_turbine ), ** test_modelchain
483+ )
470484 msg = "'temperature', 10"
471485 with pytest .warns (WindpowerlibUserWarning , match = msg ):
472486 test_mc .run_model (nan_weather )
0 commit comments