Skip to content

Commit

Permalink
ruff compliance for D409 and D410.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkknight committed Dec 20, 2023
1 parent 4bf0ea4 commit 0eee062
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 78 deletions.
2 changes: 0 additions & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ lint.ignore = [
"D405", # Section name should be properly capitalized
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
"D409", # Section underline should match the length of its name
"D410", # Missing blank line after section
"D411", # Missing blank line before section
"D412", # No blank lines allowed between a section header and its content

Expand Down
1 change: 1 addition & 0 deletions lib/iris/analysis/_regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ def _create_cube(data, src, src_dims, tgt_coords, num_tgt_dims, regrid_callback)
regrid_callback : callable
The routine that will be used to calculate the interpolated
values of any reference surfaces.
Returns
-------
cube
Expand Down
8 changes: 4 additions & 4 deletions lib/iris/analysis/cartography.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def wrap_lons(lons, base, period):
[-175. 30. 160. 75.]
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down Expand Up @@ -258,7 +258,7 @@ def get_xy_grids(cube):
x, y = get_xy_grids(cube)
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down Expand Up @@ -289,7 +289,7 @@ def get_xy_contiguous_bounded_grids(cube):
xs, ys = get_xy_contiguous_bounded_grids(cube)
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -499,7 +499,7 @@ def cosine_latitude_weights(cube):
weights = np.sqrt(cosine_latitude_weights(cube))
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down
22 changes: 11 additions & 11 deletions lib/iris/analysis/maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def abs(cube, in_place=False):
An instance of :class:`iris.cube.Cube`.
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -154,7 +154,7 @@ def intersection_of_cubes(cube, other_cube):
cube1, cube2 = (intersections[0], intersections[1])
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -238,7 +238,7 @@ def add(cube, other, dim=None, in_place=False):
iris.cube.Cube
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -293,7 +293,7 @@ def subtract(cube, other, dim=None, in_place=False):
iris.cube.Cube
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -398,7 +398,7 @@ def multiply(cube, other, dim=None, in_place=False):
iris.cube.Cube
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down Expand Up @@ -484,7 +484,7 @@ def divide(cube, other, dim=None, in_place=False):
iris.cube.Cube
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down Expand Up @@ -550,7 +550,7 @@ def exponentiate(cube, exponent, in_place=False):
An instance of :class:`iris.cube.Cube`.
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down Expand Up @@ -601,7 +601,7 @@ def exp(cube, in_place=False):
An instance of :class:`iris.cube.Cube`.
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -631,7 +631,7 @@ def log(cube, in_place=False):
An instance of :class:`iris.cube.Cube`.
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -665,7 +665,7 @@ def log2(cube, in_place=False):
An instance of :class:`iris.cube.Cube`.
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down Expand Up @@ -695,7 +695,7 @@ def log10(cube, in_place=False):
An instance of :class:`iris.cube.Cube`.
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/analysis/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def interpolate(cube, sample_points, method=None):
interpolated_cube = interpolate(cube, sample_points)
Notes
------
-----
This function does not maintain laziness when called; it realises data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down
4 changes: 3 additions & 1 deletion lib/iris/common/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Resolve:
>>> resolver = Resolve(cube1, cube2)
>>> results = [resolver.cube(data) for data in payload]
""" # noqa: D214
""" # noqa: D214, D410

def __init__(self, lhs=None, rhs=None):
"""Resolve the provided ``lhs`` :class:`~iris.cube.Cube` operand and
Expand Down Expand Up @@ -2475,6 +2475,7 @@ def mapped(self):
time 1860-06-01 00:00:00, bound=(1859-12-01 00:00:00, 1860-12-01 00:00:00)
Cell methods:
0 time: mean (interval: 6 hour)
Attributes:
Conventions 'CF-1.5'
Model scenario 'E1'
Expand Down Expand Up @@ -2542,6 +2543,7 @@ def shape(self):
time 1860-06-01 00:00:00, bound=(1859-12-01 00:00:00, 1860-12-01 00:00:00)
Cell methods:
0 time: mean (interval: 6 hour)
Attributes:
Conventions 'CF-1.5'
Model scenario 'E1'
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -4521,7 +4521,7 @@ def rolling_window(self, coord, aggregator, window, **kwargs):
Notice that the forecast_period dimension now represents the 4
possible windows of size 3 from the original cube.
""" # noqa: D214
""" # noqa: D214, D410
# Update weights kwargs (if necessary) to handle different types of
# weights
weights_info = None
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def izip(*cubes, **kwargs):
... pass
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def cmap_norm(cube):
:class:`iris.palette.SymmetricNormalize`
Notes
------
-----
This function maintains laziness when called; it does not realise data.
See more at :doc:`/userguide/real_and_lazy_data`.
Expand Down
6 changes: 3 additions & 3 deletions lib/iris/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def as_cubes(
:class:`~iris.coords.AncillaryVariable` objects.
Returns
--------
-------
:class:`~iris.cube.CubeList`
One :class:`~iris.cube.Cube` for each column not referenced in
`aux_coord_cols`/`cell_measure_cols`/`ancillary_variable_cols`.
Expand Down Expand Up @@ -584,7 +584,7 @@ def as_series(cube, copy=True):
make sure it is not masked and use copy=False.
Notes
------
-----
Since this function converts to/from a Pandas object, laziness will not be preserved.
"""
Expand Down Expand Up @@ -797,7 +797,7 @@ def as_data_frame(
Name: surface_temperature, Length: 419904, dtype: float32
Notes
------
-----
Since this function converts to/from a Pandas object, laziness will not be preserved.
"""
Expand Down
Loading

0 comments on commit 0eee062

Please sign in to comment.