Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into autoapi
Browse files Browse the repository at this point in the history
* upstream/main:
  Make further topics obviously different (SciTools#5684)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5682)
  ruff complliance for D100. (SciTools#5678)
  move tests.pp to tests.__init__ (SciTools#5679)
  ruff compliance for D417, D106 (SciTools#5677)
  ruff compliance for D200. (SciTools#5675)
  • Loading branch information
tkknight committed Jan 10, 2024
2 parents 2a60b7c + d528fce commit b1fd68b
Show file tree
Hide file tree
Showing 178 changed files with 316 additions and 537 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
4 changes: 0 additions & 4 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/aux_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/cperf/equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/cperf/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/cperf/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/experimental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/experimental/ugrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/generate_data/ugrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions benchmarks/benchmarks/import_iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

################
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/metadata_manager_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/regridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/sperf/combine_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/sperf/equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/sperf/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/sperf/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/benchmarks/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/bm_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/gallery_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
2 changes: 2 additions & 0 deletions docs/gallery_tests/test_gallery_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# serve to show the default.
# ----------------------------------------------------------------------------

"""sphinx config."""

import datetime
from importlib.metadata import version as get_version
import ntpath
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions docs/src/developers_guide/documenting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa: D104
3 changes: 3 additions & 0 deletions docs/src/developers_guide/documenting/docstrings_attribute.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""docstring attribute example."""


class ExampleClass:
"""Class Summary."""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""docstring routine example."""


def sample_routine(arg1, arg2, kwarg1="foo", kwarg2=None):
"""Purpose section text goes here.
Expand Down
12 changes: 6 additions & 6 deletions docs/src/further_topics/filtering_warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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)

::
Expand All @@ -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(

::
Expand Down Expand Up @@ -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)

----
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/1d_quickplot_simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simple 1D plot using iris.quickplot.plot()."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/1d_simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simple 1D plot using iris.plot.plot()."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/1d_with_legend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simple 1D plot using iris.plot.plot() with a legend."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/brewer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Plot a chart of all Brewer colour schemes."""

import matplotlib.pyplot as plt
import numpy as np

Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/cube_blockplot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Cube block plot using using iris.plot.pcolormesh()."""

import matplotlib.pyplot as plt

import iris
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Addind a citation for a plot using iris.plot.citation()."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/cube_brewer_contourf.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 5 additions & 0 deletions docs/src/userguide/plotting_examples/cube_contour.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit b1fd68b

Please sign in to comment.