Skip to content

Commit

Permalink
black v24.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ssolson committed Jan 26, 2024
1 parent 6dba1df commit eb4b896
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 18 deletions.
4 changes: 1 addition & 3 deletions examples/extreme_response_contour_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@
"i = 0\n",
"n = len(hs_samples)\n",
"for hs, te in zip(hs_samples, te_samples):\n",
" tp = te / (\n",
" 0.8255 + 0.03852 * gamma - 0.005537 * gamma**2 + 0.0003154 * gamma**3\n",
" )\n",
" tp = te / (0.8255 + 0.03852 * gamma - 0.005537 * gamma**2 + 0.0003154 * gamma**3)\n",
" i += 1\n",
" print(f\"Sea state {i}/{n}. (Hs, Te) = ({hs} m, {te} s). Tp = {tp} s\")\n",
" # time & frequency arrays\n",
Expand Down
4 changes: 1 addition & 3 deletions examples/extreme_response_full_sea_state_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,7 @@
"i = 0\n",
"n = len(sample_hs)\n",
"for hs, te in zip(sample_hs, sample_te):\n",
" tp = te / (\n",
" 0.8255 + 0.03852 * gamma - 0.005537 * gamma**2 + 0.0003154 * gamma**3\n",
" )\n",
" tp = te / (0.8255 + 0.03852 * gamma - 0.005537 * gamma**2 + 0.0003154 * gamma**3)\n",
" i += 1\n",
" print(f\"Sea state {i}/{n}. (Hs, Te) = ({hs} m, {te} s). Tp = {tp} s\")\n",
" # time & frequency arrays\n",
Expand Down
1 change: 1 addition & 0 deletions mhkit/dolfyn/adp/clean.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Module containing functions to clean data
"""

import numpy as np
import xarray as xr
from scipy.signal import medfilt
Expand Down
1 change: 1 addition & 0 deletions mhkit/dolfyn/adv/clean.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Module containing functions to clean data
"""

import numpy as np
import warnings
from ..velocity import VelBinner
Expand Down
3 changes: 1 addition & 2 deletions mhkit/dolfyn/adv/turbulence.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,7 @@ def _integral_TE01(self, I_tke, theta):
out = np.empty_like(I_tke.flatten())
for i, (b, t) in enumerate(zip(I_tke.flatten(), theta.flatten())):
out[i] = np.trapz(
cbrt(x**2 - 2 / b * np.cos(t) * x + b ** (-2))
* np.exp(-0.5 * x**2),
cbrt(x**2 - 2 / b * np.cos(t) * x + b ** (-2)) * np.exp(-0.5 * x**2),
x,
)

Expand Down
8 changes: 4 additions & 4 deletions mhkit/dolfyn/io/nortek.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ def __init__(
burst_seconds = self.config["n_burst"] / fs
else:
burst_seconds = round(1 / fs, 3)
da[
"duty_cycle_description"
] = "{} second bursts collected at {} Hz, with bursts taken every {} minutes".format(
burst_seconds, fs, self.config["burst_interval"] / 60
da["duty_cycle_description"] = (
"{} second bursts collected at {} Hz, with bursts taken every {} minutes".format(
burst_seconds, fs, self.config["burst_interval"] / 60
)
)
self.burst_start = np.zeros(self.n_samp_guess, dtype="bool")
da["fs"] = self.config["fs"]
Expand Down
1 change: 1 addition & 0 deletions mhkit/mooring/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
dataset = read_moordyn(filepath="FAST.MD.out", input_file="FAST.MD.input")
"""

import os
import pandas as pd

Expand Down
1 change: 1 addition & 0 deletions mhkit/tests/tidal/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Requesting NOAA data with invalid date format
- Requesting NOAA data with the end date before the start date
"""

from os.path import abspath, dirname, join, normpath, relpath
import unittest
import os
Expand Down
1 change: 1 addition & 0 deletions mhkit/tests/utils/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
Author: ssolson
Date: 2023-08-18
"""

import unittest
import hashlib
import tempfile
Expand Down
1 change: 1 addition & 0 deletions mhkit/tests/wave/io/hindcast/test_hindcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Run the script directly as a standalone program, or import the
TestWPTOhindcast class in another test suite.
"""

import unittest
from os.path import abspath, dirname, join, normpath
from pandas.testing import assert_frame_equal
Expand Down
1 change: 1 addition & 0 deletions mhkit/tidal/io/noaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Reads a JSON file containing NOAA data saved from the request_noaa_data
function and returns a DataFrame with timeseries site data and metadata.
"""

import os
import xml.etree.ElementTree as ET
import datetime
Expand Down
1 change: 1 addition & 0 deletions mhkit/utils/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
Author: ssolson
Date: 2023-09-26
"""

import hashlib
import json
import os
Expand Down
1 change: 1 addition & 0 deletions mhkit/utils/upcrossing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"""

import numpy as np


Expand Down
4 changes: 1 addition & 3 deletions mhkit/wave/contours.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,9 +1194,7 @@ def _rosenblatt_copula(x1, x2, fit, component_1, kwargs):
+ mean_cond[3] * component_1**3
)
# Standard deviation of Ln(x2) as a function of x1
sigma_cond = (
std_cond[0] + std_cond[1] * component_1 + std_cond[2] * component_1**2
)
sigma_cond = std_cond[0] + std_cond[1] * component_1 + std_cond[2] * component_1**2
# lognormal inverse
component_2_Rosenblatt = stats.lognorm.ppf(
y_quantile, s=sigma_cond, loc=0, scale=np.exp(lamda_cond)
Expand Down
1 change: 1 addition & 0 deletions mhkit/wave/io/hindcast/hindcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Author: rpauly, aidanbharath, ssolson
Date: 2023-09-26
"""

import os
import sys
from time import sleep
Expand Down
1 change: 1 addition & 0 deletions mhkit/wave/io/hindcast/wind_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
2023-09-26
"""

import os
import hashlib
import pickle
Expand Down
6 changes: 3 additions & 3 deletions mhkit/wave/io/wecsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ def _write_constraint_output(constraint):
if num_constraints == 1:
constraint_output = _write_constraint_output(constraint)
elif num_constraints > 1:
constraint_output[
f"constraint{constraint+1}"
] = _write_constraint_output(constraint)
constraint_output[f"constraint{constraint+1}"] = (
_write_constraint_output(constraint)
)
else:
print("constraint class not used")
constraint_output = []
Expand Down

0 comments on commit eb4b896

Please sign in to comment.