Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruff compliance for D200. #5675

Merged
merged 4 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ lint.ignore = [
# (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
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
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
4 changes: 1 addition & 3 deletions lib/iris/_data_manager.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.
"""Management of common state and behaviour for cube and coordinate data.

"""
"""Management of common state and behaviour for cube and coordinate data."""

import copy

Expand Down
4 changes: 1 addition & 3 deletions lib/iris/_deprecation.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.
"""Utilities for producing runtime deprecation messages.

"""
"""Utilities for producing runtime deprecation messages."""

import warnings

Expand Down
4 changes: 1 addition & 3 deletions lib/iris/_representation/__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.
"""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."""
4 changes: 1 addition & 3 deletions lib/iris/_representation/cube_printout.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.
"""Provides text printouts of Iris cubes.

"""
"""Provides text printouts of Iris cubes."""
from copy import deepcopy

from iris._representation.cube_summary import CubeSummary
Expand Down
3 changes: 1 addition & 2 deletions lib/iris/_representation/cube_summary.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.
"""Provides objects describing cube summaries.
"""
"""Provides objects describing cube summaries."""
import re

from iris.common.metadata import hexdigest
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/analysis/cartography.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.
"""Various utilities and numeric transformations relevant to cartography.

"""
"""Various utilities and numeric transformations relevant to cartography."""

from collections import namedtuple
import copy
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/analysis/maths.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.
"""Basic mathematical and statistical operations.

"""
"""Basic mathematical and statistical operations."""

from functools import lru_cache
import inspect
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/analysis/stats.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.
"""Statistical operations between cubes.

"""
"""Statistical operations between cubes."""

import numpy as np
import numpy.ma as ma
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/common/__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.
"""A package for provisioning common Iris infrastructure.

"""
"""A package for provisioning common Iris infrastructure."""

from .lenient import *
from .metadata import *
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/common/lenient.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.
"""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
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/common/metadata.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.
"""Provides the infrastructure to support the common metadata API.

"""
"""Provides the infrastructure to support the common metadata API."""


from abc import ABCMeta
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/common/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.
"""Provides common metadata mixin behaviour.

"""
"""Provides common metadata mixin behaviour."""

from collections.abc import Mapping
from functools import wraps
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/coord_systems.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.
"""Definitions of coordinate systems.

"""
"""Definitions of coordinate systems."""

from abc import ABCMeta, abstractmethod
from functools import cached_property
Expand Down
Loading