diff --git a/.ruff.toml b/.ruff.toml index 03fe7d4863..33d5879122 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -43,8 +43,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 # pyupgrade (UP) # https://docs.astral.sh/ruff/rules/#pyupgrade-up diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index c4a71e97e8..c0613028e3 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -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`. """ @@ -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`. """ @@ -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`. @@ -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`. """ diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index dc0b2158b6..3d1df8d66f 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -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`. @@ -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`. @@ -236,7 +236,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`. @@ -289,7 +289,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`. @@ -392,7 +392,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`. """ @@ -476,7 +476,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`. """ @@ -542,7 +542,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`. """ @@ -593,7 +593,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`. @@ -623,7 +623,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`. @@ -657,7 +657,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`. @@ -687,7 +687,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`. diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 53dcc0ceac..d8a3202fbb 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -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`. """ diff --git a/lib/iris/common/resolve.py b/lib/iris/common/resolve.py index ec73792915..84ea6eed24 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, D411 + """ # noqa: D214, D410, D411 def __init__(self, lhs=None, rhs=None): """Resolve the provided ``lhs`` :class:`~iris.cube.Cube` operand and @@ -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) @@ -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 diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 3b53eaee9d..1199831b7b 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -4517,7 +4517,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 diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index ff0e26bf84..3c24145073 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -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" diff --git a/lib/iris/iterate.py b/lib/iris/iterate.py index c4565d05c9..41b3929464 100644 --- a/lib/iris/iterate.py +++ b/lib/iris/iterate.py @@ -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`. """ diff --git a/lib/iris/palette.py b/lib/iris/palette.py index acea46432a..3180f1e02a 100644 --- a/lib/iris/palette.py +++ b/lib/iris/palette.py @@ -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`. diff --git a/lib/iris/pandas.py b/lib/iris/pandas.py index ed33990f5c..dd7d0d31fc 100644 --- a/lib/iris/pandas.py +++ b/lib/iris/pandas.py @@ -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`. @@ -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. """ @@ -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. """ diff --git a/lib/iris/plot.py b/lib/iris/plot.py index b4e20c57af..06dfe79aa9 100644 --- a/lib/iris/plot.py +++ b/lib/iris/plot.py @@ -1057,7 +1057,7 @@ def contour(cube, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1085,7 +1085,7 @@ def contourf(cube, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1159,7 +1159,7 @@ def default_projection(cube): ax = plt.ax(projection=default_projection(cube)) Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1181,7 +1181,7 @@ def default_projection_extent(cube, mode=iris.coords.POINT_MODE): The default is iris.coords.POINT_MODE. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1223,7 +1223,7 @@ def orography_at_bounds(cube, facecolor="#888888", coords=None, axes=None): """Plots orography defined at cell boundaries from the given Cube. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1262,7 +1262,7 @@ def orography_at_points(cube, facecolor="#888888", coords=None, axes=None): """Plots orography defined at sample points from the given Cube. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1311,7 +1311,7 @@ def outline(cube, coords=None, color="k", linewidth=None, axes=None): provided. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1357,7 +1357,7 @@ def pcolor(cube, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1395,7 +1395,7 @@ def pcolormesh(cube, *args, **kwargs): valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1424,7 +1424,7 @@ def points(cube, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1516,7 +1516,7 @@ def barbs(u_cube, v_cube, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1570,7 +1570,7 @@ def quiver(u_cube, v_cube, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1620,7 +1620,7 @@ def plot(*args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1656,7 +1656,7 @@ def scatter(x, y, *args, **kwargs): valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1695,7 +1695,7 @@ def fill_between(x, y1, y2, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1729,7 +1729,7 @@ def hist(x, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1778,7 +1778,7 @@ def symbols(x, y, symbols, size, axes=None, units="inches"): The unit for the symbol size. Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1906,7 +1906,7 @@ def animate(cube_iterator, plot_func, fig=None, **kwargs): >>> iplt.show() Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. diff --git a/lib/iris/quickplot.py b/lib/iris/quickplot.py index 8ed76866aa..fcb0b0d5b7 100644 --- a/lib/iris/quickplot.py +++ b/lib/iris/quickplot.py @@ -154,7 +154,7 @@ def contour(cube, *args, **kwargs): See :func:`iris.plot.contour` for details of valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -185,7 +185,7 @@ def contourf(cube, *args, **kwargs): See :func:`iris.plot.contourf` for details of valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -216,7 +216,7 @@ def outline(cube, coords=None, color="k", linewidth=None, axes=None): width in patch.linewidth in matplotlibrc is used. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -235,7 +235,7 @@ def pcolor(cube, *args, **kwargs): See :func:`iris.plot.pcolor` for details of valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -252,7 +252,7 @@ def pcolormesh(cube, *args, **kwargs): See :func:`iris.plot.pcolormesh` for details of valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -270,7 +270,7 @@ def points(cube, *args, **kwargs): See :func:`iris.plot.points` for details of valid keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -290,7 +290,7 @@ def plot(*args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -309,7 +309,7 @@ def scatter(x, y, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -327,7 +327,7 @@ def fill_between(x, y1, y2, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -344,7 +344,7 @@ def hist(x, *args, **kwargs): keyword arguments. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ diff --git a/lib/iris/util.py b/lib/iris/util.py index ae26b77539..59a171fa04 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -67,7 +67,7 @@ def broadcast_to_shape(array, shape, dim_map): result = broadcast_to_shape(a, (96, 48, 12), (1, 0)) Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -138,7 +138,7 @@ def delta(ndarray, dimension, circular=False): array([90, 90, 90, 90]) Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -192,7 +192,7 @@ def describe_diff(cube_a, cube_b, output_file=None): scope of this function. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -248,7 +248,7 @@ def guess_coord_axis(coord): 'T', 'Z', 'Y', 'X', or None. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -320,7 +320,7 @@ def rolling_window(a, window=1, step=1, axis=-1): [ 6., 7., 8.]]) Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -376,7 +376,7 @@ def array_equal(array1, array2, withnans=False): with additional support for arrays of strings and NaN-tolerant operation. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -411,7 +411,7 @@ def approx_equal(a, b, max_absolute_error=1e-10, max_relative_error=1e-10): will return False. Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -464,7 +464,7 @@ def between(lh, rh, lh_inclusive=True, rh_inclusive=True): print(i, between_3_and_6(i)) Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -522,7 +522,7 @@ def reverse(cube_or_array, coords_or_dims): [15 14 13 12]]] Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -598,7 +598,7 @@ def monotonic(array, strict=False, return_direction=False): will be: ``(monotonic_status, direction)`` Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -653,7 +653,7 @@ def column_slices_generator(full_slice, ndims): approach of [(3, 5), : , (1, 6, 8)] for column based indexing. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1028,7 +1028,7 @@ def clip_string(the_str, clip_length=70, rider="..."): original string is returned unaltered. Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1061,7 +1061,7 @@ def format_array(arr): For customisations, use the :mod:`numpy.core.arrayprint` directly. Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1113,7 +1113,7 @@ def new_axis(src_cube, scalar_coord=None, expand_extras=()): # maybe not lazy (1, 360, 360) Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1225,7 +1225,7 @@ def squeeze(cube): (360, 360) Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1298,7 +1298,7 @@ def is_regular(coord): """Determine if the given coord is regular. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1315,7 +1315,7 @@ def regular_step(coord): """Return the regular step from a coord or fail. Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1351,7 +1351,7 @@ def regular_points(zeroth, step, count): The number of point values. Notes - ------ + ----- This function does maintain laziness when called; it doesn't realise data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1377,7 +1377,7 @@ def points_step(points): Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. """ @@ -1410,7 +1410,7 @@ def unify_time_units(cubes): An iterable containing :class:`iris.cube.Cube` instances. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1556,7 +1556,7 @@ def promote_aux_coord_to_dim_coord(cube, name_or_coord): time x - - Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1685,7 +1685,7 @@ def demote_dim_coord_to_aux_coord(cube, name_or_coord): year x - - Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1783,7 +1783,7 @@ def find_discontiguities(cube, rel_tol=1e-5, abs_tol=1e-8): iplt.pcolormesh(masked_cube_slice) Notes - ------ + ----- This function does not maintain laziness when called; it realises data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -1968,7 +1968,7 @@ def equalise_attributes(cubes): A list of dicts holding the removed attributes. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. @@ -2040,7 +2040,7 @@ def is_masked(array): Whether or not the array has any masks. Notes - ------ + ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`.