Skip to content

Commit 8139b9e

Browse files
committed
update mhkit.utils docstring formatting
1 parent 7710d97 commit 8139b9e

4 files changed

Lines changed: 4 additions & 42 deletions

File tree

mhkit/utils/stat_utils.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
for vector/directional statistics. The module also provides utility functions
66
to unwrap vectors, compute magnitudes and phases in 2D/3D, and calculate
77
the root mean squared values of vector components.
8-
9-
Functions:
10-
----------
11-
- get_statistics: Calculates statistics for continuous data.
12-
- vector_statistics: Calculates vector mean and standard deviation.
13-
- unwrap_vector: Unwraps vector data to fall within a 0-360 degree range.
14-
- magnitude_phase: Computes magnitude and phase for 2D or 3D data.
15-
- unorm: Computes root mean squared value of 3D vectors.
168
"""
179

1810
from typing import List, Dict, Optional, Tuple, Union
@@ -193,7 +185,7 @@ def vector_statistics(
193185

194186
def unwrap_vector(data: Union[pd.Series, np.ndarray, list]) -> np.ndarray:
195187
"""
196-
Function used to unwrap vectors into 0-360 deg range
188+
Unwraps vector data to a 0-360 degree range.
197189
198190
Parameters
199191
------------
@@ -235,7 +227,7 @@ def magnitude_phase(
235227
Tuple[Union[float, np.ndarray], Union[float, np.ndarray], Union[float, np.ndarray]],
236228
]:
237229
"""
238-
Retuns magnitude and phase in two or three dimensions.
230+
Retuns magnitude and phase for 2D or 3D data.
239231
240232
Parameters
241233
----------

mhkit/utils/time_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
"""
22
This module provides utility functions for converting datetime formats
33
from MATLAB and Excel to Python datetime formats.
4-
5-
Functions:
6-
----------
7-
- matlab_to_datetime: Converts MATLAB datenum format to Python datetime.
8-
- excel_to_datetime: Converts Excel datenum format to Python datetime.
94
"""
105

116
from typing import Union
@@ -21,7 +16,7 @@ def matlab_to_datetime(
2116
matlab_datenum: Union[np.ndarray, list, float, int],
2217
) -> pd.DatetimeIndex:
2318
"""
24-
Convert MATLAB datenum format to Python datetime
19+
Converts MATLAB datenum format to Python datetime
2520
2621
Parameters
2722
------------

mhkit/utils/type_handling.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
to xarray structures such as xarray.DataArray and xarray.Dataset. It also
44
includes functions for handling nested dictionaries containing pandas
55
DataFrames by converting them to xarray Datasets.
6-
7-
Functions:
8-
----------
9-
- to_numeric_array: Converts input data to a numeric NumPy array.
10-
- convert_to_dataset: Converts pandas or xarray data structures to xarray.Dataset.
11-
- convert_to_dataarray: Converts various data types to xarray.DataArray.
12-
- convert_nested_dict_and_pandas: Recursively converts pandas DataFrames
13-
in nested dictionaries to xarray Datasets.
146
"""
157

168
from typing import Union, Dict, Any

mhkit/utils/upcrossing.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
11
"""
2-
Upcrossing Analysis Functions
3-
=============================
42
This module contains a collection of functions that facilitate upcrossing
53
analyses.
64
7-
Key Functions:
8-
--------------
9-
- `upcrossing`: Finds the zero upcrossing points.
10-
- `peaks`: Finds the peaks between zero crossings.
11-
- `troughs`: Finds the troughs between zero crossings.
12-
- `heights`: Calculates the height between zero crossings.
13-
- `periods`: Calculates the period between zero crossings.
14-
- `custom`: Applies a custom, user-defined function between zero crossings.
15-
16-
Author:
5+
Authors:
176
-------
187
mbruggs
198
akeeste
20-
21-
Date:
22-
-----
23-
2023-10-10
24-
25-
269
"""
2710

2811
from typing import Callable, Optional

0 commit comments

Comments
 (0)