diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e63924c78f..ded673f008 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: no-commit-to-branch - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.9" + rev: "v0.1.11" hooks: - id: ruff types: [file, python] @@ -45,7 +45,7 @@ repos: additional_dependencies: [tomli] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 types: [file, python] diff --git a/.ruff.toml b/.ruff.toml index f159f0afca..ff7ce543be 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -25,14 +25,10 @@ lint.ignore = [ # (D-1) Permanent "D105", # Missing docstring in magic method # (D-2) Temporary, to be removed when we are more compliant. Rare cases mmove to (1). - "D417", # Missing argument descriptions in the docstring "D101", # Missing docstring in public class "D102", # Missing docstring in public method - "D104", # Missing docstring in public package # (D-3) Temporary, before an initial review, either fix ocurrences or move to (2). - "D100", # Missing docstring in public module "D103", # Missing docstring in public function - "D200", # One-line docstring should fit on one line "D205", # 1 blank line required between summary line and description "D401", # First line of docstring should be in imperative mood: ... diff --git a/benchmarks/benchmarks/aux_factory.py b/benchmarks/benchmarks/aux_factory.py index 6f71e47086..e5ed710941 100644 --- a/benchmarks/benchmarks/aux_factory.py +++ b/benchmarks/benchmarks/aux_factory.py @@ -2,9 +2,7 @@ # # 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. -"""AuxFactory benchmark tests. - -""" +"""AuxFactory benchmark tests.""" import numpy as np diff --git a/benchmarks/benchmarks/coords.py b/benchmarks/benchmarks/coords.py index f90ed1fd31..1d920ac357 100644 --- a/benchmarks/benchmarks/coords.py +++ b/benchmarks/benchmarks/coords.py @@ -2,9 +2,7 @@ # # 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. -"""Coord benchmark tests. - -""" +"""Coord benchmark tests.""" import numpy as np diff --git a/benchmarks/benchmarks/cperf/equality.py b/benchmarks/benchmarks/cperf/equality.py index a25cf99128..97ab9d9b5f 100644 --- a/benchmarks/benchmarks/cperf/equality.py +++ b/benchmarks/benchmarks/cperf/equality.py @@ -2,8 +2,7 @@ # # 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. -"""Equality benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project. -""" +"""Equality benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project.""" from .. import on_demand_benchmark from . import SingleDiagnosticMixin diff --git a/benchmarks/benchmarks/cperf/load.py b/benchmarks/benchmarks/cperf/load.py index 2d3c0b5c6b..bcb1ff117b 100644 --- a/benchmarks/benchmarks/cperf/load.py +++ b/benchmarks/benchmarks/cperf/load.py @@ -2,8 +2,7 @@ # # 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. -"""File loading benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project. -""" +"""File loading benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project.""" from .. import on_demand_benchmark from . import SingleDiagnosticMixin diff --git a/benchmarks/benchmarks/cperf/save.py b/benchmarks/benchmarks/cperf/save.py index 528f878265..28898225d6 100644 --- a/benchmarks/benchmarks/cperf/save.py +++ b/benchmarks/benchmarks/cperf/save.py @@ -2,8 +2,7 @@ # # 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. -"""File saving benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project. -""" +"""File saving benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project.""" from iris import save diff --git a/benchmarks/benchmarks/cube.py b/benchmarks/benchmarks/cube.py index ef42e03077..d017e5477e 100644 --- a/benchmarks/benchmarks/cube.py +++ b/benchmarks/benchmarks/cube.py @@ -2,9 +2,7 @@ # # 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. -"""Cube benchmark tests. - -""" +"""Cube benchmark tests.""" import numpy as np diff --git a/benchmarks/benchmarks/experimental/__init__.py b/benchmarks/benchmarks/experimental/__init__.py index d1f34cdb15..ce727a7286 100644 --- a/benchmarks/benchmarks/experimental/__init__.py +++ b/benchmarks/benchmarks/experimental/__init__.py @@ -2,6 +2,4 @@ # # 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. -"""Benchmark tests for the experimental module. - -""" +"""Benchmark tests for the experimental module.""" diff --git a/benchmarks/benchmarks/experimental/ugrid/__init__.py b/benchmarks/benchmarks/experimental/ugrid/__init__.py index 322fe9acc0..960734e1c6 100644 --- a/benchmarks/benchmarks/experimental/ugrid/__init__.py +++ b/benchmarks/benchmarks/experimental/ugrid/__init__.py @@ -2,9 +2,7 @@ # # 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. -"""Benchmark tests for the experimental.ugrid module. - -""" +"""Benchmark tests for the experimental.ugrid module.""" from copy import deepcopy diff --git a/benchmarks/benchmarks/generate_data/ugrid.py b/benchmarks/benchmarks/generate_data/ugrid.py index 8cca53c907..d96e991c59 100644 --- a/benchmarks/benchmarks/generate_data/ugrid.py +++ b/benchmarks/benchmarks/generate_data/ugrid.py @@ -2,8 +2,7 @@ # # 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. -"""Scripts for generating supporting data for UGRID-related benchmarking. -""" +"""Scripts for generating supporting data for UGRID-related benchmarking.""" from iris import load_cube as iris_loadcube from iris.experimental.ugrid import PARSE_UGRID_ON_LOAD diff --git a/benchmarks/benchmarks/import_iris.py b/benchmarks/benchmarks/import_iris.py index fbae82fee6..51679ce7df 100644 --- a/benchmarks/benchmarks/import_iris.py +++ b/benchmarks/benchmarks/import_iris.py @@ -2,6 +2,9 @@ # # 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. + +"""import iris benchmarking.""" + from importlib import import_module, reload ################ diff --git a/benchmarks/benchmarks/iterate.py b/benchmarks/benchmarks/iterate.py index 800911f21a..9353cf42ee 100644 --- a/benchmarks/benchmarks/iterate.py +++ b/benchmarks/benchmarks/iterate.py @@ -2,9 +2,7 @@ # # 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. -"""Iterate benchmark tests. - -""" +"""Iterate benchmark tests.""" import numpy as np from iris import coords, cube, iterate diff --git a/benchmarks/benchmarks/metadata_manager_factory.py b/benchmarks/benchmarks/metadata_manager_factory.py index 8e4de9949b..01a2b661b8 100644 --- a/benchmarks/benchmarks/metadata_manager_factory.py +++ b/benchmarks/benchmarks/metadata_manager_factory.py @@ -2,9 +2,7 @@ # # 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. -"""metadata_manager_factory benchmark tests. - -""" +"""metadata_manager_factory benchmark tests.""" from iris.common import ( AncillaryVariableMetadata, diff --git a/benchmarks/benchmarks/mixin.py b/benchmarks/benchmarks/mixin.py index de5127253f..90fb017b12 100644 --- a/benchmarks/benchmarks/mixin.py +++ b/benchmarks/benchmarks/mixin.py @@ -2,9 +2,7 @@ # # 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. -"""Mixin benchmark tests. - -""" +"""Mixin benchmark tests.""" import numpy as np diff --git a/benchmarks/benchmarks/plot.py b/benchmarks/benchmarks/plot.py index b5bc064e84..9b008ec41c 100644 --- a/benchmarks/benchmarks/plot.py +++ b/benchmarks/benchmarks/plot.py @@ -2,9 +2,7 @@ # # 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. -"""Plot benchmark tests. - -""" +"""Plot benchmark tests.""" import matplotlib as mpl import numpy as np diff --git a/benchmarks/benchmarks/regridding.py b/benchmarks/benchmarks/regridding.py index 8e1c5e33df..b311c94717 100644 --- a/benchmarks/benchmarks/regridding.py +++ b/benchmarks/benchmarks/regridding.py @@ -2,9 +2,7 @@ # # 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. -"""Regridding benchmark test. - -""" +"""Regridding benchmark test.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/benchmarks/benchmarks/sperf/combine_regions.py b/benchmarks/benchmarks/sperf/combine_regions.py index e591a120c9..27a3560d51 100644 --- a/benchmarks/benchmarks/sperf/combine_regions.py +++ b/benchmarks/benchmarks/sperf/combine_regions.py @@ -2,8 +2,7 @@ # # 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. -"""Region combine benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project. -""" +"""Region combine benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project.""" import os.path from dask import array as da diff --git a/benchmarks/benchmarks/sperf/equality.py b/benchmarks/benchmarks/sperf/equality.py index 813cfad6bf..4d6e43d8b9 100644 --- a/benchmarks/benchmarks/sperf/equality.py +++ b/benchmarks/benchmarks/sperf/equality.py @@ -2,8 +2,7 @@ # # 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. -"""Equality benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project. -""" +"""Equality benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project.""" from .. import on_demand_benchmark from . import FileMixin diff --git a/benchmarks/benchmarks/sperf/load.py b/benchmarks/benchmarks/sperf/load.py index d3e9ea7ac9..f3c5ef1136 100644 --- a/benchmarks/benchmarks/sperf/load.py +++ b/benchmarks/benchmarks/sperf/load.py @@ -2,8 +2,7 @@ # # 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. -"""File loading benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project. -""" +"""File loading benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project.""" from .. import on_demand_benchmark from . import FileMixin diff --git a/benchmarks/benchmarks/sperf/save.py b/benchmarks/benchmarks/sperf/save.py index 2999e81227..3fb8133659 100644 --- a/benchmarks/benchmarks/sperf/save.py +++ b/benchmarks/benchmarks/sperf/save.py @@ -2,8 +2,7 @@ # # 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. -"""File saving benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project. -""" +"""File saving benchmarks for the SPerf scheme of the UK Met Office's NG-VAT project.""" import os.path from iris import save diff --git a/benchmarks/benchmarks/trajectory.py b/benchmarks/benchmarks/trajectory.py index 4214ed3f6e..ec2958b6a8 100644 --- a/benchmarks/benchmarks/trajectory.py +++ b/benchmarks/benchmarks/trajectory.py @@ -2,9 +2,7 @@ # # 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. -"""Trajectory benchmark test. - -""" +"""Trajectory benchmark test.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/benchmarks/bm_runner.py b/benchmarks/bm_runner.py index 406c8eb3ae..741ecb8580 100644 --- a/benchmarks/bm_runner.py +++ b/benchmarks/bm_runner.py @@ -2,8 +2,7 @@ # # 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. -"""Argparse conveniences for executing common types of benchmark runs. -""" +"""Argparse conveniences for executing common types of benchmark runs.""" from abc import ABC, abstractmethod import argparse diff --git a/docs/gallery_tests/__init__.py b/docs/gallery_tests/__init__.py index 091e997248..9468138e04 100644 --- a/docs/gallery_tests/__init__.py +++ b/docs/gallery_tests/__init__.py @@ -2,3 +2,5 @@ # # 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. + +"""Gallery Tests.""" diff --git a/docs/gallery_tests/test_gallery_examples.py b/docs/gallery_tests/test_gallery_examples.py index 83f2c93217..37f2858ee9 100644 --- a/docs/gallery_tests/test_gallery_examples.py +++ b/docs/gallery_tests/test_gallery_examples.py @@ -3,6 +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. +"""Test all the gallery examples.""" + import importlib import matplotlib.pyplot as plt diff --git a/docs/src/conf.py b/docs/src/conf.py index ba17603f12..3b1d32edba 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -17,6 +17,8 @@ # serve to show the default. # ---------------------------------------------------------------------------- +"""sphinx config.""" + import datetime from importlib.metadata import version as get_version import ntpath @@ -298,7 +300,6 @@ def _dotv(version): html_theme_options = { "footer_start": ["copyright", "sphinx-version"], "footer_end": ["custom_footer"], - "collapse_navigation": True, "navigation_depth": 3, "show_toc_level": 4, "show_prev_next": True, diff --git a/docs/src/developers_guide/documenting/__init__.py b/docs/src/developers_guide/documenting/__init__.py index e69de29bb2..6e031999e7 100644 --- a/docs/src/developers_guide/documenting/__init__.py +++ b/docs/src/developers_guide/documenting/__init__.py @@ -0,0 +1 @@ +# noqa: D104 diff --git a/docs/src/developers_guide/documenting/docstrings_attribute.py b/docs/src/developers_guide/documenting/docstrings_attribute.py index 3044145b20..9b85ecb201 100644 --- a/docs/src/developers_guide/documenting/docstrings_attribute.py +++ b/docs/src/developers_guide/documenting/docstrings_attribute.py @@ -1,3 +1,6 @@ +"""docstring attribute example.""" + + class ExampleClass: """Class Summary.""" diff --git a/docs/src/developers_guide/documenting/docstrings_sample_routine.py b/docs/src/developers_guide/documenting/docstrings_sample_routine.py index d565e6a8df..4c26bc3569 100644 --- a/docs/src/developers_guide/documenting/docstrings_sample_routine.py +++ b/docs/src/developers_guide/documenting/docstrings_sample_routine.py @@ -1,3 +1,6 @@ +"""docstring routine example.""" + + def sample_routine(arg1, arg2, kwarg1="foo", kwarg2=None): """Purpose section text goes here. diff --git a/docs/src/further_topics/filtering_warnings.rst b/docs/src/further_topics/filtering_warnings.rst index c71cae433a..ef743fa9f1 100644 --- a/docs/src/further_topics/filtering_warnings.rst +++ b/docs/src/further_topics/filtering_warnings.rst @@ -47,9 +47,9 @@ Warnings: >>> my_operation() ... - iris/coord_systems.py:434: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. + iris/coord_systems.py:432: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) - iris/coord_systems.py:772: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. + iris/coord_systems.py:770: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. warnings.warn( Warnings can be suppressed using the Python warnings filter with the ``ignore`` @@ -110,7 +110,7 @@ You can target specific Warning messages, e.g. ... warnings.filterwarnings("ignore", message="Discarding false_easting") ... my_operation() ... - iris/coord_systems.py:434: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. + iris/coord_systems.py:432: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) :: @@ -128,9 +128,9 @@ Or you can target Warnings raised by specific lines of specific modules, e.g. ... warnings.filterwarnings("ignore", module="iris.coord_systems", lineno=449) ... my_operation() ... - iris/coord_systems.py:434: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. + iris/coord_systems.py:432: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) - iris/coord_systems.py:772: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. + iris/coord_systems.py:770: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. warnings.warn( :: @@ -190,7 +190,7 @@ module during execution: ... ) ... my_operation() ... - iris/coord_systems.py:434: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. + iris/coord_systems.py:432: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) ---- diff --git a/docs/src/userguide/plotting_examples/1d_quickplot_simple.py b/docs/src/userguide/plotting_examples/1d_quickplot_simple.py index 725ff69f11..58d0918dcb 100644 --- a/docs/src/userguide/plotting_examples/1d_quickplot_simple.py +++ b/docs/src/userguide/plotting_examples/1d_quickplot_simple.py @@ -1,3 +1,5 @@ +"""Simple 1D plot using iris.quickplot.plot().""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/1d_simple.py b/docs/src/userguide/plotting_examples/1d_simple.py index 249412f44f..4511a0fbe1 100644 --- a/docs/src/userguide/plotting_examples/1d_simple.py +++ b/docs/src/userguide/plotting_examples/1d_simple.py @@ -1,3 +1,5 @@ +"""Simple 1D plot using iris.plot.plot().""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/1d_with_legend.py b/docs/src/userguide/plotting_examples/1d_with_legend.py index 6b29fc9e76..b325657766 100644 --- a/docs/src/userguide/plotting_examples/1d_with_legend.py +++ b/docs/src/userguide/plotting_examples/1d_with_legend.py @@ -1,3 +1,5 @@ +"""Simple 1D plot using iris.plot.plot() with a legend.""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/brewer.py b/docs/src/userguide/plotting_examples/brewer.py index 905296279d..e42ad57cc0 100644 --- a/docs/src/userguide/plotting_examples/brewer.py +++ b/docs/src/userguide/plotting_examples/brewer.py @@ -1,3 +1,5 @@ +"""Plot a chart of all Brewer colour schemes.""" + import matplotlib.pyplot as plt import numpy as np diff --git a/docs/src/userguide/plotting_examples/cube_blockplot.py b/docs/src/userguide/plotting_examples/cube_blockplot.py index 50a2d1f4d7..1f4d3985a3 100644 --- a/docs/src/userguide/plotting_examples/cube_blockplot.py +++ b/docs/src/userguide/plotting_examples/cube_blockplot.py @@ -1,3 +1,5 @@ +"""Cube block plot using using iris.plot.pcolormesh().""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/cube_brewer_cite_contourf.py b/docs/src/userguide/plotting_examples/cube_brewer_cite_contourf.py index 6e3996660c..4e28510e43 100644 --- a/docs/src/userguide/plotting_examples/cube_brewer_cite_contourf.py +++ b/docs/src/userguide/plotting_examples/cube_brewer_cite_contourf.py @@ -1,3 +1,5 @@ +"""Addind a citation for a plot using iris.plot.citation().""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/cube_brewer_contourf.py b/docs/src/userguide/plotting_examples/cube_brewer_contourf.py index d562443f07..94692c924c 100644 --- a/docs/src/userguide/plotting_examples/cube_brewer_contourf.py +++ b/docs/src/userguide/plotting_examples/cube_brewer_contourf.py @@ -1,3 +1,5 @@ +"""Plot a cube with a Brewer colour palette using iris.quickplot.contourf().""" + import matplotlib.cm as mpl_cm import matplotlib.pyplot as plt diff --git a/docs/src/userguide/plotting_examples/cube_contour.py b/docs/src/userguide/plotting_examples/cube_contour.py index 7a9fe6ef09..0d8c1e02aa 100644 --- a/docs/src/userguide/plotting_examples/cube_contour.py +++ b/docs/src/userguide/plotting_examples/cube_contour.py @@ -1,3 +1,8 @@ +"""Simple contour plot of a cube. + +Can use iris.plot.contour() or iris.quicplot.contour(). + +""" import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/cube_contourf.py b/docs/src/userguide/plotting_examples/cube_contourf.py index 5989e42c71..531dd45d25 100644 --- a/docs/src/userguide/plotting_examples/cube_contourf.py +++ b/docs/src/userguide/plotting_examples/cube_contourf.py @@ -1,3 +1,8 @@ +"""Simple filled contour plot of a cube. + +Can use iris.plot.contour() or iris.quickplot.contour(). + +""" import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/regridding_plots/interpolate_column.py b/docs/src/userguide/regridding_plots/interpolate_column.py index ec1f37a3b2..681af0c998 100644 --- a/docs/src/userguide/regridding_plots/interpolate_column.py +++ b/docs/src/userguide/regridding_plots/interpolate_column.py @@ -1,3 +1,5 @@ +"""Interpolate using iris.analysis.Linear().""" + import matplotlib.pyplot as plt import numpy as np diff --git a/docs/src/userguide/regridding_plots/regridded_to_global.py b/docs/src/userguide/regridding_plots/regridded_to_global.py index 5ce6513ef0..8e43f1471a 100644 --- a/docs/src/userguide/regridding_plots/regridded_to_global.py +++ b/docs/src/userguide/regridding_plots/regridded_to_global.py @@ -1,3 +1,5 @@ +"""Interpolate using iris.analysis.Linear().""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/regridding_plots/regridded_to_global_area_weighted.py b/docs/src/userguide/regridding_plots/regridded_to_global_area_weighted.py index f53e624e03..6c906ba87b 100644 --- a/docs/src/userguide/regridding_plots/regridded_to_global_area_weighted.py +++ b/docs/src/userguide/regridding_plots/regridded_to_global_area_weighted.py @@ -1,3 +1,5 @@ +"""Regrid using iris.analysis.AreaWeighted.""" + import matplotlib.colors import matplotlib.pyplot as plt import numpy as np diff --git a/docs/src/userguide/regridding_plots/regridded_to_rotated.py b/docs/src/userguide/regridding_plots/regridded_to_rotated.py index cb54a016cb..31afdb7da1 100644 --- a/docs/src/userguide/regridding_plots/regridded_to_rotated.py +++ b/docs/src/userguide/regridding_plots/regridded_to_rotated.py @@ -1,3 +1,5 @@ +"""Rotated pole.""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/regridding_plots/regridding_plot.py b/docs/src/userguide/regridding_plots/regridding_plot.py index c559e0e3e7..ed45822a51 100644 --- a/docs/src/userguide/regridding_plots/regridding_plot.py +++ b/docs/src/userguide/regridding_plots/regridding_plot.py @@ -1,3 +1,5 @@ +"""Plot regridded data.""" + import matplotlib.pyplot as plt import iris diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index d7e9a40648..fc755165be 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -142,6 +142,13 @@ This document explains the changes made to Iris for this release #. `@bouweandela`_ updated all hyperlinks to https. (:pull:`5621`) +#. `@ESadek-MO`_ created an index page for :ref:`further_topics_index`, and + relocated all 'Technical Papers' into + :ref:`further_topics_index`. (:pull:`5602`) + +#. `@trexfeathers`_ made drop-down icons visible to show which pages link to + 'sub-pages'. (:pull:`5684`) + 💼 Internal =========== diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index 785440d094..45f1a6b3e2 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -2,9 +2,7 @@ # # 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. -"""Management of common state and behaviour for cube and coordinate data. - -""" +"""Management of common state and behaviour for cube and coordinate data.""" import copy diff --git a/lib/iris/_deprecation.py b/lib/iris/_deprecation.py index 711e4081cd..b771883a71 100644 --- a/lib/iris/_deprecation.py +++ b/lib/iris/_deprecation.py @@ -2,9 +2,7 @@ # # 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. -"""Utilities for producing runtime deprecation messages. - -""" +"""Utilities for producing runtime deprecation messages.""" import warnings diff --git a/lib/iris/_representation/__init__.py b/lib/iris/_representation/__init__.py index cc312b5c9c..74de095995 100644 --- a/lib/iris/_representation/__init__.py +++ b/lib/iris/_representation/__init__.py @@ -2,6 +2,4 @@ # # 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. -"""Code to make printouts and other representations (e.g. html) of Iris objects. - -""" +"""Code to make printouts and other representations (e.g. html) of Iris objects.""" diff --git a/lib/iris/_representation/cube_printout.py b/lib/iris/_representation/cube_printout.py index fc8efb7cd6..9cbf43f300 100644 --- a/lib/iris/_representation/cube_printout.py +++ b/lib/iris/_representation/cube_printout.py @@ -2,9 +2,7 @@ # # 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. -"""Provides text printouts of Iris cubes. - -""" +"""Provides text printouts of Iris cubes.""" from copy import deepcopy from iris._representation.cube_summary import CubeSummary diff --git a/lib/iris/_representation/cube_summary.py b/lib/iris/_representation/cube_summary.py index baceba497a..64a6aadbf3 100644 --- a/lib/iris/_representation/cube_summary.py +++ b/lib/iris/_representation/cube_summary.py @@ -2,8 +2,7 @@ # # 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. -"""Provides objects describing cube summaries. -""" +"""Provides objects describing cube summaries.""" import re from iris.common.metadata import hexdigest diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index 68fad28d9c..78b903c971 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -2,9 +2,7 @@ # # 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. -"""Various utilities and numeric transformations relevant to cartography. - -""" +"""Various utilities and numeric transformations relevant to cartography.""" from collections import namedtuple import copy diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index 6cbdeb70ac..50b8b21a28 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -2,9 +2,7 @@ # # 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. -"""Basic mathematical and statistical operations. - -""" +"""Basic mathematical and statistical operations.""" from functools import lru_cache import inspect diff --git a/lib/iris/analysis/stats.py b/lib/iris/analysis/stats.py index 1fe958500b..33eb171336 100644 --- a/lib/iris/analysis/stats.py +++ b/lib/iris/analysis/stats.py @@ -2,9 +2,7 @@ # # 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. -"""Statistical operations between cubes. - -""" +"""Statistical operations between cubes.""" import numpy as np import numpy.ma as ma diff --git a/lib/iris/common/__init__.py b/lib/iris/common/__init__.py index 983238f17d..f9ad2bf207 100644 --- a/lib/iris/common/__init__.py +++ b/lib/iris/common/__init__.py @@ -2,9 +2,7 @@ # # 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. -"""A package for provisioning common Iris infrastructure. - -""" +"""A package for provisioning common Iris infrastructure.""" from .lenient import * from .metadata import * diff --git a/lib/iris/common/lenient.py b/lib/iris/common/lenient.py index 821559c44b..d8fb5e8bfc 100644 --- a/lib/iris/common/lenient.py +++ b/lib/iris/common/lenient.py @@ -2,9 +2,7 @@ # # 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. -"""Provides the infrastructure to support lenient client/service behaviour. - -""" +"""Provides the infrastructure to support lenient client/service behaviour.""" from collections.abc import Iterable from contextlib import contextmanager diff --git a/lib/iris/common/metadata.py b/lib/iris/common/metadata.py index 212691e046..27b3329621 100644 --- a/lib/iris/common/metadata.py +++ b/lib/iris/common/metadata.py @@ -2,9 +2,7 @@ # # 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. -"""Provides the infrastructure to support the common metadata API. - -""" +"""Provides the infrastructure to support the common metadata API.""" from abc import ABCMeta diff --git a/lib/iris/common/mixin.py b/lib/iris/common/mixin.py index 08ad224ad6..762d1b1fe6 100644 --- a/lib/iris/common/mixin.py +++ b/lib/iris/common/mixin.py @@ -2,9 +2,7 @@ # # 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. -"""Provides common metadata mixin behaviour. - -""" +"""Provides common metadata mixin behaviour.""" from collections.abc import Mapping from functools import wraps diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index d4d1aa66f7..7f0af71548 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -2,9 +2,7 @@ # # 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. -"""Definitions of coordinate systems. - -""" +"""Definitions of coordinate systems.""" from abc import ABCMeta, abstractmethod from functools import cached_property diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 14371ac3ee..4274872e66 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -2,9 +2,7 @@ # # 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. -"""Definitions of coordinates and other dimensional metadata. - -""" +"""Definitions of coordinates and other dimensional metadata.""" from abc import ABCMeta, abstractmethod from collections import namedtuple diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 04cee11969..691349f170 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -3,9 +3,7 @@ # 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. -"""Classes for representing multi-dimensional data with metadata. - -""" +"""Classes for representing multi-dimensional data with metadata.""" from collections import OrderedDict import copy diff --git a/lib/iris/exceptions.py b/lib/iris/exceptions.py index 36523b8ed6..c869c1c6c8 100644 --- a/lib/iris/exceptions.py +++ b/lib/iris/exceptions.py @@ -2,9 +2,7 @@ # # 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. -"""Exceptions specific to the Iris package. - -""" +"""Exceptions specific to the Iris package.""" class IrisError(Exception): diff --git a/lib/iris/experimental/representation.py b/lib/iris/experimental/representation.py index fd063a5475..6b25023fa2 100644 --- a/lib/iris/experimental/representation.py +++ b/lib/iris/experimental/representation.py @@ -3,9 +3,7 @@ # 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. -"""Definitions of how Iris objects should be represented. - -""" +"""Definitions of how Iris objects should be represented.""" from html import escape import re diff --git a/lib/iris/experimental/ugrid/utils.py b/lib/iris/experimental/ugrid/utils.py index fc0464077a..fce1036c6d 100644 --- a/lib/iris/experimental/ugrid/utils.py +++ b/lib/iris/experimental/ugrid/utils.py @@ -3,9 +3,7 @@ # 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. -"""Utility operations specific to unstructured data. - -""" +"""Utility operations specific to unstructured data.""" from typing import AnyStr, Iterable, Union import dask.array as da diff --git a/lib/iris/fileformats/__init__.py b/lib/iris/fileformats/__init__.py index cd967881c7..174c4d390c 100644 --- a/lib/iris/fileformats/__init__.py +++ b/lib/iris/fileformats/__init__.py @@ -2,9 +2,7 @@ # # 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. -"""A package for converting cubes to and from specific file formats. - -""" +"""A package for converting cubes to and from specific file formats.""" from iris.io.format_picker import ( DataSourceObjectProtocol, diff --git a/lib/iris/fileformats/_ff.py b/lib/iris/fileformats/_ff.py index 5e65c92996..3edd29c410 100644 --- a/lib/iris/fileformats/_ff.py +++ b/lib/iris/fileformats/_ff.py @@ -2,9 +2,7 @@ # # 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. -"""Provides UK Met Office Fields File (FF) format specific capabilities. - -""" +"""Provides UK Met Office Fields File (FF) format specific capabilities.""" import os import warnings diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index 83336a2249..cd875b3e4a 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -2,9 +2,7 @@ # # 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. -"""Provides Creation and saving of DOT graphs for a :class:`iris.cube.Cube`. - -""" +"""Provides Creation and saving of DOT graphs for a :class:`iris.cube.Cube`.""" import os import subprocess diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index a654bfde6f..8ac49b827d 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -2,9 +2,7 @@ # # 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. -"""Provides UK Met Office Post Process (PP) format specific capabilities. - -""" +"""Provides UK Met Office Post Process (PP) format specific capabilities.""" from abc import ABCMeta, abstractmethod import collections diff --git a/lib/iris/fileformats/pp_load_rules.py b/lib/iris/fileformats/pp_load_rules.py index ea42aee92c..7c164edd41 100644 --- a/lib/iris/fileformats/pp_load_rules.py +++ b/lib/iris/fileformats/pp_load_rules.py @@ -3,10 +3,11 @@ # 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. - # Historically this was auto-generated from # SciTools/iris-code-generators:tools/gen_rules.py +"""PP Load Rules.""" + import calendar from functools import wraps diff --git a/lib/iris/fileformats/pp_save_rules.py b/lib/iris/fileformats/pp_save_rules.py index ab9d1c9545..9bcfd8d92f 100644 --- a/lib/iris/fileformats/pp_save_rules.py +++ b/lib/iris/fileformats/pp_save_rules.py @@ -3,6 +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. +"""PP Save Rules.""" + import warnings import cftime diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index e092fa2b9b..4467ae1cfa 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -2,9 +2,7 @@ # # 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. -"""Generalised mechanisms for metadata translation and cube construction. - -""" +"""Generalised mechanisms for metadata translation and cube construction.""" import collections import warnings diff --git a/lib/iris/iterate.py b/lib/iris/iterate.py index 12e619b79f..1d8ae49d06 100644 --- a/lib/iris/iterate.py +++ b/lib/iris/iterate.py @@ -2,9 +2,7 @@ # # 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. -"""Cube functions for iteration in step. - -""" +"""Cube functions for iteration in step.""" from collections.abc import Iterator import itertools diff --git a/lib/iris/symbols.py b/lib/iris/symbols.py index b55471dadd..0e53588a66 100644 --- a/lib/iris/symbols.py +++ b/lib/iris/symbols.py @@ -2,9 +2,7 @@ # # 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. -"""Contains symbol definitions for use with :func:`iris.plot.symbols`. - -""" +"""Contains symbol definitions for use with :func:`iris.plot.symbols`.""" import itertools import math diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index a1efe9d606..77a9fcdd67 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -42,6 +42,7 @@ import iris.config import iris.cube +import iris.fileformats import iris.tests.graphics as graphics import iris.util @@ -883,6 +884,93 @@ class GraphicsTest(graphics.GraphicsTestMixin, IrisTest): pass +class PPTest: + """A mixin class to provide PP-specific utilities to subclasses of tests.IrisTest.""" + + @contextlib.contextmanager + def cube_save_test( + self, + reference_txt_path, + reference_cubes=None, + reference_pp_path=None, + **kwargs, + ): + """A context manager for testing the saving of Cubes to PP files. + + Args: + + * reference_txt_path: + The path of the file containing the textual PP reference data. + + Kwargs: + + * reference_cubes: + The cube(s) from which the textual PP reference can be re-built if necessary. + * reference_pp_path: + The location of a PP file from which the textual PP reference can be re-built if necessary. + NB. The "reference_cubes" argument takes precedence over this argument. + + The return value from the context manager is the name of a temporary file + into which the PP data to be tested should be saved. + + Example:: + with self.cube_save_test(reference_txt_path, reference_cubes=cubes) as temp_pp_path: + iris.save(cubes, temp_pp_path) + + """ + # Watch out for a missing reference text file + if not os.path.isfile(reference_txt_path): + if reference_cubes: + temp_pp_path = iris.util.create_temp_filename(".pp") + try: + iris.save(reference_cubes, temp_pp_path, **kwargs) + self._create_reference_txt(reference_txt_path, temp_pp_path) + finally: + os.remove(temp_pp_path) + elif reference_pp_path: + self._create_reference_txt(reference_txt_path, reference_pp_path) + else: + raise ValueError( + "Missing all of reference txt file, cubes, and PP path." + ) + + temp_pp_path = iris.util.create_temp_filename(".pp") + try: + # This value is returned to the target of the "with" statement's "as" clause. + yield temp_pp_path + + # Load deferred data for all of the fields (but don't do anything with it) + pp_fields = list(iris.fileformats.pp.load(temp_pp_path)) + for pp_field in pp_fields: + pp_field.data + with open(reference_txt_path, "r") as reference_fh: + reference = "".join(reference_fh) + self._assert_str_same( + reference + "\n", + str(pp_fields) + "\n", + reference_txt_path, + type_comparison_name="PP files", + ) + finally: + os.remove(temp_pp_path) + + def _create_reference_txt(self, txt_path, pp_path): + # Load the reference data + pp_fields = list(iris.fileformats.pp.load(pp_path)) + for pp_field in pp_fields: + pp_field.data + + # Clear any header words we don't use + unused = ("lbexp", "lbegin", "lbnrec", "lbproj", "lbtyp") + for pp_field in pp_fields: + for word_name in unused: + setattr(pp_field, word_name, 0) + + # Save the textual representation of the PP fields + with open(txt_path, "w") as txt_file: + txt_file.writelines(str(pp_fields)) + + def skip_data(fn): """Decorator to choose whether to run tests, based on the availability of external data. diff --git a/lib/iris/tests/experimental/__init__.py b/lib/iris/tests/experimental/__init__.py index 951fca1eae..01a9ee6bdc 100644 --- a/lib/iris/tests/experimental/__init__.py +++ b/lib/iris/tests/experimental/__init__.py @@ -2,6 +2,4 @@ # # 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. -"""Experimental code is tested in this package. - -""" +"""Experimental code is tested in this package.""" diff --git a/lib/iris/tests/experimental/regrid/__init__.py b/lib/iris/tests/experimental/regrid/__init__.py index be5871a5a6..e3983bc695 100644 --- a/lib/iris/tests/experimental/regrid/__init__.py +++ b/lib/iris/tests/experimental/regrid/__init__.py @@ -2,6 +2,4 @@ # # 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. -"""Regridding code is tested in this package. - -""" +"""Regridding code is tested in this package.""" diff --git a/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py b/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py index b68c8f1625..68fa47f25c 100644 --- a/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py +++ b/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py @@ -2,9 +2,7 @@ # # 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. -"""Test area weighted regridding. - -""" +"""Test area weighted regridding.""" # import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py b/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py index c74bab37fb..e06809f3c0 100644 --- a/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py +++ b/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py @@ -2,9 +2,7 @@ # # 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. -"""Tests for :func:`iris.experimental.regrid.regrid_conservative_via_esmpy`. - -""" +"""Tests for :func:`iris.experimental.regrid.regrid_conservative_via_esmpy`.""" # import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/graphics/recreate_imagerepo.py b/lib/iris/tests/graphics/recreate_imagerepo.py index ae12eb447d..5261f0cc29 100755 --- a/lib/iris/tests/graphics/recreate_imagerepo.py +++ b/lib/iris/tests/graphics/recreate_imagerepo.py @@ -3,9 +3,7 @@ # # 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. -"""Updates imagerepo.json based on the baseline images. - -""" +"""Updates imagerepo.json based on the baseline images.""" import argparse from pathlib import Path diff --git a/lib/iris/tests/integration/experimental/test_ugrid_save.py b/lib/iris/tests/integration/experimental/test_ugrid_save.py index cbff1d767f..8350a2004f 100644 --- a/lib/iris/tests/integration/experimental/test_ugrid_save.py +++ b/lib/iris/tests/integration/experimental/test_ugrid_save.py @@ -2,9 +2,7 @@ # # 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. -"""Integration tests for NetCDF-UGRID file saving. - -""" +"""Integration tests for NetCDF-UGRID file saving.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/integration/merge/test_merge.py b/lib/iris/tests/integration/merge/test_merge.py index 4e8562cb60..7e1acd4ad6 100644 --- a/lib/iris/tests/integration/merge/test_merge.py +++ b/lib/iris/tests/integration/merge/test_merge.py @@ -2,9 +2,7 @@ # # 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. -"""Integration tests for merging cubes. - -""" +"""Integration tests for merging cubes.""" # import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/integration/netcdf/test_delayed_save.py b/lib/iris/tests/integration/netcdf/test_delayed_save.py index d76d57c3e1..62bfac7b45 100644 --- a/lib/iris/tests/integration/netcdf/test_delayed_save.py +++ b/lib/iris/tests/integration/netcdf/test_delayed_save.py @@ -2,8 +2,7 @@ # # 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. -"""Integration tests for delayed saving. -""" +"""Integration tests for delayed saving.""" import re import warnings diff --git a/lib/iris/tests/integration/plot/test_animate.py b/lib/iris/tests/integration/plot/test_animate.py index 53a6b38797..4afee0c463 100644 --- a/lib/iris/tests/integration/plot/test_animate.py +++ b/lib/iris/tests/integration/plot/test_animate.py @@ -2,9 +2,7 @@ # # 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. -"""Integration tests for :func:`iris.plot.animate`. - -""" +"""Integration tests for :func:`iris.plot.animate`.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/integration/plot/test_netcdftime.py b/lib/iris/tests/integration/plot/test_netcdftime.py index dbe67efd35..750de9fdf3 100644 --- a/lib/iris/tests/integration/plot/test_netcdftime.py +++ b/lib/iris/tests/integration/plot/test_netcdftime.py @@ -2,9 +2,7 @@ # # 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. -"""Test plot of time coord with non-standard calendar. - -""" +"""Test plot of time coord with non-standard calendar.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/integration/plot/test_nzdateline.py b/lib/iris/tests/integration/plot/test_nzdateline.py index 5a83ac5d89..cb119f5b27 100644 --- a/lib/iris/tests/integration/plot/test_nzdateline.py +++ b/lib/iris/tests/integration/plot/test_nzdateline.py @@ -2,9 +2,7 @@ # # 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. -"""Test set up of limited area map extents which bridge the date line. - -""" +"""Test set up of limited area map extents which bridge the date line.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/integration/plot/test_plot_2d_coords.py b/lib/iris/tests/integration/plot/test_plot_2d_coords.py index dafddd064d..43cd051f46 100644 --- a/lib/iris/tests/integration/plot/test_plot_2d_coords.py +++ b/lib/iris/tests/integration/plot/test_plot_2d_coords.py @@ -2,9 +2,7 @@ # # 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. -"""Test plots with two dimensional coordinates. - -""" +"""Test plots with two dimensional coordinates.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/integration/plot/test_vector_plots.py b/lib/iris/tests/integration/plot/test_vector_plots.py index 08170f6f89..5419dc182f 100644 --- a/lib/iris/tests/integration/plot/test_vector_plots.py +++ b/lib/iris/tests/integration/plot/test_vector_plots.py @@ -2,9 +2,7 @@ # # 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. -"""Test some key usages of :func:`iris.plot.quiver`. - -""" +"""Test some key usages of :func:`iris.plot.quiver`.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/integration/um/test_fieldsfile.py b/lib/iris/tests/integration/um/test_fieldsfile.py index 18c28ee1c7..969a343c4f 100644 --- a/lib/iris/tests/integration/um/test_fieldsfile.py +++ b/lib/iris/tests/integration/um/test_fieldsfile.py @@ -2,9 +2,7 @@ # # 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. -"""Test the fast loading of structured Fieldsfiles. - -""" +"""Test the fast loading of structured Fieldsfiles.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/pp.py b/lib/iris/tests/pp.py deleted file mode 100644 index b0af72d5ee..0000000000 --- a/lib/iris/tests/pp.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright Iris contributors -# -# 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. - -import contextlib -import os.path - -import iris - - -class PPTest: - """A mixin class to provide PP-specific utilities to subclasses of tests.IrisTest.""" - - @contextlib.contextmanager - def cube_save_test( - self, - reference_txt_path, - reference_cubes=None, - reference_pp_path=None, - **kwargs, - ): - """A context manager for testing the saving of Cubes to PP files. - - Args: - - * reference_txt_path: - The path of the file containing the textual PP reference data. - - Kwargs: - - * reference_cubes: - The cube(s) from which the textual PP reference can be re-built if necessary. - * reference_pp_path: - The location of a PP file from which the textual PP reference can be re-built if necessary. - NB. The "reference_cubes" argument takes precedence over this argument. - - The return value from the context manager is the name of a temporary file - into which the PP data to be tested should be saved. - - Example:: - with self.cube_save_test(reference_txt_path, reference_cubes=cubes) as temp_pp_path: - iris.save(cubes, temp_pp_path) - - """ - # Watch out for a missing reference text file - if not os.path.isfile(reference_txt_path): - if reference_cubes: - temp_pp_path = iris.util.create_temp_filename(".pp") - try: - iris.save(reference_cubes, temp_pp_path, **kwargs) - self._create_reference_txt(reference_txt_path, temp_pp_path) - finally: - os.remove(temp_pp_path) - elif reference_pp_path: - self._create_reference_txt(reference_txt_path, reference_pp_path) - else: - raise ValueError( - "Missing all of reference txt file, cubes, and PP path." - ) - - temp_pp_path = iris.util.create_temp_filename(".pp") - try: - # This value is returned to the target of the "with" statement's "as" clause. - yield temp_pp_path - - # Load deferred data for all of the fields (but don't do anything with it) - pp_fields = list(iris.fileformats.pp.load(temp_pp_path)) - for pp_field in pp_fields: - pp_field.data - with open(reference_txt_path, "r") as reference_fh: - reference = "".join(reference_fh) - self._assert_str_same( - reference + "\n", - str(pp_fields) + "\n", - reference_txt_path, - type_comparison_name="PP files", - ) - finally: - os.remove(temp_pp_path) - - def _create_reference_txt(self, txt_path, pp_path): - # Load the reference data - pp_fields = list(iris.fileformats.pp.load(pp_path)) - for pp_field in pp_fields: - pp_field.data - - # Clear any header words we don't use - unused = ("lbexp", "lbegin", "lbnrec", "lbproj", "lbtyp") - for pp_field in pp_fields: - for word_name in unused: - setattr(pp_field, word_name, 0) - - # Save the textual representation of the PP fields - with open(txt_path, "w") as txt_file: - txt_file.writelines(str(pp_fields)) diff --git a/lib/iris/tests/stock/__init__.py b/lib/iris/tests/stock/__init__.py index 894cc1d02c..8c1154af72 100644 --- a/lib/iris/tests/stock/__init__.py +++ b/lib/iris/tests/stock/__init__.py @@ -2,9 +2,7 @@ # # 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. -"""A collection of routines which create standard Cubes/files for test purposes. - -""" +"""A collection of routines which create standard Cubes/files for test purposes.""" import iris.tests as tests # isort:skip from datetime import datetime diff --git a/lib/iris/tests/test_cartography.py b/lib/iris/tests/test_cartography.py index 0d4845757b..56ac3d52c7 100644 --- a/lib/iris/tests/test_cartography.py +++ b/lib/iris/tests/test_cartography.py @@ -2,9 +2,7 @@ # # 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. -"""Tests elements of the cartography module. - -""" +"""Tests elements of the cartography module.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 5f8b247b79..937df0bc2a 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -2,9 +2,7 @@ # # 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. -"""Test cube indexing, slicing, and extracting, and also the dot graphs. - -""" +"""Test cube indexing, slicing, and extracting, and also the dot graphs.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip @@ -23,7 +21,6 @@ import iris.cube import iris.fileformats import iris.fileformats.dot -import iris.tests.pp as pp import iris.tests.stock @@ -1287,7 +1284,7 @@ def test_non_string_attributes(self): @tests.skip_data -class TestMaskedData(tests.IrisTest, pp.PPTest): +class TestMaskedData(tests.IrisTest, tests.PPTest): def _load_3d_cube(self): # This 3D data set has a missing a slice with SOME missing values. # The missing data is in the pressure = 1000 hPa, forcast_period = 0, diff --git a/lib/iris/tests/test_cf.py b/lib/iris/tests/test_cf.py index 99b39af4f1..89ad0e3f2b 100644 --- a/lib/iris/tests/test_cf.py +++ b/lib/iris/tests/test_cf.py @@ -2,9 +2,7 @@ # # 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. -"""Test the cf module. - -""" +"""Test the cf module.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_concatenate.py b/lib/iris/tests/test_concatenate.py index cb26150d61..d4be638087 100644 --- a/lib/iris/tests/test_concatenate.py +++ b/lib/iris/tests/test_concatenate.py @@ -2,9 +2,7 @@ # # 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. -"""Test the cube concatenate mechanism. - -""" +"""Test the cube concatenate mechanism.""" # import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/test_constraints.py b/lib/iris/tests/test_constraints.py index 4fa34ee63d..f7dab288b6 100644 --- a/lib/iris/tests/test_constraints.py +++ b/lib/iris/tests/test_constraints.py @@ -2,9 +2,7 @@ # # 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. -"""Test the constrained cube loading mechanism. - -""" +"""Test the constrained cube loading mechanism.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_cube_to_pp.py b/lib/iris/tests/test_cube_to_pp.py index e75edee9cd..6ae4567f49 100644 --- a/lib/iris/tests/test_cube_to_pp.py +++ b/lib/iris/tests/test_cube_to_pp.py @@ -17,7 +17,6 @@ import iris.coords import iris.fileformats.pp from iris.fileformats.pp import PPField3 -import iris.tests.pp as pp import iris.tests.stock as stock import iris.util @@ -36,7 +35,7 @@ def itab_callback(cube, field, filename): @tests.skip_data -class TestPPSave(tests.IrisTest, pp.PPTest): +class TestPPSave(tests.IrisTest, tests.PPTest): def test_no_forecast_time(self): cube = stock.lat_lon_cube() coord = iris.coords.DimCoord( @@ -276,7 +275,7 @@ def geog_cs(self): return iris.coord_systems.GeogCS(6371229.0) -class TestPPSaveRules(tests.IrisTest, pp.PPTest): +class TestPPSaveRules(tests.IrisTest, tests.PPTest): def test_default_coord_system(self): GeogCS = iris.coord_systems.GeogCS cube = iris.tests.stock.lat_lon_cube() diff --git a/lib/iris/tests/test_ff.py b/lib/iris/tests/test_ff.py index c4868c8d15..fdfa274bdf 100644 --- a/lib/iris/tests/test_ff.py +++ b/lib/iris/tests/test_ff.py @@ -2,9 +2,7 @@ # # 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. -"""Test the Fieldsfile file loading plugin and FFHeader. - -""" +"""Test the Fieldsfile file loading plugin and FFHeader.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/test_file_load.py b/lib/iris/tests/test_file_load.py index 65bd6e4025..e1510532a1 100644 --- a/lib/iris/tests/test_file_load.py +++ b/lib/iris/tests/test_file_load.py @@ -2,9 +2,7 @@ # # 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. -"""Test the file loading mechanism. - -""" +"""Test the file loading mechanism.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_file_save.py b/lib/iris/tests/test_file_save.py index f3fe60549f..ab0b74c1c2 100644 --- a/lib/iris/tests/test_file_save.py +++ b/lib/iris/tests/test_file_save.py @@ -2,9 +2,7 @@ # # 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. -"""Test the file saving mechanism. - -""" +"""Test the file saving mechanism.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index f8913f4fbd..da7cabe765 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -2,9 +2,7 @@ # # 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. -"""Test the hybrid vertical coordinate representations. - -""" +"""Test the hybrid vertical coordinate representations.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/test_intersect.py b/lib/iris/tests/test_intersect.py index f6287ef1f7..e28c99dea4 100644 --- a/lib/iris/tests/test_intersect.py +++ b/lib/iris/tests/test_intersect.py @@ -2,9 +2,7 @@ # # 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. -"""Test the intersection of Coords. - -""" +"""Test the intersection of Coords.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_io_init.py b/lib/iris/tests/test_io_init.py index 10654e5f64..f8cfaee2bf 100644 --- a/lib/iris/tests/test_io_init.py +++ b/lib/iris/tests/test_io_init.py @@ -2,9 +2,7 @@ # # 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. -"""Test the io/__init__.py module. - -""" +"""Test the io/__init__.py module.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_iterate.py b/lib/iris/tests/test_iterate.py index 627d90e0bc..662707c327 100644 --- a/lib/iris/tests/test_iterate.py +++ b/lib/iris/tests/test_iterate.py @@ -2,9 +2,7 @@ # # 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. -"""Test the iteration of cubes in step. - -""" +"""Test the iteration of cubes in step.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/test_load.py b/lib/iris/tests/test_load.py index c77854b541..b84ab32add 100644 --- a/lib/iris/tests/test_load.py +++ b/lib/iris/tests/test_load.py @@ -2,9 +2,7 @@ # # 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. -"""Test the main loading API. - -""" +"""Test the main loading API.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_mapping.py b/lib/iris/tests/test_mapping.py index 53563dd193..4f59bf8d31 100644 --- a/lib/iris/tests/test_mapping.py +++ b/lib/iris/tests/test_mapping.py @@ -2,9 +2,7 @@ # # 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. -"""Tests map creation. - -""" +"""Tests map creation.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/test_merge.py b/lib/iris/tests/test_merge.py index a9b1069e95..1fc6fd8b10 100644 --- a/lib/iris/tests/test_merge.py +++ b/lib/iris/tests/test_merge.py @@ -2,9 +2,7 @@ # # 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. -"""Test the cube merging mechanism. - -""" +"""Test the cube merging mechanism.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_netcdf.py b/lib/iris/tests/test_netcdf.py index 8509f4edca..049ff55369 100644 --- a/lib/iris/tests/test_netcdf.py +++ b/lib/iris/tests/test_netcdf.py @@ -2,9 +2,7 @@ # # 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. -"""Test CF-NetCDF file loading and saving. - -""" +"""Test CF-NetCDF file loading and saving.""" # Import iris tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/test_pickling.py b/lib/iris/tests/test_pickling.py index 7bea687231..311e6ec9aa 100644 --- a/lib/iris/tests/test_pickling.py +++ b/lib/iris/tests/test_pickling.py @@ -2,9 +2,7 @@ # # 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. -"""Test pickling of Iris objects. - -""" +"""Test pickling of Iris objects.""" # Import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/test_pp_cf.py b/lib/iris/tests/test_pp_cf.py index 1495fd65d1..8b0af5a5c3 100644 --- a/lib/iris/tests/test_pp_cf.py +++ b/lib/iris/tests/test_pp_cf.py @@ -13,7 +13,6 @@ import iris.coords from iris.fileformats.netcdf import _thread_safe_nc from iris.fileformats.pp import STASH -import iris.tests.pp as pp import iris.util @@ -64,7 +63,7 @@ def callback_aaxzc_n10r13xy_b_pp(cube, field, filename): @tests.skip_data -class TestAll(tests.IrisTest, pp.PPTest): +class TestAll(tests.IrisTest, tests.PPTest): _ref_dir = ("usecases", "pp_to_cf_conversion") def _test_file(self, name): diff --git a/lib/iris/tests/test_quickplot.py b/lib/iris/tests/test_quickplot.py index f6a5d210e0..fdd534a2c5 100644 --- a/lib/iris/tests/test_quickplot.py +++ b/lib/iris/tests/test_quickplot.py @@ -2,9 +2,7 @@ # # 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. -"""Tests the high-level plotting interface. - -""" +"""Tests the high-level plotting interface.""" # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/test_util.py b/lib/iris/tests/test_util.py index d9cebf224f..56774f89f8 100644 --- a/lib/iris/tests/test_util.py +++ b/lib/iris/tests/test_util.py @@ -2,9 +2,7 @@ # # 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. -"""Test iris.util. - -""" +"""Test iris.util.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py b/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py index 93354d4278..82f6fe693d 100644 --- a/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py +++ b/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.analysis._area_weighted.AreaWeightedRegridder`. - -""" +"""Unit tests for :class:`iris.analysis._area_weighted.AreaWeightedRegridder`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py b/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py index 44695b81c3..7cb4d80f49 100644 --- a/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py +++ b/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.analysis.geometry._extract_relevant_cube_slice`. - -""" +"""Unit tests for :func:`iris.analysis.geometry._extract_relevant_cube_slice`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py index b37fa1de62..ed6e230840 100644 --- a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py +++ b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.analysis._interpolation.RectilinearInterpolator`. - -""" +"""Unit tests for :class:`iris.analysis._interpolation.RectilinearInterpolator`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py b/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py index 6300b81d1a..ae47159df3 100644 --- a/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py +++ b/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.analysis._interpolation.get_xy_dim_coords`. - -""" +"""Unit tests for :func:`iris.analysis._interpolation.get_xy_dim_coords`.""" # import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/unit/analysis/maths/test__get_dtype.py b/lib/iris/tests/unit/analysis/maths/test__get_dtype.py index 4388913d54..643d7e43d7 100644 --- a/lib/iris/tests/unit/analysis/maths/test__get_dtype.py +++ b/lib/iris/tests/unit/analysis/maths/test__get_dtype.py @@ -2,9 +2,7 @@ # # 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 function :func:`iris.analysis.maths._get_dtype`. - -""" +"""Unit tests for the function :func:`iris.analysis.maths._get_dtype`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py b/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py index 42317b7efd..7ce6bc79c1 100644 --- a/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py +++ b/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py @@ -2,9 +2,7 @@ # # 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 function :func:`iris.analysis.maths._inplace_common_checks`. - -""" +"""Unit tests for the function :func:`iris.analysis.maths._inplace_common_checks`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/maths/test__output_dtype.py b/lib/iris/tests/unit/analysis/maths/test__output_dtype.py index b14db4120a..4e5845b73f 100644 --- a/lib/iris/tests/unit/analysis/maths/test__output_dtype.py +++ b/lib/iris/tests/unit/analysis/maths/test__output_dtype.py @@ -2,9 +2,7 @@ # # 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 function :func:`iris.analysis.maths._output_dtype`. - -""" +"""Unit tests for the function :func:`iris.analysis.maths._output_dtype`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/test_PercentileAggregator.py b/lib/iris/tests/unit/analysis/test_PercentileAggregator.py index 84628c9ae5..9099ac42fe 100644 --- a/lib/iris/tests/unit/analysis/test_PercentileAggregator.py +++ b/lib/iris/tests/unit/analysis/test_PercentileAggregator.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.analysis.PercentileAggregator` class instance. - -""" +"""Unit tests for the :class:`iris.analysis.PercentileAggregator` class instance.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py b/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py index 0531a5aa3d..1d047db6b6 100644 --- a/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py +++ b/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.analysis.PercentileAggregator` class instance. - -""" +"""Unit tests for the :class:`iris.analysis.PercentileAggregator` class instance.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py b/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py index 7f01a816fa..abf0e86513 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.analysis.trajectory.Trajectory`. - -""" +"""Unit tests for :class:`iris.analysis.trajectory.Trajectory`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py b/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py index 05a2d666cc..c171b18f6e 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py @@ -2,9 +2,7 @@ # # 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 :meth:`iris.analysis.trajectory.interpolate`. - -""" +"""Unit tests for :meth:`iris.analysis.trajectory.interpolate`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py b/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py index 6029f2c518..5e136395b5 100644 --- a/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py +++ b/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py @@ -2,9 +2,7 @@ # # 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 `iris.aux_factory.AuxCoordFactory`. - -""" +"""Unit tests for `iris.aux_factory.AuxCoordFactory`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/lenient/test_Lenient.py b/lib/iris/tests/unit/common/lenient/test_Lenient.py index abafcc1a3e..375a745ce8 100644 --- a/lib/iris/tests/unit/common/lenient/test_Lenient.py +++ b/lib/iris/tests/unit/common/lenient/test_Lenient.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.lenient.Lenient`. - -""" +"""Unit tests for the :class:`iris.common.lenient.Lenient`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/lenient/test__Lenient.py b/lib/iris/tests/unit/common/lenient/test__Lenient.py index 0ed947e513..814359fbaf 100644 --- a/lib/iris/tests/unit/common/lenient/test__Lenient.py +++ b/lib/iris/tests/unit/common/lenient/test__Lenient.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.lenient._Lenient`. - -""" +"""Unit tests for the :class:`iris.common.lenient._Lenient`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. 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 54e2aca185..509b183003 100644 --- a/lib/iris/tests/unit/common/lenient/test__lenient_client.py +++ b/lib/iris/tests/unit/common/lenient/test__lenient_client.py @@ -2,9 +2,7 @@ # # 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.common.lenient._lenient_client`. - -""" +"""Unit tests for the :func:`iris.common.lenient._lenient_client`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. 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 a916779c79..c0ed8df403 100644 --- a/lib/iris/tests/unit/common/lenient/test__lenient_service.py +++ b/lib/iris/tests/unit/common/lenient/test__lenient_service.py @@ -2,9 +2,7 @@ # # 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.common.lenient._lenient_service`. - -""" +"""Unit tests for the :func:`iris.common.lenient._lenient_service`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/lenient/test__qualname.py b/lib/iris/tests/unit/common/lenient/test__qualname.py index 47b779f6da..49576814d4 100644 --- a/lib/iris/tests/unit/common/lenient/test__qualname.py +++ b/lib/iris/tests/unit/common/lenient/test__qualname.py @@ -2,9 +2,7 @@ # # 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.common.lenient._qualname`. - -""" +"""Unit tests for the :func:`iris.common.lenient._qualname`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_AncillaryVariableMetadata.py b/lib/iris/tests/unit/common/metadata/test_AncillaryVariableMetadata.py index 2bc9cd9191..b7304f4301 100644 --- a/lib/iris/tests/unit/common/metadata/test_AncillaryVariableMetadata.py +++ b/lib/iris/tests/unit/common/metadata/test_AncillaryVariableMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.metadata.AncillaryVariableMetadata`. - -""" +"""Unit tests for the :class:`iris.common.metadata.AncillaryVariableMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_BaseMetadata.py b/lib/iris/tests/unit/common/metadata/test_BaseMetadata.py index 60bde320a5..73886882de 100644 --- a/lib/iris/tests/unit/common/metadata/test_BaseMetadata.py +++ b/lib/iris/tests/unit/common/metadata/test_BaseMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.metadata.BaseMetadata`. - -""" +"""Unit tests for the :class:`iris.common.metadata.BaseMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py b/lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py index 4801f99385..3618d2ace5 100644 --- a/lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py +++ b/lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.metadata.CellMeasureMetadata`. - -""" +"""Unit tests for the :class:`iris.common.metadata.CellMeasureMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_CoordMetadata.py b/lib/iris/tests/unit/common/metadata/test_CoordMetadata.py index b5cdeaca47..010838b7fc 100644 --- a/lib/iris/tests/unit/common/metadata/test_CoordMetadata.py +++ b/lib/iris/tests/unit/common/metadata/test_CoordMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.metadata.CoordMetadata`. - -""" +"""Unit tests for the :class:`iris.common.metadata.CoordMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_CubeMetadata.py b/lib/iris/tests/unit/common/metadata/test_CubeMetadata.py index 0bcb553729..92af65da5c 100644 --- a/lib/iris/tests/unit/common/metadata/test_CubeMetadata.py +++ b/lib/iris/tests/unit/common/metadata/test_CubeMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.metadata.CubeMetadata`. - -""" +"""Unit tests for the :class:`iris.common.metadata.CubeMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test__NamedTupleMeta.py b/lib/iris/tests/unit/common/metadata/test__NamedTupleMeta.py index bdf48029e4..5099645082 100644 --- a/lib/iris/tests/unit/common/metadata/test__NamedTupleMeta.py +++ b/lib/iris/tests/unit/common/metadata/test__NamedTupleMeta.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.metadata._NamedTupleMeta`. - -""" +"""Unit tests for the :class:`iris.common.metadata._NamedTupleMeta`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_hexdigest.py b/lib/iris/tests/unit/common/metadata/test_hexdigest.py index 035e051440..1a0a0e0120 100644 --- a/lib/iris/tests/unit/common/metadata/test_hexdigest.py +++ b/lib/iris/tests/unit/common/metadata/test_hexdigest.py @@ -2,9 +2,7 @@ # # 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.common.metadata.hexdigest`. - -""" +"""Unit tests for the :func:`iris.common.metadata.hexdigest`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/metadata/test_metadata_filter.py b/lib/iris/tests/unit/common/metadata/test_metadata_filter.py index c77d0dc357..586a5fe5f8 100644 --- a/lib/iris/tests/unit/common/metadata/test_metadata_filter.py +++ b/lib/iris/tests/unit/common/metadata/test_metadata_filter.py @@ -2,9 +2,7 @@ # # 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.common.metadata_filter`. - -""" +"""Unit tests for the :func:`iris.common.metadata_filter`.""" import numpy as np diff --git a/lib/iris/tests/unit/common/metadata/test_metadata_manager_factory.py b/lib/iris/tests/unit/common/metadata/test_metadata_manager_factory.py index 3eda14e635..e9ec42e04b 100644 --- a/lib/iris/tests/unit/common/metadata/test_metadata_manager_factory.py +++ b/lib/iris/tests/unit/common/metadata/test_metadata_manager_factory.py @@ -2,9 +2,7 @@ # # 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.common.metadata.metadata_manager_factory`. - -""" +"""Unit tests for the :func:`iris.common.metadata.metadata_manager_factory`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/mixin/test_CFVariableMixin.py b/lib/iris/tests/unit/common/mixin/test_CFVariableMixin.py index 2e858a74bf..020f18a358 100644 --- a/lib/iris/tests/unit/common/mixin/test_CFVariableMixin.py +++ b/lib/iris/tests/unit/common/mixin/test_CFVariableMixin.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.mixin.CFVariableMixin`. - -""" +"""Unit tests for the :class:`iris.common.mixin.CFVariableMixin`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/mixin/test_LimitedAttributeDict.py b/lib/iris/tests/unit/common/mixin/test_LimitedAttributeDict.py index 85d4cfe9a3..f538279bb1 100644 --- a/lib/iris/tests/unit/common/mixin/test_LimitedAttributeDict.py +++ b/lib/iris/tests/unit/common/mixin/test_LimitedAttributeDict.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.mixin.LimitedAttributeDict`. - -""" +"""Unit tests for the :class:`iris.common.mixin.LimitedAttributeDict`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/mixin/test__get_valid_standard_name.py b/lib/iris/tests/unit/common/mixin/test__get_valid_standard_name.py index d7b929eeb3..67ba108333 100644 --- a/lib/iris/tests/unit/common/mixin/test__get_valid_standard_name.py +++ b/lib/iris/tests/unit/common/mixin/test__get_valid_standard_name.py @@ -2,9 +2,7 @@ # # 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.common.mixin._get_valid_standard_name`. - -""" +"""Unit tests for the :func:`iris.common.mixin._get_valid_standard_name`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/common/resolve/test_Resolve.py b/lib/iris/tests/unit/common/resolve/test_Resolve.py index 96b12f149a..0bad967acb 100644 --- a/lib/iris/tests/unit/common/resolve/test_Resolve.py +++ b/lib/iris/tests/unit/common/resolve/test_Resolve.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.common.resolve.Resolve`. - -""" +"""Unit tests for the :class:`iris.common.resolve.Resolve`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/coord_categorisation/test_add_hour.py b/lib/iris/tests/unit/coord_categorisation/test_add_hour.py index 05a0f3e474..c6b0a53656 100644 --- a/lib/iris/tests/unit/coord_categorisation/test_add_hour.py +++ b/lib/iris/tests/unit/coord_categorisation/test_add_hour.py @@ -2,8 +2,7 @@ # # 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. -"""Test coordinate categorisation function add_hour. -""" +"""Test coordinate categorisation function add_hour.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/coord_categorisation/test_coord_categorisation.py b/lib/iris/tests/unit/coord_categorisation/test_coord_categorisation.py index 7730831e52..daf4b7e3f2 100644 --- a/lib/iris/tests/unit/coord_categorisation/test_coord_categorisation.py +++ b/lib/iris/tests/unit/coord_categorisation/test_coord_categorisation.py @@ -2,8 +2,7 @@ # # 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. -"""Test the coordinate categorisation functions. -""" +"""Test the coordinate categorisation functions.""" import warnings diff --git a/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py b/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py index 768cca70b7..6c28562133 100644 --- a/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py +++ b/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.coord_systems.AlbersEqualArea` class. - -""" +"""Unit tests for the :class:`iris.coord_systems.AlbersEqualArea` class.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py b/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py index a1d978811d..06b6aad5d3 100644 --- a/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py +++ b/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.coord_systems.LambertAzimuthalEqualArea` class. - -""" +"""Unit tests for the :class:`iris.coord_systems.LambertAzimuthalEqualArea` 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_CellMethod.py b/lib/iris/tests/unit/coords/test_CellMethod.py index 58a10aff50..f2a468ecf1 100644 --- a/lib/iris/tests/unit/coords/test_CellMethod.py +++ b/lib/iris/tests/unit/coords/test_CellMethod.py @@ -2,8 +2,7 @@ # # 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 :class:`iris.coords.CellMethod`. -""" +"""Unit tests for the :class:`iris.coords.CellMethod`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/data_manager/test_DataManager.py b/lib/iris/tests/unit/data_manager/test_DataManager.py index f35c2fcfcb..b419e556a7 100644 --- a/lib/iris/tests/unit/data_manager/test_DataManager.py +++ b/lib/iris/tests/unit/data_manager/test_DataManager.py @@ -2,9 +2,7 @@ # # 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 :class:`iris._data_manager.DataManager`. - -""" +"""Unit tests for the :class:`iris._data_manager.DataManager`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/experimental/stratify/test_relevel.py b/lib/iris/tests/unit/experimental/stratify/test_relevel.py index f587019f3a..1f0a5618aa 100644 --- a/lib/iris/tests/unit/experimental/stratify/test_relevel.py +++ b/lib/iris/tests/unit/experimental/stratify/test_relevel.py @@ -2,9 +2,7 @@ # # 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.experimental.stratify.relevel` function. - -""" +"""Unit tests for the :func:`iris.experimental.stratify.relevel` function.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/experimental/ugrid/load/test_load_mesh.py b/lib/iris/tests/unit/experimental/ugrid/load/test_load_mesh.py index 09e15915db..382a36fa71 100644 --- a/lib/iris/tests/unit/experimental/ugrid/load/test_load_mesh.py +++ b/lib/iris/tests/unit/experimental/ugrid/load/test_load_mesh.py @@ -2,9 +2,7 @@ # # 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.experimental.ugrid.load.load_mesh` function. - -""" +"""Unit tests for the :func:`iris.experimental.ugrid.load.load_mesh` function.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/load/test_load_meshes.py b/lib/iris/tests/unit/experimental/ugrid/load/test_load_meshes.py index d0cfdd4309..8932989252 100644 --- a/lib/iris/tests/unit/experimental/ugrid/load/test_load_meshes.py +++ b/lib/iris/tests/unit/experimental/ugrid/load/test_load_meshes.py @@ -2,9 +2,7 @@ # # 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.experimental.ugrid.load.load_meshes` function. - -""" +"""Unit tests for the :func:`iris.experimental.ugrid.load.load_meshes` function.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py b/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py index bf5500c7ed..2282bc07b9 100644 --- a/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py +++ b/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.experimental.ugrid.mesh.MeshCoord`. - -""" +"""Unit tests for the :class:`iris.experimental.ugrid.mesh.MeshCoord`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/mesh/test_Mesh__from_coords.py b/lib/iris/tests/unit/experimental/ugrid/mesh/test_Mesh__from_coords.py index 4d12a73a9e..31c5dbfcc0 100644 --- a/lib/iris/tests/unit/experimental/ugrid/mesh/test_Mesh__from_coords.py +++ b/lib/iris/tests/unit/experimental/ugrid/mesh/test_Mesh__from_coords.py @@ -2,9 +2,7 @@ # # 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 :meth:`iris.experimental.ugrid.mesh.Mesh.from_coords`. - -""" +"""Unit tests for the :meth:`iris.experimental.ugrid.mesh.Mesh.from_coords`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/metadata/test_ConnectivityMetadata.py b/lib/iris/tests/unit/experimental/ugrid/metadata/test_ConnectivityMetadata.py index b0d4d70cbe..fa62a9f7e2 100644 --- a/lib/iris/tests/unit/experimental/ugrid/metadata/test_ConnectivityMetadata.py +++ b/lib/iris/tests/unit/experimental/ugrid/metadata/test_ConnectivityMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.experimental.ugrid.metadata.ConnectivityMetadata`. - -""" +"""Unit tests for the :class:`iris.experimental.ugrid.metadata.ConnectivityMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshCoordMetadata.py b/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshCoordMetadata.py index dbf1446b52..fc9242a8f9 100644 --- a/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshCoordMetadata.py +++ b/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshCoordMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.experimental.ugrid.metadata.MeshCoordMetadata`. - -""" +"""Unit tests for the :class:`iris.experimental.ugrid.metadata.MeshCoordMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshMetadata.py b/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshMetadata.py index 98e918c342..080d94c188 100644 --- a/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshMetadata.py +++ b/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshMetadata.py @@ -2,9 +2,7 @@ # # 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 :class:`iris.experimental.ugrid.metadata.MeshMetadata`. - -""" +"""Unit tests for the :class:`iris.experimental.ugrid.metadata.MeshMetadata`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/experimental/ugrid/utils/test_recombine_submeshes.py b/lib/iris/tests/unit/experimental/ugrid/utils/test_recombine_submeshes.py index 9fcb775433..f01dc345fa 100644 --- a/lib/iris/tests/unit/experimental/ugrid/utils/test_recombine_submeshes.py +++ b/lib/iris/tests/unit/experimental/ugrid/utils/test_recombine_submeshes.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.experimental.ugrid.utils.recombine_submeshes`. - -""" +"""Unit tests for :func:`iris.experimental.ugrid.utils.recombine_submeshes`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip diff --git a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py index 0e6805d104..667c679bfb 100644 --- a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py +++ b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py @@ -2,9 +2,7 @@ # # 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.fileformats.cf.CFReader` class. - -""" +"""Unit tests for the `iris.fileformats.cf.CFReader` class.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py b/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py index 2d9faa90e5..98dc5000bc 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.fileformats.name_loaders._build_cell_methods`. - -""" +"""Unit tests for :func:`iris.fileformats.name_loaders._build_cell_methods`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__build_lat_lon_for_NAME_timeseries.py b/lib/iris/tests/unit/fileformats/name_loaders/test__build_lat_lon_for_NAME_timeseries.py index 0a020e6142..9cc7ec356a 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__build_lat_lon_for_NAME_timeseries.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__build_lat_lon_for_NAME_timeseries.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.analysis.name_loaders._build_lat_lon_for_NAME_timeseries`. - -""" +"""Unit tests for :func:`iris.analysis.name_loaders._build_lat_lon_for_NAME_timeseries`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py b/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py index fb28ad911b..35ca2760b8 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.fileformats.name_loaders.__calc_integration_period`. - -""" +"""Unit tests for :func:`iris.fileformats.name_loaders.__calc_integration_period`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py b/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py index f41c52c105..fc00db9663 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.analysis.name_loaders._generate_cubes`. - -""" +"""Unit tests for :func:`iris.analysis.name_loaders._generate_cubes`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/__init__.py b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/__init__.py index 8107a869f4..ac20e95682 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/__init__.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/__init__.py @@ -2,9 +2,7 @@ # # 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 module :mod:`iris.fileformats._nc_load_rules.actions`. - -""" +"""Unit tests for the module :mod:`iris.fileformats._nc_load_rules.actions`.""" from pathlib import Path import shutil import tempfile diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/engine/test_engine.py b/lib/iris/tests/unit/fileformats/nc_load_rules/engine/test_engine.py index e54c6938bc..7aaca67326 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/engine/test_engine.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/engine/test_engine.py @@ -2,9 +2,7 @@ # # 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 :mod:`iris.fileformats._nc_load_rules.engine` module. - -""" +"""Unit tests for the :mod:`iris.fileformats._nc_load_rules.engine` module.""" from unittest import mock from iris.fileformats._nc_load_rules.engine import Engine, FactEntity diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_ancil_var.py b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_ancil_var.py index 5ee0c2d992..0193ef68d5 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_ancil_var.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_ancil_var.py @@ -2,9 +2,7 @@ # # 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. -"""Test function :func:`iris.fileformats._nc_load_rules.helpers.build_ancil_var`. - -""" +"""Test function :func:`iris.fileformats._nc_load_rules.helpers.build_ancil_var`.""" from unittest import mock diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_cell_measure.py b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_cell_measure.py index 74e7d5117d..bdd057b537 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_cell_measure.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_cell_measure.py @@ -2,9 +2,7 @@ # # 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. -"""Test function :func:`iris.fileformats._nc_load_rules.helpers.build_cell_measure`. - -""" +"""Test function :func:`iris.fileformats._nc_load_rules.helpers.build_cell_measure`.""" from unittest import mock diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_oblique_mercator_coordinate_system.py b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_oblique_mercator_coordinate_system.py index 4554ef601d..3e12e33762 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_oblique_mercator_coordinate_system.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_oblique_mercator_coordinate_system.py @@ -2,9 +2,7 @@ # # 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. -"""Test function :func:`iris.fileformats._nc_load_rules.helpers.build_oblique_mercator_coordinate_system`. - -""" +"""Test function :func:`iris.fileformats._nc_load_rules.helpers.build_oblique_mercator_coordinate_system`.""" from typing import List, NamedTuple, Type from unittest import mock diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_parse_cell_methods.py b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_parse_cell_methods.py index abbe71012d..500ecd51d8 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_parse_cell_methods.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_parse_cell_methods.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.fileformats.netcdf.parse_cell_methods`. - -""" +"""Unit tests for :func:`iris.fileformats.netcdf.parse_cell_methods`.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/fileformats/netcdf/saver/test__fillvalue_report.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test__fillvalue_report.py index 77fd0cb0ca..c0046e547a 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/saver/test__fillvalue_report.py +++ b/lib/iris/tests/unit/fileformats/netcdf/saver/test__fillvalue_report.py @@ -2,8 +2,7 @@ # # 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 :func:`iris.fileformats.netcdf.saver._fillvalue_report`. -""" +"""Unit tests for :func:`iris.fileformats.netcdf.saver._fillvalue_report`.""" import warnings import numpy as np diff --git a/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_units.py b/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_units.py index 03ec3f5f65..2767807377 100644 --- a/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_units.py +++ b/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_units.py @@ -2,9 +2,7 @@ # # 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.fileformats.nimrod_load_rules.units` function. - -""" +"""Unit tests for the `iris.fileformats.nimrod_load_rules.units` function.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py b/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py index 1dbb2097fb..3bd8fcb8d7 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py +++ b/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py @@ -2,9 +2,7 @@ # # 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.fileformats.pp._data_bytes_to_shaped_array` function. - -""" +"""Unit tests for the `iris.fileformats.pp._data_bytes_to_shaped_array` function.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py index 58b7c1f384..aa6b79e9a0 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py @@ -2,9 +2,7 @@ # # 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.fileformats.pp_load_rules._all_other_rules` function. - -""" +"""Unit tests for the `iris.fileformats.pp_load_rules._all_other_rules` function.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py index fd3d236625..65c6bc8442 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py @@ -2,9 +2,7 @@ # # 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 :func:`iris.fileformats.pp_load_rules._model_level_number`. - -""" +"""Unit tests for :func:`iris.fileformats.pp_load_rules._model_level_number`.""" # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/test_rules.py b/lib/iris/tests/unit/fileformats/test_rules.py index f8be75f8fc..d39b6a997d 100644 --- a/lib/iris/tests/unit/fileformats/test_rules.py +++ b/lib/iris/tests/unit/fileformats/test_rules.py @@ -2,9 +2,7 @@ # # 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. -"""Test iris.fileformats.rules.py - metadata translation rules. - -""" +"""Test iris.fileformats.rules.py - metadata translation rules.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py b/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py index 89897d173b..1737fcb6cd 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py @@ -2,6 +2,4 @@ # # 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 module :mod:`iris.fileformats.um._fast_load`. - -""" +"""Unit tests for the module :mod:`iris.fileformats.um._fast_load`.""" diff --git a/lib/iris/tests/unit/util/test_equalise_attributes.py b/lib/iris/tests/unit/util/test_equalise_attributes.py index 4a900d2cbb..9b09c84dd4 100644 --- a/lib/iris/tests/unit/util/test_equalise_attributes.py +++ b/lib/iris/tests/unit/util/test_equalise_attributes.py @@ -2,9 +2,7 @@ # # 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.util.equalise_attributes` function. - -""" +"""Unit tests for the :func:`iris.util.equalise_attributes` function.""" # import iris tests first so that some things can be initialised # before importing anything else. diff --git a/lib/iris/tests/unit/util/test_file_is_newer_than.py b/lib/iris/tests/unit/util/test_file_is_newer_than.py index 93385ed0e0..567b2a1439 100644 --- a/lib/iris/tests/unit/util/test_file_is_newer_than.py +++ b/lib/iris/tests/unit/util/test_file_is_newer_than.py @@ -2,9 +2,7 @@ # # 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. -"""Test function :func:`iris.util.test_file_is_newer`. - -""" +"""Test function :func:`iris.util.test_file_is_newer`.""" # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/util.py b/lib/iris/util.py index d030924a52..7d87492c7f 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -2,9 +2,7 @@ # # 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. -"""Miscellaneous utility functions. - -""" +"""Miscellaneous utility functions.""" from abc import ABCMeta, abstractmethod from collections.abc import Hashable, Iterable diff --git a/pyproject.toml b/pyproject.toml index d0c2816e93..37384a3c3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,14 @@ ignore = [ force-sort-within-sections = true known-first-party = ["iris"] +[tool.ruff.lint.per-file-ignores] +# All test scripts +"test_*.py" = [ + # https://docs.astral.sh/ruff/rules/undocumented-public-module/ + "D100", # Missing docstring in public module +] + + [tool.ruff.lint.pydocstyle] convention = "numpy" diff --git a/setup.py b/setup.py index 6e58a7999d..1027085e81 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +"""Iris setup.""" + import os import sys