Skip to content

Commit 31701d1

Browse files
committed
Not sure what this newest black formatting is actually changing
1 parent 40d4be0 commit 31701d1

File tree

26 files changed

+152
-153
lines changed

26 files changed

+152
-153
lines changed

mhkit/acoustics/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
"""
22
The passive acoustics module provides a set of functions
3-
for analyzing and visualizing passive acoustic monitoring
3+
for analyzing and visualizing passive acoustic monitoring
44
data deployed in water bodies. This package reads in raw
5-
*.wav* files and conducts basic acoustics analysis and
5+
*.wav* files and conducts basic acoustics analysis and
66
visualization.
77
88
To start using the module, import it directly from MHKiT:
99
``from mhkit import acoustics``. The analysis functions
10-
are available directly from the main import, while the
11-
I/O and graphics submodules are available from
10+
are available directly from the main import, while the
11+
I/O and graphics submodules are available from
1212
``acoustics.io`` and ``acoustics.graphics``, respectively.
13-
The base functions are intended to be used on top of the I/O submodule, and
14-
include functionality to calibrate data, create spectral densities, sound
13+
The base functions are intended to be used on top of the I/O submodule, and
14+
include functionality to calibrate data, create spectral densities, sound
1515
pressure levels, and time or band aggregate spectral data.
1616
"""
1717

mhkit/acoustics/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def sound_pressure_spectral_density_level(spsd: xr.DataArray) -> xr.DataArray:
337337

338338

339339
def _validate_method(
340-
method: Union[str, Dict[str, Union[float, int]]]
340+
method: Union[str, Dict[str, Union[float, int]]],
341341
) -> Tuple[str, Optional[Union[float, int]]]:
342342
"""
343343
Validates the 'method' parameter and returns the method name and its argument (if any)

mhkit/acoustics/graphics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
This submodule provides essential plotting functions for visualizing passive acoustics
3-
data. The functions allow for customizable plotting of sound pressure spectral density
2+
This submodule provides essential plotting functions for visualizing passive acoustics
3+
data. The functions allow for customizable plotting of sound pressure spectral density
44
levels across time and frequency dimensions.
55
66
Each plotting function leverages the flexibility of Matplotlib, allowing for passthrough
@@ -11,12 +11,12 @@
1111
-------------
1212
1. **plot_spectrogram**:
1313
14-
- Generates a spectrogram plot from sound pressure spectral density level data,
14+
- Generates a spectrogram plot from sound pressure spectral density level data,
1515
with a logarithmic frequency scale by default for improved readability of acoustic data.
1616
1717
2. **plot_spectra**:
1818
19-
- Produces a spectral density plot with a log-transformed x-axis, allowing for clear
19+
- Produces a spectral density plot with a log-transformed x-axis, allowing for clear
2020
visualization of spectral density across frequency bands.
2121
"""
2222

mhkit/acoustics/io.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
This submodule provides input/output functions for passive acoustics data,
33
focusing on hydrophone recordings stored in WAV files. The main functionality
4-
includes reading and processing hydrophone data from various manufacturers
4+
includes reading and processing hydrophone data from various manufacturers
55
and exporting audio files for easy playback and analysis.
66
77
Supported Hydrophone Models
@@ -14,28 +14,28 @@
1414
1515
1. **Data Reading**:
1616
17-
- `read_hydrophone`: Main function to read a WAV file from a hydrophone and
18-
convert it to either a voltage or pressure time series, depending on the
17+
- `read_hydrophone`: Main function to read a WAV file from a hydrophone and
18+
convert it to either a voltage or pressure time series, depending on the
1919
availability of sensitivity data.
2020
21-
- `read_soundtrap`: Wrapper for reading Ocean Instruments SoundTrap hydrophone
21+
- `read_soundtrap`: Wrapper for reading Ocean Instruments SoundTrap hydrophone
2222
files, automatically using appropriate metadata.
2323
24-
- `read_iclisten`: Wrapper for reading Ocean Sonics icListen hydrophone files,
25-
including metadata processing to apply hydrophone sensitivity for direct
24+
- `read_iclisten`: Wrapper for reading Ocean Sonics icListen hydrophone files,
25+
including metadata processing to apply hydrophone sensitivity for direct
2626
sound pressure calculation.
2727
2828
2. **Audio Export**:
2929
30-
- `export_audio`: Converts processed sound pressure data back into a WAV file
30+
- `export_audio`: Converts processed sound pressure data back into a WAV file
3131
format, with optional gain adjustment to improve playback quality.
3232
3333
3. **Data Extraction**:
3434
35-
- `_read_wav_metadata`: Extracts metadata from a WAV file, including bit depth
35+
- `_read_wav_metadata`: Extracts metadata from a WAV file, including bit depth
3636
and other header information.
3737
38-
- `_calculate_voltage_and_time`: Converts raw WAV data into voltage values and
38+
- `_calculate_voltage_and_time`: Converts raw WAV data into voltage values and
3939
generates a time index based on the sampling frequency.
4040
"""
4141

mhkit/dolfyn/adv/clean.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Module containing functions to clean data
2-
"""
1+
"""Module containing functions to clean data"""
32

43
import warnings
54
import numpy as np

mhkit/loads/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
The `loads` package of the MHKiT (Marine and Hydrokinetic Toolkit) library
33
provides tools and functionalities for analyzing and visualizing loads data
4-
from marine and hydrokinetic (MHK) devices. This package is designed to
4+
from marine and hydrokinetic (MHK) devices. This package is designed to
55
assist engineers, researchers, and analysts in understanding the forces and
66
stresses applied to MHK devices under various operational and environmental
77
conditions.

