Skip to content

Commit

Permalink
iss #309 formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BiancaMorandi committed May 24, 2022
1 parent 368be1e commit 36c6116
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions brightwind/analyse/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,25 +1180,25 @@ def sector_ratio(wspd_1, wspd_2, wdir, sectors=72, min_wspd=3, direction_bin_arr
data[['Dir78mS', 'Dir58mS', 'Dir38mS']], boom_dir_1=0, boom_dir_2=180, figure_size=(25, 25))
# To return the data of multiple sector ratio plots
sector_ratio(data[['Spd80mN', 'Spd60mN', 'Spd40mN']], data[['Spd80mS', 'Spd60mS', 'Spd40mS']],
bw.sector_ratio(data[['Spd80mN', 'Spd60mN', 'Spd40mN']], data[['Spd80mS', 'Spd60mS', 'Spd40mS']],
data[['Dir78mS', 'Dir58mS', 'Dir38mS']], boom_dir_1=0, boom_dir_2=180, figure_size=(25, 25),
return_data=True)
# To return the data only of one sector ratio plot
fig, num = sector_ratio(data['Spd80mN'], data['Spd80mS'], data['Dir78mS'], boom_dir_1=0, boom_dir_2=180,
fig, num = bw.sector_ratio(data['Spd80mN'], data['Spd80mS'], data['Dir78mS'], boom_dir_1=0, boom_dir_2=180,
return_data=True)
num
# To change boom orientation of subplots
sector_ratio(data[['Spd80mN', 'Spd60mN']], data[['Spd80mS', 'Spd60mS']], data['Dir78mS'], boom_dir_1=[80, 90],
bw.sector_ratio(data[['Spd80mN', 'Spd60mN']], data[['Spd80mS', 'Spd60mS']], data['Dir78mS'], boom_dir_1=[80, 90],
boom_dir_2=[260, 270], figure_size=(25, 25))
# To change boom orientation of some subplots
sector_ratio(data[['Spd80mN', 'Spd60mN']], data[['Spd80mS', 'Spd60mS']], data['Dir78mS'], boom_dir_1=80,
bw.sector_ratio(data[['Spd80mN', 'Spd60mN']], data[['Spd80mS', 'Spd60mS']], data['Dir78mS'], boom_dir_1=80,
boom_dir_2=[260, 270], figure_size=(25, 25))
# To remove plot annotation of all plots
sector_ratio(data[['Spd80mN', 'Spd60mN']], data[['Spd80mS', 'Spd60mS']], data['Dir78mS'], boom_dir_1=80,
bw.sector_ratio(data[['Spd80mN', 'Spd60mN']], data[['Spd80mS', 'Spd60mS']], data['Dir78mS'], boom_dir_1=80,
boom_dir_2=[260, 270], annotate=False, figure_size=(25, 25))
"""

Expand Down Expand Up @@ -1264,7 +1264,7 @@ def sector_ratio(wspd_1, wspd_2, wdir, sectors=72, min_wspd=3, direction_bin_arr

fig = plt.plot_sector_ratio(sec_ratio=sec_rats, wdir=wdir_dict, sec_ratio_dist=sec_rats_dists, col_names=col_names,
boom_dir_1=boom_dir_1, boom_dir_2=boom_dir_2, radial_limits=radial_limits,
annotate=annotate, figure_size=figure_size)
annotate=annotate, figure_size=figure_size, **kwargs)

if return_data:
if len(sec_rats_dists) == 1:
Expand Down
5 changes: 2 additions & 3 deletions brightwind/analyse/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,6 @@ def plot_sector_ratio(sec_ratio, wdir, sec_ratio_dist, col_names, boom_dir_1=-1,
:param figure_size: Figure size in tuple format (width, height)
:type figure_size: tuple
:param kwargs: Additional keyword arguments for matplotlib.pyplot.subplot
:returns: A speed ratio plot showing average speed ratio by sector and scatter of individual data
points.
Expand Down Expand Up @@ -1109,7 +1108,6 @@ def _plot_sector_ratio_subplot(sec_ratio, wdir, sec_ratio_dist, col_names, boom_
:type font_size: int
:param ax: Subplot axes to which the subplot is assigned. If None subplot is displayed on its own.
:type ax: matplotlib.axes._subplots.AxesSubplot or None
:returns: A speed ratio plot showing average speed ratio by sector and scatter of individual
data points.
Expand Down Expand Up @@ -1156,7 +1154,8 @@ def _plot_sector_ratio_subplot(sec_ratio, wdir, sec_ratio_dist, col_names, boom_
annotation_text += '{} divided by {}'.format(col_names[1], col_names[0])
if annotate:
ax.set_title(annotation_text, y=0.004*(font_size-2.5)-0.15)
else: ax.axes.set_xticks(ax.get_xticks(), "")
else:
ax.axes.set_xticks(ax.get_xticks(), "")
ax.scatter(np.radians(wdir), sec_ratio, color=COLOR_PALETTE.secondary, alpha=0.3, s=1)

for item in ([ax.title] + ax.get_xticklabels() + ax.get_yticklabels()):
Expand Down

0 comments on commit 36c6116

Please sign in to comment.