From a8da1fbc83be85dbb5b1f9c9777c48afde029d8b Mon Sep 17 00:00:00 2001 From: tkknight <2108488+tkknight@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:16:03 +0000 Subject: [PATCH] ruff complliance for D406. (#5670) --- .ruff.toml | 1 - lib/iris/common/resolve.py | 6 +++--- lib/iris/cube.py | 2 +- lib/iris/fileformats/pp_load_rules.py | 2 +- lib/iris/tests/test_concatenate.py | 2 +- .../unit/fileformats/netcdf/saver/test_Saver__ugrid.py | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index eca1660fbf..939b7f0019 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -38,7 +38,6 @@ lint.ignore = [ "D205", # 1 blank line required between summary line and description "D401", # First line of docstring should be in imperative mood: ... "D404", # First word of the docstring should not be "This" - "D406", # Section name should end with a newline # pyupgrade (UP) # https://docs.astral.sh/ruff/rules/#pyupgrade-up diff --git a/lib/iris/common/resolve.py b/lib/iris/common/resolve.py index 3885a94a14..992e6134c4 100644 --- a/lib/iris/common/resolve.py +++ b/lib/iris/common/resolve.py @@ -205,7 +205,7 @@ class Resolve: >>> resolver = Resolve(cube1, cube2) >>> results = [resolver.cube(data) for data in payload] - """ # noqa: D214, D407, D410, D411 + """ # noqa: D214, D406, D407, D410, D411 def __init__(self, lhs=None, rhs=None): """Resolve the provided ``lhs`` :class:`~iris.cube.Cube` operand and @@ -2474,7 +2474,7 @@ def mapped(self): >>> resolver.map_rhs_to_lhs False - """ # noqa: D214, D407, D410, D411 + """ # noqa: D214, D406, D407, D410, D411 result = None if self.mapping is not None: result = self._src_cube.ndim == len(self.mapping) @@ -2535,5 +2535,5 @@ def shape(self): >>> Resolve(cube2, cube1).shape (240, 37, 49) - """ # noqa: D214, D407, D410, D411 + """ # noqa: D214, D406, D407, D410, D411 return self._broadcast_shape diff --git a/lib/iris/cube.py b/lib/iris/cube.py index d414cc3e09..d60dd342b4 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -4547,7 +4547,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, D407, D410, D411 + """ # noqa: D214, D406, D407, D410, D411 # Update weights kwargs (if necessary) to handle different types of # weights diff --git a/lib/iris/fileformats/pp_load_rules.py b/lib/iris/fileformats/pp_load_rules.py index e128ff0ad8..a74d9a234c 100644 --- a/lib/iris/fileformats/pp_load_rules.py +++ b/lib/iris/fileformats/pp_load_rules.py @@ -808,7 +808,7 @@ def _model_level_number(lblev): lblev : int PP field LBLEV value. - Returns: + Returns ------- Model level number (int). diff --git a/lib/iris/tests/test_concatenate.py b/lib/iris/tests/test_concatenate.py index 0d13b17cf3..cb26150d61 100644 --- a/lib/iris/tests/test_concatenate.py +++ b/lib/iris/tests/test_concatenate.py @@ -180,7 +180,7 @@ def _make_cube_3d(x, y, z, data, aux=None, offset=0): Offset value to be added to non-1D auxiliary coordinate points. - Returns: + Returns ------- The newly created 3D :class:`iris.cube.Cube`. diff --git a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py index a9f8a9b16d..290cf0cfaf 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py +++ b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py @@ -309,7 +309,7 @@ def vars_meshdim(vars, location, mesh_name=None): If given, identifies the mesh var. Otherwise, find a unique mesh var (i.e. there must be exactly 1). - Returns: + Returns ------- dim_name : str The dim-name of the mesh dim for the given location.