Skip to content

ruff compliance for D409 and D410. #5662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,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
"D412", # No blank lines allowed between a section header and its content

# pyupgrade (UP)
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
6 changes: 3 additions & 3 deletions 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, D411
""" # noqa: D214, D410, D411

def __init__(self, lhs=None, rhs=None):
"""Resolve the provided ``lhs`` :class:`~iris.cube.Cube` operand and
Expand Down Expand Up @@ -2493,7 +2493,7 @@ def mapped(self):
>>> resolver.map_rhs_to_lhs
False

""" # noqa: D214, D411
""" # noqa: D214, D410, D411
result = None
if self.mapping is not None:
result = self._src_cube.ndim == len(self.mapping)
Expand Down Expand Up @@ -2554,5 +2554,5 @@ def shape(self):
>>> Resolve(cube2, cube1).shape
(240, 37, 49)

""" # noqa: D214, D411
""" # noqa: D214, D410, D411
return self._broadcast_shape
3 changes: 2 additions & 1 deletion lib/iris/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -4521,7 +4521,8 @@ 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, D411
""" # noqa: D214, D410, D411

# Update weights kwargs (if necessary) to handle different types of
# weights
weights_info = None
Expand Down
3 changes: 1 addition & 2 deletions lib/iris/fileformats/dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ def _dot_node(indent, id, name, attributes):
The visual name of the node.
attributes:
An iterable of (name, value) attribute pairs.

""" # noqa: D411
""" # noqa: D410, D411
attributes = r"\n".join("%s: %s" % item for item in attributes)
template = """%(indent)s"%(id)s" [
%(indent)s label = "%(name)s|%(attributes)s"
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