@@ -4171,7 +4171,11 @@ def test_reshape(self):
41714171
41724172 freq_expect = (2.0 * np .pi ) * y
41734173 dirs_expect = (np .pi / 180.0 ) * x
4174- vals_expect = np .array ([[a * x_i + b * y_i for x_i in x ] for y_i in y ]) * (180.0 / np .pi ) / (2.0 * np .pi )
4174+ vals_expect = (
4175+ np .array ([[a * x_i + b * y_i for x_i in x ] for y_i in y ])
4176+ * (180.0 / np .pi )
4177+ / (2.0 * np .pi )
4178+ )
41754179
41764180 freq_out = grid_reshaped ._freq
41774181 dirs_out = grid_reshaped ._dirs
@@ -4198,7 +4202,11 @@ def test_reshape2(self):
41984202
41994203 freq_expect = (2.0 * np .pi ) * y
42004204 dirs_expect = (np .pi / 180.0 ) * x
4201- vals_expect = np .array ([[a * x_i + b * y_i for x_i in x ] for y_i in y ]) * (180.0 / np .pi ) / (2.0 * np .pi )
4205+ vals_expect = (
4206+ np .array ([[a * x_i + b * y_i for x_i in x ] for y_i in y ])
4207+ * (180.0 / np .pi )
4208+ / (2.0 * np .pi )
4209+ )
42024210
42034211 freq_out = grid_reshaped ._freq
42044212 dirs_out = grid_reshaped ._dirs
@@ -4239,7 +4247,9 @@ def test_reshape_complex_rectangular(self):
42394247 vals_imag_expect = np .array (
42404248 [[a_imag * x_i + b_imag * y_i for x_i in x ] for y_i in y ]
42414249 )
4242- vals_expect = (vals_real_expect + 1j * vals_imag_expect ) * (180.0 / np .pi ) / (2.0 * np .pi )
4250+ vals_expect = (
4251+ (vals_real_expect + 1j * vals_imag_expect ) * (180.0 / np .pi ) / (2.0 * np .pi )
4252+ )
42434253
42444254 np .testing .assert_array_almost_equal (freq_out , freq_expect )
42454255 np .testing .assert_array_almost_equal (dirs_out , dirs_expect )
@@ -4272,9 +4282,11 @@ def test_reshape_complex_polar(self):
42724282
42734283 freq_expect = (2.0 * np .pi ) * y
42744284 dirs_expect = (np .pi / 180.0 ) * x
4275- vals_amp_expect = np .array (
4276- [[a_amp * x_i + b_amp * y_i for x_i in x ] for y_i in y ]
4277- ) * (180.0 / np .pi ) / (2.0 * np .pi )
4285+ vals_amp_expect = (
4286+ np .array ([[a_amp * x_i + b_amp * y_i for x_i in x ] for y_i in y ])
4287+ * (180.0 / np .pi )
4288+ / (2.0 * np .pi )
4289+ )
42784290 x_ , y_ = np .meshgrid (x , y , indexing = "ij" , sparse = True )
42794291 vals_phase_cos_expect = RGI ((xp , yp ), np .cos (vp_phase ).T )((x_ , y_ )).T
42804292 vals_phase_sin_expect = RGI ((xp , yp ), np .sin (vp_phase ).T )((x_ , y_ )).T
@@ -4289,6 +4301,7 @@ def test_reshape_complex_polar(self):
42894301 np .testing .assert_array_almost_equal (dirs_out , dirs_expect )
42904302 np .testing .assert_array_almost_equal (vals_out , vals_expect )
42914303
4304+
42924305class Test_DirectionalBinSpectrum :
42934306 def test__init___hz_deg (self ):
42944307 freq_in = np .arange (0.0 , 1 , 0.1 )
@@ -5088,7 +5101,6 @@ def test_extreme_absmax(self):
50885101
50895102 assert extreme_out == pytest .approx (extreme_expect )
50905103
5091-
50925104 def test_reshape (self ):
50935105 a = 7
50945106 b = 6
@@ -5103,7 +5115,9 @@ def test_reshape(self):
51035115
51045116 freq_expect = (2.0 * np .pi ) * y
51055117 dirs_expect = (np .pi / 180.0 ) * xp
5106- vals_expect = np .array ([[a * x_i + b * y_i for x_i in xp ] for y_i in y ]) / (2.0 * np .pi )
5118+ vals_expect = np .array ([[a * x_i + b * y_i for x_i in xp ] for y_i in y ]) / (
5119+ 2.0 * np .pi
5120+ )
51075121
51085122 freq_out = grid_reshaped ._freq
51095123 dirs_out = grid_reshaped ._dirs
@@ -5128,7 +5142,9 @@ def test_reshape2(self):
51285142
51295143 freq_expect = (2.0 * np .pi ) * y
51305144 dirs_expect = (np .pi / 180.0 ) * xp
5131- vals_expect = np .array ([[a * x_i + b * y_i for x_i in xp ] for y_i in y ]) / (2.0 * np .pi )
5145+ vals_expect = np .array ([[a * x_i + b * y_i for x_i in xp ] for y_i in y ]) / (
5146+ 2.0 * np .pi
5147+ )
51325148
51335149 freq_out = grid_reshaped ._freq
51345150 dirs_out = grid_reshaped ._dirs
@@ -5152,9 +5168,7 @@ def test_reshape_complex_rectangular(self):
51525168 spectrum = DirectionalBinSpectrum (yp , xp , vp , freq_hz = True , degrees = True )
51535169
51545170 y = np .linspace (0.5 , 1.0 , 20 )
5155- grid_reshaped = spectrum .reshape (
5156- y , freq_hz = True , complex_convert = "rectangular"
5157- )
5171+ grid_reshaped = spectrum .reshape (y , freq_hz = True , complex_convert = "rectangular" )
51585172
51595173 freq_out = grid_reshaped ._freq
51605174 dirs_out = grid_reshaped ._dirs
@@ -5190,9 +5204,7 @@ def test_reshape_complex_polar(self):
51905204 spectrum = DirectionalBinSpectrum (yp , xp , vp , freq_hz = True , degrees = True )
51915205
51925206 y = np .linspace (0.5 , 1.0 , 20 )
5193- grid_reshaped = spectrum .reshape (
5194- y , freq_hz = True , complex_convert = "polar"
5195- )
5207+ grid_reshaped = spectrum .reshape (y , freq_hz = True , complex_convert = "polar" )
51965208
51975209 freq_out = grid_reshaped ._freq
51985210 dirs_out = grid_reshaped ._dirs
0 commit comments