diff --git a/.ruff.toml b/.ruff.toml index 33d5879122..9451023469 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -37,7 +37,6 @@ lint.ignore = [ "D200", # One-line docstring should fit on one line "D202", # No blank lines allowed after function docstring "D205", # 1 blank line required between summary line and description - "D209", # Multi-line docstring closing quotes should be on a separate line "D401", # First line of docstring should be in imperative mood: ... "D404", # First word of the docstring should not be "This" "D405", # Section name should be properly capitalized diff --git a/benchmarks/benchmarks/aux_factory.py b/benchmarks/benchmarks/aux_factory.py index c9881cf60e..6f71e47086 100644 --- a/benchmarks/benchmarks/aux_factory.py +++ b/benchmarks/benchmarks/aux_factory.py @@ -36,8 +36,10 @@ def setup_common(self): self.factory = self.create() def time_create(self): - """Create an instance of the benchmarked factory. create method is - specified in the subclass.""" + """Create an instance of the benchmarked factory. + + Create method is specified in the subclass. + """ self.create() diff --git a/benchmarks/benchmarks/coords.py b/benchmarks/benchmarks/coords.py index 930cddb4f1..f90ed1fd31 100644 --- a/benchmarks/benchmarks/coords.py +++ b/benchmarks/benchmarks/coords.py @@ -43,8 +43,10 @@ def setup_common(self): self.component = self.create() def time_create(self): - """Create an instance of the benchmarked coord. create method is - specified in the subclass.""" + """Create an instance of the benchmarked factory. + + Create method is specified in the subclass. + """ self.create() diff --git a/benchmarks/benchmarks/cube.py b/benchmarks/benchmarks/cube.py index 67abe2577c..ef42e03077 100644 --- a/benchmarks/benchmarks/cube.py +++ b/benchmarks/benchmarks/cube.py @@ -45,8 +45,11 @@ def setup(self): raise NotImplementedError def create(self): - """Generic cube creation. cube_kwargs allow dynamic inclusion of - different components; specified in subclasses.""" + """Generic cube creation. + + cube_kwargs allow dynamic inclusion of different components; + specified in subclasses. + """ return cube.Cube(data=data_2d, **self.cube_kwargs) def setup_common(self): diff --git a/benchmarks/benchmarks/experimental/ugrid/__init__.py b/benchmarks/benchmarks/experimental/ugrid/__init__.py index add9b0d37c..322fe9acc0 100644 --- a/benchmarks/benchmarks/experimental/ugrid/__init__.py +++ b/benchmarks/benchmarks/experimental/ugrid/__init__.py @@ -40,8 +40,10 @@ def create(self): raise NotImplementedError def time_create(self, *params): - """Create an instance of the benchmarked object. create() method is - specified in the subclass.""" + """Create an instance of the benchmarked object. + + create() method is specified in the subclass. + """ self.create() diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index d8a3202fbb..ed5b911b0c 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -16,8 +16,10 @@ class _Segment: - """A single trajectory line segment: Two points, as described in the - Trajectory class.""" + """A single trajectory line segment. + + Two points, as described in the Trajectory class. + """ def __init__(self, p0, p1): # check keys diff --git a/lib/iris/fileformats/_nc_load_rules/helpers.py b/lib/iris/fileformats/_nc_load_rules/helpers.py index ce379a204e..31cc4aaa6c 100644 --- a/lib/iris/fileformats/_nc_load_rules/helpers.py +++ b/lib/iris/fileformats/_nc_load_rules/helpers.py @@ -1542,8 +1542,11 @@ def is_rotated_longitude(engine, cf_name): ################################################################################ def has_supported_mercator_parameters(engine, cf_name): - """Determine whether the CF grid mapping variable has the supported - values for the parameters of the Mercator projection.""" + """Determine whether the CF grid mapping variable has the supported values. + + Determine whether the CF grid mapping variable has the supported + values for the parameters of the Mercator projection. + """ is_valid = True cf_grid_var = engine.cf_var.cf_group[cf_name] @@ -1567,7 +1570,8 @@ def has_supported_mercator_parameters(engine, cf_name): ################################################################################ def has_supported_polar_stereographic_parameters(engine, cf_name): """Determine whether the CF grid mapping variable has the supported - values for the parameters of the Polar Stereographic projection.""" + values for the parameters of the Polar Stereographic projection. + """ is_valid = True cf_grid_var = engine.cf_var.cf_group[cf_name] diff --git a/lib/iris/tests/integration/netcdf/test_general.py b/lib/iris/tests/integration/netcdf/test_general.py index 673b988557..8c27742185 100644 --- a/lib/iris/tests/integration/netcdf/test_general.py +++ b/lib/iris/tests/integration/netcdf/test_general.py @@ -225,8 +225,10 @@ def test_single_packed_unsigned(self): self._single_test("u1", "single_packed_unsigned.cdl") def test_single_packed_manual_scale(self): - """Test saving a single CF-netCDF file with packing with scale - factor and add_offset set manually.""" + """Test saving a single CF-netCDF file. + + File with packing with scale factor and add_offset set manually. + """ self._single_test("i2", "single_packed_manual.cdl", manual=True) def _multi_test(self, CDLfilename, multi_dtype=False): diff --git a/lib/iris/tests/test_plot.py b/lib/iris/tests/test_plot.py index 35133a39d5..64f128c408 100644 --- a/lib/iris/tests/test_plot.py +++ b/lib/iris/tests/test_plot.py @@ -543,7 +543,8 @@ class SliceMixin: """Mixin class providing tests for each 2-dimensional permutation of axes. Requires self.draw_method to be the relevant plotting function, - and self.results to be a dictionary containing the desired test results.""" + and self.results to be a dictionary containing the desired test results. + """ def test_yx(self): cube = self.wind[0, 0, :, :] @@ -727,7 +728,8 @@ class Slice1dMixin: """Mixin class providing tests for each 1-dimensional permutation of axes. Requires self.draw_method to be the relevant plotting function, - and self.results to be a dictionary containing the desired test results.""" + and self.results to be a dictionary containing the desired test results. + """ def test_x(self): cube = self.wind[0, 0, 0, :] diff --git a/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py b/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py index 5ef677ad4a..374e355c32 100644 --- a/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py +++ b/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py @@ -3,7 +3,8 @@ # This file is part of Iris and is released under the BSD license. # See LICENSE in the root of the repository for full licensing details. """Unit tests for the -:func:`iris.analysis._scipy_interpolate._RegularGridInterpolator` class.""" +:func:`iris.analysis._scipy_interpolate._RegularGridInterpolator` class. +""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/coords/test_Cell.py b/lib/iris/tests/unit/coords/test_Cell.py index 0011f6349d..18d34b7d39 100644 --- a/lib/iris/tests/unit/coords/test_Cell.py +++ b/lib/iris/tests/unit/coords/test_Cell.py @@ -140,8 +140,10 @@ def test_PartialDateTime_other(self): class Test_contains_point(tests.IrisTest): - """Test that contains_point works for combinations of datetime, - cf.datatime, and PartialDateTime objects.""" + """Test that contains_point works for combinations. + + Combinations of datetime, cf.datatime, and PartialDateTime objects. + """ def test_datetime_PartialDateTime_point(self): point = PartialDateTime(month=6) @@ -236,7 +238,8 @@ def test_cftime_360_day_cftime_360day_point(self): class Test_numpy_comparison(tests.IrisTest): """Unit tests to check that the results of comparisons with numpy types can be - used as truth values.""" + used as truth values. + """ def test_cell_lhs(self): cell = Cell(point=1.5) diff --git a/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py b/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py index b336c429bc..9ec80cbd50 100644 --- a/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py +++ b/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py @@ -3,7 +3,8 @@ # This file is part of Iris and is released under the BSD license. # See LICENSE in the root of the repository for full licensing details. """Unit tests for the `iris.plot._check_bounds_contiguity_and_mask` -function.""" +function. +""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py b/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py index 1ff7195afb..bf724c443c 100644 --- a/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py +++ b/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py @@ -3,7 +3,8 @@ # This file is part of Iris and is released under the BSD license. # See LICENSE in the root of the repository for full licensing details. """Unit tests for the `iris.plot._check_geostationary_coords_and_convert -function.""" +function. +""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py index fb6de798e8..7b39043559 100644 --- a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py +++ b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py @@ -3,7 +3,8 @@ # This file is part of Iris and is released under the BSD license. # See LICENSE in the root of the repository for full licensing details. """Unit tests for the `iris.plot._get_plot_defn_custom_coords_picked` -function.""" +function. +""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/noxfile.py b/noxfile.py index 4bdde52d41..4d3bb85f98 100644 --- a/noxfile.py +++ b/noxfile.py @@ -47,14 +47,18 @@ def session_cachefile(session: nox.sessions.Session) -> Path: def venv_populated(session: nox.sessions.Session) -> bool: - """Returns True if the conda venv has been created - and the list of packages in the lockfile installed.""" + """List of packages in the lockfile installed. + + Returns True if the conda venv has been created. + """ return session_cachefile(session).is_file() def venv_changed(session: nox.sessions.Session) -> bool: - """Returns True if the installed session is different to that specified - in the lockfile.""" + """Returns True if the installed session is different. + + Compares to that specified in the lockfile. + """ changed = False cache = session_cachefile(session) lockfile = session_lockfile(session)