mhkit/loads/extreme/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
and wave data statistics.
44
55
It includes methods for calculating peaks over threshold, estimating
6-
short-term extreme distributions,and performing wave amplitude
6+
short-term extreme distributions,and performing wave amplitude
77
normalization for most likely extreme response analysis.
88
"""
99

mhkit/loads/extreme/extremes.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
"""
22
This module provides functionality for estimating the short-term and
3-
long-term extreme distributions of responses in a time series. It
4-
includes methods for analyzing peaks, block maxima, and applying
5-
statistical distributions to model extreme events. The module supports
6-
various methods for short-term extreme estimation, including peaks
7-
fitting with Weibull, tail fitting, peaks over threshold, and block
8-
maxima methods with GEV (Generalized Extreme Value) and Gumbel
9-
distributions. Additionally, it offers functionality to approximate
10-
the long-term extreme distribution by weighting short-term extremes
3+
long-term extreme distributions of responses in a time series. It
4+
includes methods for analyzing peaks, block maxima, and applying
5+
statistical distributions to model extreme events. The module supports
6+
various methods for short-term extreme estimation, including peaks
7+
fitting with Weibull, tail fitting, peaks over threshold, and block
8+
maxima methods with GEV (Generalized Extreme Value) and Gumbel
9+
distributions. Additionally, it offers functionality to approximate
10+
the long-term extreme distribution by weighting short-term extremes
1111
across different sea states.
1212
1313
Functions:
14-
- ste_peaks: Estimates the short-term extreme distribution from peaks
14+
- ste_peaks: Estimates the short-term extreme distribution from peaks
1515
distribution using specified statistical methods.
1616
- block_maxima: Finds the block maxima in a time-series data to be used
1717
in block maxima methods.
18-
- ste_block_maxima_gev: Approximates the short-term extreme distribution
18+
- ste_block_maxima_gev: Approximates the short-term extreme distribution
1919
using the block maxima method with the GEV distribution.
20-
- ste_block_maxima_gumbel: Approximates the short-term extreme
20+
- ste_block_maxima_gumbel: Approximates the short-term extreme
2121
distribution using the block maxima method with the Gumbel distribution.
22-
- ste: Alias for `short_term_extreme`, facilitating easier access to the
22+
- ste: Alias for `short_term_extreme`, facilitating easier access to the
2323
primary functionality of estimating short-term extremes.
24-
- short_term_extreme: Core function to approximate the short-term extreme
24+
- short_term_extreme: Core function to approximate the short-term extreme
2525
distribution from a time series using chosen methods.
26-
- full_seastate_long_term_extreme: Combines short-term extreme
26+
- full_seastate_long_term_extreme: Combines short-term extreme
2727
distributions using weights to estimate the long-term extreme distribution.
2828
"""
2929

mhkit/loads/extreme/mler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"""
2-
This module provides functionalities to calculate and analyze Most
2+
This module provides functionalities to calculate and analyze Most
33
Likely Extreme Response (MLER) coefficients for wave energy converter
44
design and risk assessment. It includes functions to:
55
66
- Calculate MLER coefficients (`mler_coefficients`) from a sea state
77
spectrum and a response Amplitude Response Operator (ARO).
88
- Define and manipulate simulation parameters (`mler_simulation`) used
99
across various MLER analyses.
10-
- Renormalize the incoming amplitude of the MLER wave
10+
- Renormalize the incoming amplitude of the MLER wave
1111
(`mler_wave_amp_normalize`) to match the desired peak height for more
1212
accurate modeling and analysis.
13-
- Export the wave amplitude time series (`mler_export_time_series`)
13+
- Export the wave amplitude time series (`mler_export_time_series`)
1414
based on the calculated MLER coefficients for further analysis or
1515
visualization.
1616
"""

mhkit/loads/extreme/peaks.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
22
This module provides utilities for analyzing wave data, specifically
33
for identifying significant wave heights and estimating wave peak
4-
distributions using statistical methods.
4+
distributions using statistical methods.
55
66
Functions:
7-
- _calculate_window_size: Calculates the window size for peak
7+
- _calculate_window_size: Calculates the window size for peak
88
independence using the auto-correlation function of wave peaks.
9-
- _peaks_over_threshold: Identifies peaks over a specified
9+
- _peaks_over_threshold: Identifies peaks over a specified
1010
threshold and returns independent storm peak values adjusted by
1111
the threshold.
12-
- global_peaks: Identifies global peaks in a zero-centered
12+
- global_peaks: Identifies global peaks in a zero-centered
1313
response time-series based on consecutive zero up-crossings.
1414
- number_of_short_term_peaks: Estimates the number of peaks within a
1515
specified short-term period.
@@ -20,13 +20,13 @@
2020
- automatic_hs_threshold: Determines the best significant wave height
2121
threshold for the peaks-over-threshold method.
2222
- peaks_distribution_peaks_over_threshold: Estimates the peaks
23-
distribution using the peaks over threshold method by fitting a
23+
distribution using the peaks over threshold method by fitting a
2424
generalized Pareto distribution.
2525
2626
References:
27-
- Neary, V. S., S. Ahn, B. E. Seng, M. N. Allahdadi, T. Wang, Z. Yang,
28-
and R. He (2020). "Characterization of Extreme Wave Conditions for
29-
Wave Energy Converter Design and Project Risk Assessment.” J. Mar.
27+
- Neary, V. S., S. Ahn, B. E. Seng, M. N. Allahdadi, T. Wang, Z. Yang,
28+
and R. He (2020). "Characterization of Extreme Wave Conditions for
29+
Wave Energy Converter Design and Project Risk Assessment.” J. Mar.
3030
Sci. Eng. 2020, 8(4), 289; https://doi.org/10.3390/jmse8040289.
3131
3232
"""

0 commit comments

Comments
 (0)