Skip to content

Commit f0ca543

Browse files
committed
linting
1 parent e1047ef commit f0ca543

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

docs/source/recipes/plot_17_recipe.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@
9191
if i == 0:
9292
set_title = "Perceptually uniform\ncolour maps"
9393
elif i == 1:
94-
set_title = (
95-
"NCL colour maps enhanced to \nhelp with colour blindness"
96-
)
94+
set_title = "NCL colour maps enhanced to \nhelp with colour blindness"
9795
elif i == 2:
9896
set_title = "Orography/bathymetry\ncolour maps"
9997
else:

docs/source/recipes/plot_18_recipe.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
# %%
1414
# 1. Import cf-python, cf-plot and other required packages:
1515
import cfplot as cfp
16-
import cf
17-
1816
import matplotlib.pyplot as plt
1917
import scipy.stats.mstats as mstats
2018

19+
import cf
20+
2121
# %%
2222
# 2. Read the data in and unpack the Fields from FieldLists using indexing.
2323
# In our example We are investigating the influence of the land height on
@@ -62,7 +62,7 @@
6262
# unitless fraction, but the values are in the tens, so we need to
6363
# normalise these to all lie between 0 and 1 and change the units
6464
# appropriately:
65-
sub_snow = ((sub_snow - sub_snow.minimum()) / (sub_snow.range()))
65+
sub_snow = (sub_snow - sub_snow.minimum()) / (sub_snow.range())
6666
sub_snow.override_units("1", inplace=True)
6767

6868
# %%
@@ -93,7 +93,9 @@
9393
# and its strength visually. We use 'gpos' to position the plots in two
9494
# columns and apply some specific axes ticks and labels for clarity.
9595
cfp.gopen(
96-
rows=1, columns=2, top=0.85,
96+
rows=1,
97+
columns=2,
98+
top=0.85,
9799
file="snow_and_orog_on_same_grid.png",
98100
user_position=True,
99101
)
@@ -131,10 +133,12 @@
131133
# Don't add extentions on the colourbar since it can only be 0 to 1 inclusive
132134
cfp.levs(min=0, max=1, step=0.1, extend="neither")
133135
cfp.cscale("precip_11lev", ncols=11, reverse=1)
134-
cfp.con(sub_snow, lines=False,
135-
title="Snow cover extent (from satellite imagery)",
136-
colorbar_drawedges=False,
137-
**label_info
136+
cfp.con(
137+
sub_snow,
138+
lines=False,
139+
title="Snow cover extent (from satellite imagery)",
140+
colorbar_drawedges=False,
141+
**label_info,
138142
)
139143

140144
cfp.gclose()

docs/source/recipes/plot_20_recipe.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# %%
1111
# 1. Import cf-python and cf-plot:
1212
import cfplot as cfp
13+
1314
import cf
1415

1516
# %%
@@ -81,14 +82,15 @@
8182
cfp.mapset(resolution="10m")
8283
cfp.cscale("ncl_default")
8384
cfp.gopen(
84-
file=f"irish-sea-currents-divergence-{chosen_time.replace(' ', '-')}.png")
85+
file=f"irish-sea-currents-divergence-{chosen_time.replace(' ', '-')}.png"
86+
)
8587
cfp.vect(u=u_2, v=v_2, stride=6, scale=3, key_length=1)
8688
cfp.con(
8789
div,
8890
lines=False,
8991
title=(
9092
f"Depth-averaged Irish Sea currents at {chosen_time} with "
9193
"their divergence"
92-
)
94+
),
9395
)
9496
cfp.gclose()

0 commit comments

Comments
 (0)