@@ -36,30 +36,45 @@ def test_v_wind_hub(self):
3636 data_height = {'v_wind' : 10 ,
3737 'v_wind_2' : 8 }
3838
39- # Test weather dictionary with pandas.Series
40- # v_wind is closer to hub height than v_wind_2
39+ # v_wind is closer to hub height than v_wind_2 # TODO: Add test for v_wind_2 is closer to hub height than v_wind
4140 v_wind_exp = pd .Series (data = [7.74137 , 10.06377 ])
42- assert_series_equal (self . test_mc .v_wind_hub (weather , data_height ),
41+ assert_series_equal (test_mc .v_wind_hub (weather , data_height ),
4342 v_wind_exp )
43+ assert_series_equal (test_mc .v_wind_hub (weather_df , data_height ),
44+ v_wind_exp )
45+ v_wind_exp = np .array ([7.74136523 , 10.0637748 ])
46+ assert_allclose (test_mc .v_wind_hub (weather_arr , data_height ),
47+ v_wind_exp )
48+ v_wind_exp = pd .Series (data = [7.12462 , 9.26201 ])
49+ assert_series_equal (test_mc_2 .v_wind_hub (weather , data_height ),
50+ v_wind_exp )
51+ assert_series_equal (test_mc_2 .v_wind_hub (weather_df , data_height ),
52+ v_wind_exp )
53+ v_wind_exp = np .array ([7.12462437 , 9.26201168 ])
54+ assert_allclose (test_mc_2 .v_wind_hub (weather_arr , data_height ),
55+ v_wind_exp )
56+
4457 # v_wind is given at hub height
45- v_wind_exp = pd .Series (data = [5.0 , 6.5 ])
4658 data_height ['v_wind' ] = 100
47- assert_series_equal (
48- self .test_mc .v_wind_hub (weather , data_height ),
49- v_wind_exp )
59+ v_wind_exp = pd .Series (data = [5.0 , 6.5 ])
60+ assert_series_equal (test_mc .v_wind_hub (weather , data_height ),
61+ v_wind_exp )
62+ assert_series_equal (test_mc .v_wind_hub (weather_df , data_height ),
63+ v_wind_exp )
64+ v_wind_exp = np .array ([5.0 , 6.5 ])
65+ assert_array_equal (test_mc_2 .v_wind_hub (weather_arr , data_height ),
66+ v_wind_exp )
67+
5068 # v_wind_2 is given at hub height
5169 v_wind_exp = pd .Series (data = [4.0 , 5.0 ])
5270 data_height ['v_wind' ] = 10
5371 data_height ['v_wind_2' ] = 100
54- assert_series_equal (
55- self .test_mc .v_wind_hub (weather , data_height ),
56- v_wind_exp )
57- # Test weather DataFrame
58- assert_series_equal (self .test_mc .v_wind_hub (weather_df , data_height ),
72+ assert_series_equal (test_mc_2 .v_wind_hub (weather , data_height ),
73+ v_wind_exp )
74+ assert_series_equal (test_mc_2 .v_wind_hub (weather_df , data_height ),
5975 v_wind_exp )
60- # Test weather dictionary with numpy.arrays
6176 v_wind_exp = np .array ([4.0 , 5.0 ])
62- assert_array_equal (self . test_mc .v_wind_hub (weather_arr , data_height ),
77+ assert_array_equal (test_mc_2 .v_wind_hub (weather_arr , data_height ),
6378 v_wind_exp )
6479
6580 def test_rho_hub (self ):
0 commit comments