Skip to content

Commit

Permalink
Revert docstring format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf authored Nov 16, 2022
1 parent d762ac5 commit 8b2da9c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion floris/tools/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def plot_turbines(
):
"""
Plot wind plant layout from turbine locations.
Args:
ax (:py:class:`matplotlib.pyplot.axes`): Figure axes.
layout_x (np.array): Wind turbine locations (east-west).
Expand Down Expand Up @@ -69,6 +70,7 @@ def plot_turbines_with_fi(fi: FlorisInterface, ax=None, color=None, yaw_angles=N
"""
Wrapper function to plot turbines which extracts the data
from a FLORIS interface object
Args:
fi (:py:class:`floris.tools.flow_data.FlowData`):
FlowData object.
Expand Down Expand Up @@ -103,6 +105,7 @@ def add_turbine_id_labels(fi: FlorisInterface, ax: plt.Axes, **kwargs):
Adds index labels to a plot based on the given FlorisInterface.
See the pyplot.annotate docs for more info: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.annotate.html.
kwargs are passed to Text (https://matplotlib.org/stable/api/text_api.html#matplotlib.text.Text).
Args:
fi (FlorisInterface): Simulation object to get the layout and index information.
ax (plt.Axes): Axes object to add the labels.
Expand All @@ -118,6 +121,7 @@ def add_turbine_id_labels(fi: FlorisInterface, ax: plt.Axes, **kwargs):
def line_contour_cut_plane(cut_plane, ax=None, levels=None, colors=None, **kwargs):
"""
Visualize a cut_plane as a line contour plot.
Args:
cut_plane (:py:class:`~.tools.cut_plane.CutPlane`):
CutPlane Object.
Expand Down Expand Up @@ -163,6 +167,7 @@ def visualize_cut_plane(
):
"""
Generate pseudocolor mesh plot of the cut_plane.
Args:
cut_plane (:py:class:`~.tools.cut_plane.CutPlane`): 2D
plane through wind plant.
Expand All @@ -174,6 +179,7 @@ def visualize_cut_plane(
contours. Defaults to None.
cmap (str, optional): Colormap specifier. Defaults to
'coolwarm'.
Returns:
im (:py:class:`matplotlib.plt.pcolormesh`): Image handle.
"""
Expand Down Expand Up @@ -229,6 +235,7 @@ def visualize_cut_plane(
def visualize_quiver(cut_plane, ax=None, min_speed=None, max_speed=None, downSamp=1, **kwargs):
"""
Visualize the in-plane flows in a cut_plane using quiver.
Args:
cut_plane (:py:class:`~.tools.cut_plane.CutPlane`): 2D
plane through wind plant.
Expand All @@ -241,6 +248,7 @@ def visualize_quiver(cut_plane, ax=None, min_speed=None, max_speed=None, downSam
downSamp (int, optional): Down sample the number of quiver arrows
from underlying grid.
**kwargs: Additional parameters to pass to `ax.streamplot`.
Returns:
im (:py:class:`matplotlib.plt.pcolormesh`): Image handle.
"""
Expand Down Expand Up @@ -273,6 +281,7 @@ def visualize_quiver(cut_plane, ax=None, min_speed=None, max_speed=None, downSam
def reverse_cut_plane_x_axis_in_plot(ax):
"""
Shortcut method to reverse direction of x-axis.
Args:
ax (:py:class:`matplotlib.pyplot.axes`): Figure axes.
"""
Expand All @@ -294,6 +303,7 @@ def plot_rotor_values(
"""Plots the gridded turbine rotor values. This is intended to be used for
understanding the differences between two sets of values, so each subplot can be
used for inspection of what values are differing, and under what conditions.
Parameters:
values (np.ndarray): The 5-dimensional array of values to plot. Should be:
N wind directions x N wind speeds x N turbines X N rotor points X N rotor points.
Expand All @@ -302,10 +312,12 @@ def plot_rotor_values(
further editing, default False.
save_path (str | None): Where to save the figure, if a value is provided.
t_range is turbine range; i.e. the turbine index to loop over
Returns:
None | tuple[plt.figure, plt.axes, plt.axis, plt.colorbar]: If
`return_fig_objects` is `False, then `None` is returned`, otherwise the primary
figure objects are returned for custom editing.
Example:
from floris.tools.visualization import plot_rotor_values
plot_rotor_values(floris.flow_field.u, wd_index=0, ws_index=0)
Expand Down Expand Up @@ -348,4 +360,4 @@ def plot_rotor_values(
return fig, axes, cbar_ax, cb

if show:
plt.show()
plt.show()

0 comments on commit 8b2da9c

Please sign in to comment.