diff --git a/.ruff.toml b/.ruff.toml index 85e01e3204..71304cbd22 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -38,15 +38,12 @@ lint.ignore = [ "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 - "D211", # No blank lines allowed before class docstring - "D300", # triple double quotes `""" / Use triple single quotes `'''` "D401", # First line of docstring should be in imperative mood: ... - "D403", # First word of the first line should be capitalized "D404", # First word of the docstring should not be "This" "D405", # Section name should be properly capitalized "D406", # Section name should end with a newline "D407", # Missing dashed underline after section - "D412", # No blank lines allowed between a section header and its content + "D409", # Section underline should match the length of its name # pyupgrade (UP) # https://docs.astral.sh/ruff/rules/#pyupgrade-up diff --git a/benchmarks/benchmarks/aux_factory.py b/benchmarks/benchmarks/aux_factory.py index aed50c2854..c9881cf60e 100644 --- a/benchmarks/benchmarks/aux_factory.py +++ b/benchmarks/benchmarks/aux_factory.py @@ -18,7 +18,6 @@ class FactoryCommon: # * make class an ABC # * remove NotImplementedError # * combine setup_common into setup - """A base class running a generalised suite of benchmarks for any factory. Factory to be specified in a subclass. diff --git a/benchmarks/benchmarks/cube.py b/benchmarks/benchmarks/cube.py index 8fcea35499..67abe2577c 100644 --- a/benchmarks/benchmarks/cube.py +++ b/benchmarks/benchmarks/cube.py @@ -30,7 +30,6 @@ class ComponentCommon: # * make class an ABC # * remove NotImplementedError # * combine setup_common into setup - """A base class running a generalised suite of benchmarks for cubes that include a specified component (e.g. Coord, CellMeasure etc.). Component to be specified in a subclass. diff --git a/docs/gallery_code/general/plot_SOI_filtering.py b/docs/gallery_code/general/plot_SOI_filtering.py index 9c4fad51bd..5082162068 100644 --- a/docs/gallery_code/general/plot_SOI_filtering.py +++ b/docs/gallery_code/general/plot_SOI_filtering.py @@ -11,7 +11,6 @@ References ---------- - Duchon C. E. (1979) Lanczos Filtering in One and Two Dimensions. Journal of Applied Meteorology, Vol 18, pp 1016-1022. diff --git a/docs/gallery_code/meteorology/plot_COP_1d.py b/docs/gallery_code/meteorology/plot_COP_1d.py index 1f56a7b293..d5ef2a9990 100644 --- a/docs/gallery_code/meteorology/plot_COP_1d.py +++ b/docs/gallery_code/meteorology/plot_COP_1d.py @@ -11,7 +11,6 @@ References ---------- - Johns T.C., et al. (2011) Climate change under aggressive mitigation: the ENSEMBLES multi-model experiment. Climate Dynamics, Vol 37, No. 9-10, doi:10.1007/s00382-011-1005-5. diff --git a/docs/gallery_code/meteorology/plot_COP_maps.py b/docs/gallery_code/meteorology/plot_COP_maps.py index 714ee8896b..eda8a3a53a 100644 --- a/docs/gallery_code/meteorology/plot_COP_maps.py +++ b/docs/gallery_code/meteorology/plot_COP_maps.py @@ -9,7 +9,6 @@ References ---------- - Johns T.C., et al. (2011) Climate change under aggressive mitigation: the ENSEMBLES multi-model experiment. Climate Dynamics, Vol 37, No. 9-10, doi:10.1007/s00382-011-1005-5. diff --git a/lib/iris/analysis/_grid_angles.py b/lib/iris/analysis/_grid_angles.py index 6a0ba3e1a4..d50f55125f 100644 --- a/lib/iris/analysis/_grid_angles.py +++ b/lib/iris/analysis/_grid_angles.py @@ -22,9 +22,9 @@ def _3d_xyz_from_latlon(lon, lat): Arrays of longitudes and latitudes, in degrees. Both the same shape. - Returns: - - * xyz : (array, dtype=float64) + Returns + ------- + xyz : array, dtype=float64 Cartesian coordinates on a unit sphere. Shape is (3, ). The x / y / z coordinates are in xyz[0 / 1 / 2]. @@ -52,9 +52,9 @@ def _latlon_from_xyz(xyz): Shape (3, ). x / y / z values are in xyz[0 / 1 / 2], - Returns: - - * lonlat : (array) + Returns + ------- + lonlat : array longitude and latitude position angles, in degrees. Shape (2, ). The longitudes / latitudes are in lonlat[0 / 1]. @@ -104,9 +104,9 @@ def _angle(p, q, r): Shape is (2, ). Longitudes / latitudes are in array[0 / 1]. - Returns: - - * angle : (float array) + Returns + ------- + angle : float array Grid angles relative to true-East, in degrees. Positive when grid-East is anticlockwise from true-East. Shape is same as . @@ -178,23 +178,22 @@ def gridcell_angles(x, y=None, cell_angle_boundpoints="mid-lhs, mid-rhs"): takes an angles between the average of the left-hand and right-hand pairs of corners. The default is 'mid-lhs, mid-rhs'. - Returns: - - angles : (2-dimensional cube) - - Cube of angles of grid-x vector from true Eastward direction for - each gridcell, in degrees. - It also has "true" longitude and latitude coordinates, with no - coordinate system. - When the input has coords, then the output ones are identical if - the inputs are true-latlons, otherwise they are transformed - true-latlon versions. - When the input has bounded coords, then the output coords have - matching bounds and centrepoints (possibly transformed). - When the input is 2d arrays, or has unbounded coords, then the - output coords have matching points and no bounds. - When the input is 3d arrays, then the output coords have matching - bounds, and the centrepoints are an average of the 4 boundpoints. + Returns + ------- + angles : 2-dimensional cube + Cube of angles of grid-x vector from true Eastward direction for + each gridcell, in degrees. + It also has "true" longitude and latitude coordinates, with no + coordinate system. + When the input has coords, then the output ones are identical if + the inputs are true-latlons, otherwise they are transformed + true-latlon versions. + When the input has bounded coords, then the output coords have + matching bounds and centrepoints (possibly transformed). + When the input is 2d arrays, or has unbounded coords, then the + output coords have matching points and no bounds. + When the input is 3d arrays, then the output coords have matching + bounds, and the centrepoints are an average of the 4 boundpoints. """ cube = None @@ -423,15 +422,17 @@ def rotate_grid_vectors(u_cube, v_cube, grid_angles_cube=None, grid_angles_kwarg Additional keyword args to be passed to the :func:`gridcell_angles` method, if it is used. - Returns: - - true_u, true_v : (cube) - Cubes of true-north oriented vector components. - Units are same as inputs. + Returns + ------- + true_u, true_v : cube + Cubes of true-north oriented vector components. + Units are same as inputs. - .. Note:: + Notes + ----- + .. note:: - Vector magnitudes will always be the same as the inputs. + Vector magnitudes will always be the same as the inputs. .. note:: diff --git a/lib/iris/analysis/_interpolation.py b/lib/iris/analysis/_interpolation.py index 7c28d24efa..b6e443c95c 100644 --- a/lib/iris/analysis/_interpolation.py +++ b/lib/iris/analysis/_interpolation.py @@ -296,9 +296,10 @@ def _interpolate(self, data, interp_points): The other (leading) dimensions index over the different required sample points. - Returns: - - A :class:`np.ndarray`. Its shape is "points_shape + extra_shape", + Returns + ------- + :class:`np.ndarray`. + Its shape is "points_shape + extra_shape", where "extra_shape" is the remaining non-interpolated dimensions of the data array (i.e. 'data.shape[N:]'), and "points_shape" is the leading dimensions of interp_points, diff --git a/lib/iris/analysis/_scipy_interpolate.py b/lib/iris/analysis/_scipy_interpolate.py index bf1796f91e..251fb4bf70 100644 --- a/lib/iris/analysis/_scipy_interpolate.py +++ b/lib/iris/analysis/_scipy_interpolate.py @@ -40,7 +40,6 @@ def _ndim_coords_from_arrays(points, ndim=None): # source: https://github.com/scipy/scipy/blob/b94a5d5ccc08dddbc88453477ff2625\ # 9aeaafb32/scipy/interpolate/interpolate.py#L1400 class _RegularGridInterpolator: - """Interpolation on a regular grid in arbitrary dimensions. The data must be defined on a regular grid; the grid spacing however may be diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index ea1cb9a851..c0613028e3 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -482,8 +482,8 @@ def cosine_latitude_weights(cube): w_l = \cos \phi_l - Examples: - + Examples + -------- Compute weights suitable for averaging type operations:: from iris.analysis.cartography import cosine_latitude_weights diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index 0855bee2fe..3d1df8d66f 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -218,7 +218,6 @@ def add(cube, other, dim=None, in_place=False): Parameters ---------- - cube : iris.cube.Cube First operand to add. @@ -234,7 +233,6 @@ def add(cube, other, dim=None, in_place=False): Returns ------- - iris.cube.Cube Notes @@ -273,7 +271,6 @@ def subtract(cube, other, dim=None, in_place=False): Parameters ---------- - cube : iris.cube.Cube Cube from which to subtract. @@ -289,7 +286,6 @@ def subtract(cube, other, dim=None, in_place=False): Returns ------- - iris.cube.Cube Notes @@ -378,7 +374,6 @@ def multiply(cube, other, dim=None, in_place=False): Parameters ---------- - cube : iris.cube.Cube First operand to multiply. @@ -394,7 +389,6 @@ def multiply(cube, other, dim=None, in_place=False): Returns ------- - iris.cube.Cube Notes @@ -464,7 +458,6 @@ def divide(cube, other, dim=None, in_place=False): Parameters ---------- - cube : iris.cube.Cube Numerator. @@ -480,7 +473,6 @@ def divide(cube, other, dim=None, in_place=False): Returns ------- - iris.cube.Cube Notes diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index 60124044f1..33214ef5e0 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -999,7 +999,6 @@ def __init__( Parameters ---------- - central_lat : float The latitude of the pole. @@ -1113,7 +1112,6 @@ def __init__( Parameters ---------- - central_lat : {90, -90} The latitude of the pole. diff --git a/lib/iris/cube.py b/lib/iris/cube.py index b3b5f5a384..1199831b7b 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -772,7 +772,6 @@ class CubeAttrsDict(MutableMapping): Examples -------- - >>> from iris.cube import Cube >>> cube = Cube([0]) >>> # CF defines 'history' as global by default. @@ -829,7 +828,6 @@ def __init__( Examples -------- - >>> from iris.cube import CubeAttrsDict >>> # CF defines 'history' as global by default. >>> CubeAttrsDict({'history': 'data-story', 'comment': 'this-cube'}) @@ -2364,11 +2362,11 @@ def mesh(self): :class:`~iris.experimental.ugrid.MeshCoord`\\ s, or ``None`` if it has none. - Returns: - - * mesh (:class:`iris.experimental.ugrid.mesh.Mesh` or None): + Returns + ------- + mesh : :class:`iris.experimental.ugrid.mesh.Mesh` or None The mesh of the cube - :class:`~iris.experimental.ugrid.MeshCoord`\\s, + :class:`~iris.experimental.ugrid.MeshCoord`'s, or ``None``. """ @@ -2383,13 +2381,12 @@ def location(self): :class:`~iris.experimental.ugrid.MeshCoord`\\ s, or ``None`` if it has none. - Returns: - - * location (str or None): + Returns + ------- + location : str or None The mesh location of the cube - :class:`~iris.experimental.ugrid.MeshCoord`\\s - (i.e. one of 'face' / 'edge' / 'node'), - or ``None``. + :class:`~iris.experimental.ugrid.MeshCoord`'s + (i.e. one of 'face' / 'edge' / 'node'), or ``None``. """ result = self._any_meshcoord() @@ -2402,10 +2399,10 @@ def mesh_dim(self): :class:`~iris.experimental.ugrid.MeshCoord`\\ s, or ``None`` if it has none. - Returns: - - * mesh_dim (int, or None): - the cube dimension which the cube + Returns + ------- + mesh_dim : int or None + The cube dimension which the cube :class:`~iris.experimental.ugrid.MeshCoord`\\s map to, or ``None``. @@ -4191,7 +4188,6 @@ def aggregated_by(self, coords, aggregator, climatological=False, **kwargs): Examples -------- - >>> import iris >>> import iris.analysis >>> import iris.coord_categorisation as cat diff --git a/lib/iris/experimental/ugrid/mesh.py b/lib/iris/experimental/ugrid/mesh.py index 98fd08d643..14bb313474 100644 --- a/lib/iris/experimental/ugrid/mesh.py +++ b/lib/iris/experimental/ugrid/mesh.py @@ -2140,7 +2140,7 @@ def _add(self, coords): setattr(self, member_y, coords[1]) def add(self, node_x=None, node_y=None, edge_x=None, edge_y=None): - """use self.remove(edge_x=True) to remove a coordinate e.g., using the + """Use self.remove(edge_x=True) to remove a coordinate e.g., using the pattern self.add(edge_x=None) will not remove the edge_x coordinate. """ diff --git a/lib/iris/fileformats/_nc_load_rules/helpers.py b/lib/iris/fileformats/_nc_load_rules/helpers.py index 288161deb6..ce379a204e 100644 --- a/lib/iris/fileformats/_nc_load_rules/helpers.py +++ b/lib/iris/fileformats/_nc_load_rules/helpers.py @@ -266,10 +266,10 @@ def _split_cell_methods(nc_cell_methods: str) -> List[re.Match]: * nc_cell_methods: The value of the cell methods attribute to be split. - Returns: - - * nc_cell_methods_matches: A list of the re.Match objects associated with - each parsed cell method + Returns + ------- + nc_cell_methods_matches: list of re.Match objects + A list of re.Match objects associated with each parsed cell method Splitting is done based on words followed by colons outside of any brackets. Validation of anything other than being laid out in the expected format is @@ -337,10 +337,9 @@ def parse_cell_methods(nc_cell_methods): * nc_cell_methods (str): The value of the cell methods attribute to be parsed. - Returns: - - * cell_methods - An iterable of :class:`iris.coords.CellMethod`. + Returns + ------- + iterable of :class:`iris.coords.CellMethod`. Multiple coordinates, intervals and comments are supported. If a method has a non-standard name a warning will be issued, but the diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index 0acc03967b..737955b9a7 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -6,9 +6,8 @@ according to the 'NetCDF Climate and Forecast (CF) Metadata Conventions'. References: - -[CF] NetCDF Climate and Forecast (CF) Metadata conventions. -[NUG] NetCDF User's Guide, https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/ + [CF] NetCDF Climate and Forecast (CF) Metadata conventions. + [NUG] NetCDF User's Guide, https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/ """ diff --git a/lib/iris/fileformats/pp_load_rules.py b/lib/iris/fileformats/pp_load_rules.py index f3ed22377e..10da402520 100644 --- a/lib/iris/fileformats/pp_load_rules.py +++ b/lib/iris/fileformats/pp_load_rules.py @@ -317,9 +317,9 @@ def _reshape_vector_args(values_and_dims): Input arrays with associated mapping dimension numbers. The length of each 'dims' must match the ndims of the 'value'. - Returns: - - * reshaped_arrays (iterable of arrays). + Returns + ------- + reshaped_arrays : iterable of arrays The inputs, transposed and reshaped onto common target dimensions. """ @@ -371,9 +371,9 @@ def _collapse_degenerate_points_and_bounds(points, bounds=None, rtol=1.0e-7): dimension (typically of length 2) when compared to the points array i.e. bounds.shape = points.shape + (nvertex,) - Returns: - - A (points, bounds) tuple. + Returns + ------- + (points, bounds) tuple. """ array = points @@ -634,9 +634,10 @@ def _convert_time_coords( to (). The length of each dims tuple should equal the dimensionality of the corresponding array of values. - Returns: - - A list of (coordinate, dims) tuples. The coordinates are instance of + Returns + ------- + list of (coordinate, dims) tuples. + The coordinates are instance of :class:`iris.coords.DimCoord` if possible, otherwise they are instance of :class:`iris.coords.AuxCoord`. When the coordinate is of length one, the `dims` value is None rather than an empty tuple. diff --git a/lib/iris/fileformats/um/_optimal_array_structuring.py b/lib/iris/fileformats/um/_optimal_array_structuring.py index b43c4a2e50..ce2cba7d5c 100644 --- a/lib/iris/fileformats/um/_optimal_array_structuring.py +++ b/lib/iris/fileformats/um/_optimal_array_structuring.py @@ -28,8 +28,9 @@ def _optimal_dimensioning_structure(structure, element_priorities): A dictionary mapping structure element names to their priority as defined by their input order to :func:`~optimal_array_structure`. - Returns: - + Returns + ------- + array structure or an empty list The determined optimal array structure or an empty list if no structure options were determined. @@ -69,7 +70,6 @@ def optimal_array_structure(ordering_elements, actual_values_elements=None): priority when associating dimensions with specific elements. Returns: - dims_shape, primary_elements, element_arrays_and_dims, where: * 'dims_shape' is the shape of the vector dimensions chosen. diff --git a/lib/iris/tests/test_analysis_calculus.py b/lib/iris/tests/test_analysis_calculus.py index 57c2414875..70c1077def 100644 --- a/lib/iris/tests/test_analysis_calculus.py +++ b/lib/iris/tests/test_analysis_calculus.py @@ -503,7 +503,7 @@ def build_cube(data, spherical=False): class TestCalculusWKnownSolutions(tests.IrisTest): def get_coord_pts(self, cube): - """return (x_pts, x_ones, y_pts, y_ones, z_pts, z_ones) for the given cube.""" + """Return (x_pts, x_ones, y_pts, y_ones, z_pts, z_ones) for the given cube.""" x = cube.coord(axis="X") y = cube.coord(axis="Y") z = cube.coord(axis="Z") diff --git a/lib/iris/tests/test_coding_standards.py b/lib/iris/tests/test_coding_standards.py index 78d6bd67e1..44bd2dc868 100644 --- a/lib/iris/tests/test_coding_standards.py +++ b/lib/iris/tests/test_coding_standards.py @@ -136,9 +136,9 @@ def test_categorised_warnings(): .. code-block:: python class _WarnComboCfDefaulting(IrisCfWarning, IrisDefaultingWarning): - \""" + \"\"\" One-off combination of warning classes - enhances user filtering. - \""" + \"\"\" pass """ diff --git a/lib/iris/tests/test_coordsystem.py b/lib/iris/tests/test_coordsystem.py index ea839cff00..69aeeaa1b1 100644 --- a/lib/iris/tests/test_coordsystem.py +++ b/lib/iris/tests/test_coordsystem.py @@ -250,7 +250,7 @@ def test_update_to_equivalent(self): class Test_GeogCS_mutation(tests.IrisTest): - "Test that altering attributes of a GeogCS instance behaves as expected." + """Test that altering attributes of a GeogCS instance behaves as expected.""" def test_semi_major_axis_change(self): # Clear datum diff --git a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py index e02855513e..b37fa1de62 100644 --- a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py +++ b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py @@ -329,7 +329,9 @@ def test_fully_wrapped_not_circular(self): class Test___call___1D_singlelendim(ThreeDimCube): def setUp(self): - """thingness / (1) (wibble: 2; latitude: 1) + """Setup. + + thingness / (1) (wibble: 2; latitude: 1) Dimension coordinates: wibble x - latitude - x diff --git a/lib/iris/tests/unit/common/lenient/test__lenient_client.py b/lib/iris/tests/unit/common/lenient/test__lenient_client.py index a0c630bc21..54e2aca185 100644 --- a/lib/iris/tests/unit/common/lenient/test__lenient_client.py +++ b/lib/iris/tests/unit/common/lenient/test__lenient_client.py @@ -76,9 +76,9 @@ def myclient(*args, **kwargs): def test_call_naked_doc(self): @_lenient_client def myclient(): - """myclient doc-string.""" + """Myclient doc-string.""" - self.assertEqual(myclient.__doc__, "myclient doc-string.") + self.assertEqual(myclient.__doc__, "Myclient doc-string.") def test_call_no_kwargs(self): @_lenient_client() @@ -169,9 +169,9 @@ def myclient(*args, **kwargs): def test_call_doc(self): @_lenient_client() def myclient(): - """myclient doc-string.""" + """Myclient doc-string.""" - self.assertEqual(myclient.__doc__, "myclient doc-string.") + self.assertEqual(myclient.__doc__, "Myclient doc-string.") if __name__ == "__main__": diff --git a/lib/iris/tests/unit/common/lenient/test__lenient_service.py b/lib/iris/tests/unit/common/lenient/test__lenient_service.py index 6e53aeb952..a916779c79 100644 --- a/lib/iris/tests/unit/common/lenient/test__lenient_service.py +++ b/lib/iris/tests/unit/common/lenient/test__lenient_service.py @@ -67,9 +67,9 @@ def myservice(*args, **kwargs): def test_call_naked_doc(self): @_lenient_service def myservice(): - """myservice doc-string.""" + """Myservice doc-string.""" - self.assertEqual(myservice.__doc__, "myservice doc-string.") + self.assertEqual(myservice.__doc__, "Myservice doc-string.") def test_call(self): @_lenient_service() @@ -105,9 +105,9 @@ def myservice(*args, **kwargs): def test_call_doc(self): @_lenient_service() def myservice(): - """myservice doc-string.""" + """Myservice doc-string.""" - self.assertEqual(myservice.__doc__, "myservice doc-string.") + self.assertEqual(myservice.__doc__, "Myservice doc-string.") if __name__ == "__main__": diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index e883140121..27f1756770 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -961,7 +961,7 @@ class Test_slices_dim_order(tests.IrisTest): """ def setUp(self): - """setup a 4D iris cube, each dimension is length 1. + """Setup a 4D iris cube, each dimension is length 1. The dimensions are; dim1: time dim2: height diff --git a/lib/iris/util.py b/lib/iris/util.py index f859032bfb..59a171fa04 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -51,8 +51,8 @@ def broadcast_to_shape(array, shape, dim_map): to, so the first element of *dim_map* gives the index of *shape* that corresponds to the first dimension of *array* etc. - Examples: - + Examples + -------- Broadcasting an array of shape (2, 3) to the shape (5, 2, 6, 3) where the first dimension of the array corresponds to the second element of the desired shape and the second dimension of the array @@ -303,7 +303,6 @@ def rolling_window(a, window=1, step=1, axis=-1): Axis to take the rolling window over Returns: - Array that is a view of the original array with an added dimension of the size of the given window at axis + 1. @@ -590,15 +589,13 @@ def monotonic(array, strict=False, return_direction=False): or -1 for negative. The direction is meaningless if the array is not monotonic. - Returns: - - * monotonic_status (boolean) + Returns + ------- + monotonic_status : bool Whether the array was monotonic. If the return_direction flag was given then the returned value - will be: - - ``(monotonic_status, direction)`` + will be: ``(monotonic_status, direction)`` Notes ----- @@ -1761,16 +1758,18 @@ def find_discontiguities(cube, rel_tol=1e-5, abs_tol=1e-8): The absolute value tolerance to apply in coordinate bounds checking. - Returns: - - * result (`numpy.ndarray` of bool) : + Returns + ------- + result : `numpy.ndarray` of bool true/false map of which cells in the cube XY grid have discontiguities in the coordinate points array. This can be used as the input array for :func:`iris.util.mask_cube`. - Examples:: + Examples + -------- + :: # Find any unknown discontiguities in your cube's x and y arrays: discontiguities = iris.util.find_discontiguities(cube) @@ -1896,7 +1895,6 @@ def mask_cube(cube, points_to_mask, in_place=False, dim=None): Parameters ---------- - cube : iris.cube.Cube Cube containing data that requires masking. @@ -1913,13 +1911,11 @@ def mask_cube(cube, points_to_mask, in_place=False, dim=None): Returns ------- - iris.cube.Cube A cube whose data array is masked at points specified by ``points_to_mask``. Notes ----- - If either ``cube`` or ``points_to_mask`` is lazy, the result will be lazy. This function maintains laziness when called; it does not realise data. @@ -1966,9 +1962,9 @@ def equalise_attributes(cubes): * cubes (iterable of :class:`iris.cube.Cube`): A collection of cubes to compare and adjust. - Returns: - - * removed (list): + Returns + ------- + list A list of dicts holding the removed attributes. Notes