Skip to content

Commit 1c2737a

Browse files
authored
V07 doc updates (#263)
* docstring fixes 1 * docstring fixes 2 * docstring fixes 3
1 parent 0fdb640 commit 1c2737a

File tree

9 files changed

+64
-58
lines changed

9 files changed

+64
-58
lines changed

mhkit/dolfyn/time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def epoch2date(ep_time, offset_hr=0, to_str=False):
109109
Notes
110110
-----
111111
The specific time instance is set during deployment, usually sync'd to the
112-
deployment computer. The time seen by |dlfn| is in the timezone of the
113-
deployment computer, which is unknown to |dlfn|.
112+
deployment computer. The time seen by DOLfYN is in the timezone of the
113+
deployment computer, which is unknown to DOLfYN.
114114
"""
115115

116116
try:

mhkit/river/io/d3d.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -532,26 +532,26 @@ def turbulent_intensity(data, points='cells', time_index= -1,
532532
533533
Parameters
534534
----------
535-
data: NetCDF4 object
535+
data : NetCDF4 object
536536
A NetCDF4 object that contains spatial data, e.g. velocity or shear
537537
stress, generated by running a Delft3D model.
538-
points: string, DataFrame
538+
points : string, DataFrame
539539
Points to interpolate data onto.
540-
'cells': interpolates all data onto velocity coordinate system (Default).
541-
'faces': interpolates all data onto the TKE coordinate system.
542-
DataFrame of x, y, and z coordinates: Interpolates data onto user
543-
provided points.
544-
time_index: int
540+
'cells': interpolates all data onto velocity coordinate system (Default).
541+
'faces': interpolates all data onto the TKE coordinate system.
542+
DataFrame of x, y, and z coordinates: Interpolates data onto user
543+
provided points.
544+
time_index : int
545545
An integer to pull the time step from the dataset. Default is
546546
late time step -1.
547-
intermediate_values: boolean (optional)
547+
intermediate_values : boolean (optional)
548548
If false the function will return position and turbulent intensity values.
549549
If true the function will return position(x,y,z) and values need to calculate
550550
turbulent intensity (ucx, uxy, uxz and turkin1) in a Dataframe. Default False.
551551
552552
Returns
553553
-------
554-
TI_data: Dataframe
554+
TI_data : Dataframe
555555
If intermediate_values is true all values are output.
556556
If intermediate_values is equal to false only turbulent_intesity and
557557
x, y, and z variables are output.

mhkit/tidal/io/noaa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def request_noaa_data(station, parameter, start_date, end_date,
5151
end_date : str
5252
End date in the format yyyyMMdd
5353
proxy : dict or None
54-
To request data from behind a firewall, define a dictionary of proxy settings,
55-
for example {"http": 'localhost:8080'}
54+
To request data from behind a firewall, define a dictionary of proxy settings,
55+
for example {"http": 'localhost:8080'}
5656
write_json : str or None
5757
Name of json file to write data
5858

mhkit/wave/contours.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def environmental_contours(x1, x2, sea_state_duration, return_period,
7272
-------
7373
copulas: Dictionary
7474
Dictionary of x1 and x2 copula components for each copula method
75-
"""
75+
"""
7676
try:
7777
x1 = np.array(x1)
7878
except:

mhkit/wave/graphics.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -128,48 +128,52 @@ def plot_matrix(
128128

129129
def plot_chakrabarti(H, lambda_w, D, ax=None):
130130
"""
131-
Plots, in the style of Chakrabart (2005), relative importance of viscous,
131+
Plots, in the style of Chakrabarti (2005), relative importance of viscous,
132132
inertia, and diffraction phemonena
133133
Chakrabarti, Subrata. Handbook of Offshore Engineering (2-volume set).
134134
Elsevier, 2005.
135135
136-
Parameters
137-
----------
138-
H: float or numpy array or pandas Series
139-
Wave height [m]
140-
lambda_w: float or numpy array or pandas Series
141-
Wave length [m]
142-
D: float or numpy array or pandas Series
143-
Characteristic length [m]
144-
ax : matplotlib axes object (optional)
145-
Axes for plotting. If None, then a new figure is created.
146-
147-
Returns
148-
-------
149-
ax : matplotlib pyplot axes
136+
Examples:
150137
151-
Examples
152-
--------
153138
**Using floats**
139+
154140
>>> plt.figure()
155141
>>> D = 5
156142
>>> H = 8
157143
>>> lambda_w = 200
158144
>>> wave.graphics.plot_chakrabarti(H, lambda_w, D)
145+
159146
**Using numpy array**
147+
160148
>>> plt.figure()
161149
>>> D = np.linspace(5,15,5)
162150
>>> H = 8*np.ones_like(D)
163151
>>> lambda_w = 200*np.ones_like(D)
164152
>>> wave.graphics.plot_chakrabarti(H, lambda_w, D)
153+
165154
**Using pandas DataFrame**
155+
166156
>>> plt.figure()
167157
>>> D = np.linspace(5,15,5)
168158
>>> H = 8*np.ones_like(D)
169159
>>> lambda_w = 200*np.ones_like(D)
170-
>>> df = pd.DataFrame([H.flatten(),lambda_w.flatten(),D.flatten()], \
171-
index=['H','lambda_w','D']).transpose()
160+
>>> df = pd.DataFrame([H.flatten(),lambda_w.flatten(),D.flatten()], index=['H','lambda_w','D']).transpose()
172161
>>> wave.graphics.plot_chakrabarti(df.H, df.lambda_w, df.D)
162+
163+
Parameters
164+
----------
165+
H: float or numpy array or pandas Series
166+
Wave height [m]
167+
lambda_w: float or numpy array or pandas Series
168+
Wave length [m]
169+
D: float or numpy array or pandas Series
170+
Characteristic length [m]
171+
ax : matplotlib axes object (optional)
172+
Axes for plotting. If None, then a new figure is created.
173+
174+
Returns
175+
-------
176+
ax : matplotlib pyplot axes
173177
"""
174178
assert isinstance(H, (np.ndarray, float, int, np.int64,pd.Series)), \
175179
'H must be a real numeric type'
@@ -305,6 +309,7 @@ def plot_environmental_contour(x1, x2, x1_contour, x2_contour, **kwargs):
305309
'''
306310
Plots an overlay of the x1 and x2 variables to the calculate
307311
environmental contours.
312+
308313
Parameters
309314
----------
310315
x1: numpy array
@@ -331,6 +336,7 @@ def plot_environmental_contour(x1, x2, x1_contour, x2_contour, **kwargs):
331336
Default None.
332337
markers: string
333338
string or list of strings to use as marker types
339+
334340
Returns
335341
-------
336342
ax : matplotlib pyplot axes

mhkit/wave/io/hindcast/hindcast.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
spectrum data.
77
88
Functions:
9-
- region_selection(lat_lon): Returns the name of the predefined region for
10-
given latitude and longitude coordinates.
11-
- request_wpto_point_data(data_type, parameter, lat_lon, years, tree=None,
12-
unscale=True, str_decode=True, hsds=True): Returns data from the WPTO wave
13-
hindcast hosted on AWS at the specified latitude and longitude point(s) for
14-
the requested data type, parameter, and years.
15-
- request_wpto_directional_spectrum(lat_lon, year, tree=None, unscale=True,
16-
str_decode=True, hsds=True): Returns directional spectra data from the WPTO
17-
wave hindcast hosted on AWS at the specified latitude and longitude point(s)
18-
for the given year.
9+
- region_selection(lat_lon): Returns the name of the predefined region for
10+
given latitude and longitude coordinates.
11+
- request_wpto_point_data(data_type, parameter, lat_lon, years, tree=None,
12+
unscale=True, str_decode=True, hsds=True): Returns data from the WPTO wave
13+
hindcast hosted on AWS at the specified latitude and longitude point(s) for
14+
the requested data type, parameter, and years.
15+
- request_wpto_directional_spectrum(lat_lon, year, tree=None, unscale=True,
16+
str_decode=True, hsds=True): Returns directional spectra data from the WPTO
17+
wave hindcast hosted on AWS at the specified latitude and longitude point(s)
18+
for the given year.
1919
2020
Dependencies:
21-
- sys
22-
- time.sleep
23-
- pandas
24-
- xarray
25-
- numpy
26-
- rex.MultiYearWaveX, rex.WaveX
21+
- sys
22+
- time.sleep
23+
- pandas
24+
- xarray
25+
- numpy
26+
- rex.MultiYearWaveX, rex.WaveX
2727
"""
2828
import sys
2929
from time import sleep
@@ -113,7 +113,7 @@ def request_wpto_point_data(
113113
data_type : string
114114
Data set type of interest
115115
Options: '3-hour' '1-hour'
116-
parameter: string or list of strings
116+
parameter : string or list of strings
117117
Dataset parameter to be downloaded
118118
3-hour dataset options: 'directionality_coefficient',
119119
'energy_period', 'maximum_energy_direction'
@@ -127,7 +127,7 @@ def request_wpto_point_data(
127127
'significant_wave_height', 'spectral_width',
128128
'water_depth', 'maximim_energy_direction',
129129
'mean_wave_direction', 'frequency_bin_edges'
130-
lat_lon: tuple or list of tuples
130+
lat_lon : tuple or list of tuples
131131
Latitude longitude pairs at which to extract data
132132
years : list
133133
Year(s) to be accessed. The years 1979-2010 available.
@@ -149,7 +149,7 @@ def request_wpto_point_data(
149149
path : string (optional)
150150
Optionally override with a custom .h5 filepath. Useful when setting
151151
`hsds=False`.
152-
as_xarray: bool (optional)
152+
as_xarray : bool (optional)
153153
Boolean flag to return data as an xarray Dataset. Default = False
154154
155155
Returns

mhkit/wave/io/hindcast/wind_toolkit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def request_wtk_point_data(time_interval, parameter, lat_lon, years, preferred_r
156156
time_interval : string
157157
Data set type of interest
158158
Options: '1-hour' '5-minute'
159-
parameter: string or list of strings
159+
parameter : string or list of strings
160160
Dataset parameter to be downloaded. Other parameters may be available.
161161
This list is limited to those available at both 5-minute and 1-hour
162162
time intervals for all regions.
@@ -176,7 +176,7 @@ def request_wtk_point_data(time_interval, parameter, lat_lon, years, preferred_r
176176
'windspeed_60m', 'windspeed_80m', 'windspeed_100m',
177177
'windspeed_120m', 'windspeed_140m', 'windspeed_160m',
178178
'windspeed_180m', 'windspeed_200m'
179-
lat_lon: tuple or list of tuples
179+
lat_lon : tuple or list of tuples
180180
Latitude longitude pairs at which to extract data. Use plot_region() or
181181
region_selection() to see the corresponding region for a given location.
182182
years : list

mhkit/wave/io/ndbc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ def available_data(parameter, buoy_number=None, proxy=None):
133133
'swr1': 'Spectral Wave Current Year Historical Data (r1)'
134134
'swr2': 'Spectral Wave Current Year Historical Data (r2)'
135135
'stdmet': 'Standard Meteorological Current Year Historical Data'
136-
'cwind' : 'Continuous Winds Current Year Historical Data'
136+
'cwind' : 'Continuous Winds Current Year Historical Data'
137137
138138
buoy_number: string (optional)
139-
Buoy Number. 5-character alpha-numeric station identifier
139+
Buoy Number. 5-character alpha-numeric station identifier
140140
141141
proxy: dict
142-
Proxy dict passed to python requests,
142+
Proxy dict passed to python requests,
143143
(e.g. proxy_dict= {"http": 'http:wwwproxy.yourProxy:80/'})
144144
145145
Returns

mhkit/wave/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ def energy_period_to_peak_period(Te, gamma):
649649
and Recommendations to the 23rd ITTC", Proceedings of the 23rd ITTC - Volume
650650
2, Table A4.
651651
652-
Parameters:
652+
Parameters
653653
----------
654654
Te: float or array
655655
Spectral energy period [s]

0 commit comments

Comments
 (0)