Skip to content

Commit 0b30366

Browse files
committed
black formatting
1 parent d13bb22 commit 0b30366

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

mhkit/tests/wave/test_resource_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_wave_length(self):
122122
for k in [k_int]:
123123
l_calculated = wave.resource.wave_length(k)
124124
self.assertTrue(np.all(2.0 * np.pi / k == l_calculated))
125-
125+
126126
for k in [k_array, k_float, k_df, k_series]:
127127
l_calculated = wave.resource.wave_length(k)
128128
self.assertTrue(np.all(2.0 * np.pi / k == l_calculated))

mhkit/tests/wave/test_resource_spectrum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_user_spectrum_without_frequency_index_name_defined(self):
168168

169169
expected_magnitude = [-0.983917, 1.274248, -2.129812]
170170

171-
assert_allclose(result.values[:,0], expected_magnitude, atol=1e-6)
171+
assert_allclose(result.values[:, 0], expected_magnitude, atol=1e-6)
172172

173173
def test_ifft_sum_of_sines(self):
174174
S = wave.resource.jonswap_spectrum(self.f, self.Tp, self.Hs)

mhkit/wave/resource.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def elevation_spectrum(
5353
# TODO: Add confidence intervals, equal energy frequency spacing, and NDBC
5454
# frequency spacing
5555
# TODO: may need to raise an error for the length of nnft- signal.welch breaks when nfft is too short
56-
eta = convert_to_dataset(eta,"eta")
56+
eta = convert_to_dataset(eta, "eta")
5757
if not isinstance(sample_rate, (float, int)):
5858
raise TypeError(
5959
f"sample_rate must be of type int or float. Got: {type(sample_rate)}"
@@ -287,11 +287,11 @@ def surface_elevation(
287287
Returns
288288
---------
289289
eta: pandas DataFrame or xarray Dataset
290-
Wave surface elevation [m] indexed by time [s]. Type depends on
290+
Wave surface elevation [m] indexed by time [s]. Type depends on
291291
number of variables in eta and value of the to_pandas flag.
292292
293293
"""
294-
S = convert_to_dataset(S,"S")
294+
S = convert_to_dataset(S, "S")
295295
time_index = to_numeric_array(time_index, "time_index")
296296
if not isinstance(seed, (type(None), int)):
297297
raise TypeError(f"If specified, seed must be of type int. Got: {type(seed)}")
@@ -373,7 +373,9 @@ def surface_elevation(
373373
if phases is None:
374374
np.random.seed(seed)
375375
phase = xr.DataArray(
376-
data=2 * np.pi * np.random.random_sample(S_subset[frequency_dimension].shape),
376+
data=2
377+
* np.pi
378+
* np.random.random_sample(S_subset[frequency_dimension].shape),
377379
dims=frequency_dimension,
378380
coords={frequency_dimension: f},
379381
)

0 commit comments

Comments
 (0)