Skip to content

Commit cf5413c

Browse files
[pre-commit.ci] pre-commit autoupdate (#4587)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 21.12b0 → 22.1.0](psf/black@21.12b0...22.1.0) - [github.com/asottile/blacken-docs: v1.12.0 → v1.12.1](adamchainz/blacken-docs@v1.12.0...v1.12.1) - [github.com/aio-libs/sort-all: v1.1.0 → v1.2.0](aio-libs/sort-all@v1.1.0...v1.2.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent cbc31c7 commit cf5413c

File tree

20 files changed

+55
-59
lines changed

20 files changed

+55
-59
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
- id: no-commit-to-branch
3030

3131
- repo: https://github.com/psf/black
32-
rev: 21.12b0
32+
rev: 22.1.0
3333
hooks:
3434
- id: black
3535
pass_filenames: false
@@ -50,14 +50,14 @@ repos:
5050
args: [--filter-files]
5151

5252
- repo: https://github.com/asottile/blacken-docs
53-
rev: v1.12.0
53+
rev: v1.12.1
5454
hooks:
5555
- id: blacken-docs
5656
types: [file, rst]
5757
additional_dependencies: [black==21.6b0]
5858

5959
- repo: https://github.com/aio-libs/sort-all
60-
rev: v1.1.0
60+
rev: v1.2.0
6161
hooks:
6262
- id: sort-all
6363
types: [file, python]

benchmarks/benchmarks/generate_data/um_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def add_field(level_: int, time_step_: int) -> None:
107107
six_rec = 20 / 3
108108
three_rec = six_rec / 2
109109

110-
new_field.blev = level_1 ** 2 * six_rec - six_rec
110+
new_field.blev = level_1**2 * six_rec - six_rec
111111
new_field.brsvd1 = (
112-
level_1 ** 2 * six_rec + (six_rec * level_1) - three_rec
112+
level_1**2 * six_rec + (six_rec * level_1) - three_rec
113113
)
114114

115115
brsvd2_simulated = np.linspace(0.995, 0, len_z)

benchmarks/benchmarks/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def setup(self):
2222
# Should generate 10 distinct contours, regardless of dim size.
2323
dim_size = int(ARTIFICIAL_DIM_SIZE / 5)
2424
repeat_number = int(dim_size / 10)
25-
repeat_range = range(int((dim_size ** 2) / repeat_number))
25+
repeat_range = range(int((dim_size**2) / repeat_number))
2626
data = np.repeat(repeat_range, repeat_number)
2727
data = data.reshape((dim_size,) * 2)
2828

docs/gallery_code/meteorology/plot_wind_barbs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def main():
3030

3131
# To illustrate the full range of barbs, scale the wind speed up to pretend
3232
# that a storm is passing over
33-
magnitude = (uwind ** 2 + vwind ** 2) ** 0.5
33+
magnitude = (uwind**2 + vwind**2) ** 0.5
3434
magnitude.convert_units("knot")
3535
max_speed = magnitude.collapsed(
3636
("latitude", "longitude"), iris.analysis.MAX
@@ -41,7 +41,7 @@ def main():
4141
vwind = vwind / max_speed * max_desired
4242

4343
# Create a cube containing the wind speed
44-
windspeed = (uwind ** 2 + vwind ** 2) ** 0.5
44+
windspeed = (uwind**2 + vwind**2) ** 0.5
4545
windspeed.rename("windspeed")
4646
windspeed.convert_units("knot")
4747

docs/gallery_code/meteorology/plot_wind_speed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main():
2727
vwind = iris.load_cube(infile, "y_wind")
2828

2929
# Create a cube containing the wind speed.
30-
windspeed = (uwind ** 2 + vwind ** 2) ** 0.5
30+
windspeed = (uwind**2 + vwind**2) ** 0.5
3131
windspeed.rename("windspeed")
3232

3333
# Plot the wind speed as a contour plot.

lib/iris/analysis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ def _lazy_rms(array, axis, **kwargs):
13941394
# all. Thus trying to use this aggregator with weights will currently
13951395
# raise an error in dask due to the unexpected keyword `weights`,
13961396
# rather than silently returning the wrong answer.
1397-
return da.sqrt(da.mean(array ** 2, axis=axis, **kwargs))
1397+
return da.sqrt(da.mean(array**2, axis=axis, **kwargs))
13981398

13991399

14001400
@_build_dask_mdtol_function

lib/iris/analysis/_grid_angles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _angle(p, q, r):
120120
mid_lons = np.deg2rad(q[0])
121121

122122
pr = _3d_xyz_from_latlon(r[0], r[1]) - _3d_xyz_from_latlon(p[0], p[1])
123-
pr_norm = np.sqrt(np.sum(pr ** 2, axis=0))
123+
pr_norm = np.sqrt(np.sum(pr**2, axis=0))
124124
pr_top = pr[1] * np.cos(mid_lons) - pr[0] * np.sin(mid_lons)
125125

126126
index = pr_norm == 0

lib/iris/analysis/_scipy_interpolate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def compute_interp_weights(self, xi, method=None):
229229
xi_shape, method, indices, norm_distances, out_of_bounds = prepared
230230

231231
# Allocate arrays for describing the sparse matrix.
232-
n_src_values_per_result_value = 2 ** ndim
232+
n_src_values_per_result_value = 2**ndim
233233
n_result_values = len(indices[0])
234234
n_non_zero = n_result_values * n_src_values_per_result_value
235235
weights = np.ones(n_non_zero, dtype=norm_distances[0].dtype)

lib/iris/analysis/calculus.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -629,14 +629,10 @@ def curl(i_cube, j_cube, k_cube=None):
629629
# (d/dtheta (i_cube * sin(lat)) - d_j_cube_dphi)
630630
# phi_cmpt = 1/r * ( d/dr (r * j_cube) - d_k_cube_dtheta)
631631
# theta_cmpt = 1/r * ( 1/cos(lat) * d_k_cube_dphi - d/dr (r * i_cube)
632-
if (
633-
y_coord.name()
634-
not in [
635-
"latitude",
636-
"grid_latitude",
637-
]
638-
or x_coord.name() not in ["longitude", "grid_longitude"]
639-
):
632+
if y_coord.name() not in [
633+
"latitude",
634+
"grid_latitude",
635+
] or x_coord.name() not in ["longitude", "grid_longitude"]:
640636
raise ValueError(
641637
"Expecting latitude as the y coord and "
642638
"longitude as the x coord for spherical curl."

lib/iris/analysis/cartography.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _quadrant_area(radian_lat_bounds, radian_lon_bounds, radius_of_earth):
335335
raise ValueError("Bounds must be [n,2] array")
336336

337337
# fill in a new array of areas
338-
radius_sqr = radius_of_earth ** 2
338+
radius_sqr = radius_of_earth**2
339339
radian_lat_64 = radian_lat_bounds.astype(np.float64)
340340
radian_lon_64 = radian_lon_bounds.astype(np.float64)
341341

@@ -1010,8 +1010,8 @@ def _transform_distance_vectors_tolerance_mask(
10101010
# Squared magnitudes should be equal to one within acceptable tolerance.
10111011
# A value of atol=2e-3 is used, which corresponds to a change in magnitude
10121012
# of approximately 0.1%.
1013-
sqmag_1_0 = u_one_t ** 2 + v_zero_t ** 2
1014-
sqmag_0_1 = u_zero_t ** 2 + v_one_t ** 2
1013+
sqmag_1_0 = u_one_t**2 + v_zero_t**2
1014+
sqmag_0_1 = u_zero_t**2 + v_one_t**2
10151015
mask = np.logical_not(
10161016
np.logical_and(
10171017
np.isclose(sqmag_1_0, ones, atol=2e-3),

0 commit comments

Comments
 (0)