Skip to content

Commit 2355916

Browse files
committed
Merge remote-tracking branch 'upstream/main' into api_toc_expand
* upstream/main: (26 commits) Bump scitools/workflows from 2023.12.1 to 2024.01.0 (SciTools#5710) Faster trivial equality checks for coordinates and arrays (SciTools#5691) Make the Coord.cell method lazy (SciTools#5693) Re-write `pearsonr` to use `Resolve` (SciTools#5638) ruff compliance for D401. (SciTools#5687) Bump actions/cache from 3 to 4 (SciTools#5703) update rtd ubuntu and mambaforge (SciTools#5702) [pre-commit.ci] pre-commit autoupdate (SciTools#5699) ruff compliance for D205. (SciTools#5681) Added whatsnew to warnings PR (SciTools#5696) Removed use of catch_warnings (SciTools#5685) Better documentation for Cube names in curl (SciTools#5680) fix typo (SciTools#5689) 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) ruff compliance for D106. (SciTools#5676) ...
2 parents 320b815 + 34811cf commit 2355916

File tree

274 files changed

+5561
-5152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+5561
-5152
lines changed

Diff for: .github/workflows/benchmarks_run.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
4747
- name: Cache environment directories
4848
id: cache-env-dir
49-
uses: actions/cache@v3
49+
uses: actions/cache@v4
5050
with:
5151
path: |
5252
.nox
@@ -56,7 +56,7 @@ jobs:
5656

5757
- name: Cache test data directory
5858
id: cache-test-data
59-
uses: actions/cache@v3
59+
uses: actions/cache@v4
6060
with:
6161
path: |
6262
${{ env.IRIS_TEST_DATA_PATH }}

Diff for: .github/workflows/ci-manifest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ concurrency:
2323
jobs:
2424
manifest:
2525
name: "check-manifest"
26-
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2023.12.1
26+
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2024.01.0

Diff for: .github/workflows/refresh-lockfiles.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ on:
1414

1515
jobs:
1616
refresh_lockfiles:
17-
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2023.12.1
17+
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2024.01.0
1818
secrets: inherit

Diff for: .pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
- id: no-commit-to-branch
3030

3131
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: "v0.1.9"
32+
rev: "v0.1.13"
3333
hooks:
3434
- id: ruff
3535
types: [file, python]
@@ -45,7 +45,7 @@ repos:
4545
additional_dependencies: [tomli]
4646

4747
- repo: https://github.com/PyCQA/flake8
48-
rev: 6.1.0
48+
rev: 7.0.0
4949
hooks:
5050
- id: flake8
5151
types: [file, python]

Diff for: .readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22

33
build:
4-
os: ubuntu-20.04
4+
os: "ubuntu-22.04"
55
tools:
6-
python: mambaforge-4.10
6+
python: "mambaforge-22.9"
77
jobs:
88
post_checkout:
99
# The SciTools/iris repository is shallow i.e., has a .git/shallow,

Diff for: .ruff.toml

+1-26
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ lint.ignore = [
1111
# pycodestyle (E, W)
1212
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
1313
"E",
14-
"W",
1514

1615
# mccabe (C90)
1716
# https://docs.astral.sh/ruff/rules/#mccabe-c90
@@ -26,22 +25,10 @@ lint.ignore = [
2625
# (D-1) Permanent
2726
"D105", # Missing docstring in magic method
2827
# (D-2) Temporary, to be removed when we are more compliant. Rare cases mmove to (1).
29-
"D417", # Missing argument descriptions in the docstring
3028
"D101", # Missing docstring in public class
3129
"D102", # Missing docstring in public method
32-
"D104", # Missing docstring in public package
33-
"D106", # Missing docstring in public nested class
34-
# (D-3) Temporary, before an initial review, either fix ocurrenvces or move to (2).
35-
"D100", # Missing docstring in public module
30+
# (D-3) Temporary, before an initial review, either fix ocurrences or move to (2).
3631
"D103", # Missing docstring in public function
37-
"D200", # One-line docstring should fit on one line
38-
"D202", # No blank lines allowed after function docstring
39-
"D205", # 1 blank line required between summary line and description
40-
"D401", # First line of docstring should be in imperative mood: ...
41-
"D404", # First word of the docstring should not be "This"
42-
"D405", # Section name should be properly capitalized
43-
"D406", # Section name should end with a newline
44-
"D407", # Missing dashed underline after section
4532

4633
# pyupgrade (UP)
4734
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
@@ -71,10 +58,6 @@ lint.ignore = [
7158
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
7259
"A",
7360

74-
# flake8-copyright (CPY)
75-
# https://docs.astral.sh/ruff/rules/#flake8-copyright-cpy
76-
"CPY",
77-
7861
# flake8-comprehensions (C4)
7962
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
8063
"C4",
@@ -91,10 +74,6 @@ lint.ignore = [
9174
# https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
9275
"FA",
9376

94-
# flake8-implicit-str-concat (ISC)
95-
# https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
96-
"ISC",
97-
9877
# flake8-logging-format (G)
9978
# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
10079
"G",
@@ -187,10 +166,6 @@ lint.ignore = [
187166
# https://docs.astral.sh/ruff/rules/#flynt-fly
188167
"FLY",
189168

190-
# Airflow (AIR)
191-
# https://docs.astral.sh/ruff/rules/#airflow-air
192-
"AIR",
193-
194169
# Perflint (PERF)
195170
# https://docs.astral.sh/ruff/rules/#perflint-perf
196171
"PERF",

Diff for: benchmarks/asv_delegated_conda.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""ASV plug-in providing an alternative :class:`asv.plugins.conda.Conda`
6-
subclass that manages the Conda environment via custom user scripts.
5+
"""ASV plug-in providing an alternative :class:`asv.plugins.conda.Conda` subclass.
6+
7+
Manages the Conda environment via custom user scripts.
78
89
"""
910

@@ -42,7 +43,9 @@ def __init__(
4243
requirements: dict,
4344
tagged_env_vars: dict,
4445
) -> None:
45-
"""Parameters
46+
"""__init__.
47+
48+
Parameters
4649
----------
4750
conf : Config instance
4851

Diff for: benchmarks/benchmarks/__init__.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def disable_repeat_between_setup(benchmark_object):
13-
"""Decorator for benchmarks where object persistence would be inappropriate.
13+
"""Benchmarks where object persistence would be inappropriate (decorator).
1414
1515
E.g:
1616
* Benchmarking data realisation
@@ -36,7 +36,9 @@ def disable_repeat_between_setup(benchmark_object):
3636

3737

3838
class TrackAddedMemoryAllocation:
39-
"""Context manager which measures by how much process resident memory grew,
39+
"""Measures by how much process resident memory grew, during execution.
40+
41+
Context manager which measures by how much process resident memory grew,
4042
during execution of its enclosed code block.
4143
4244
Obviously limited as to what it actually measures : Relies on the current
@@ -84,7 +86,7 @@ def addedmem_mb(self):
8486

8587
@staticmethod
8688
def decorator(decorated_func):
87-
"""Decorates this benchmark to track growth in resident memory during execution.
89+
"""Benchmark to track growth in resident memory during execution.
8890
8991
Intended for use on ASV ``track_`` benchmarks. Applies the
9092
:class:`TrackAddedMemoryAllocation` context manager to the benchmark
@@ -105,7 +107,9 @@ def _wrapper(*args, **kwargs):
105107

106108

107109
def on_demand_benchmark(benchmark_object):
108-
"""Decorator. Disables these benchmark(s) unless ON_DEMAND_BENCHARKS env var is set.
110+
"""Disables these benchmark(s) unless ON_DEMAND_BENCHARKS env var is set.
111+
112+
This is a decorator.
109113
110114
For benchmarks that, for whatever reason, should not be run by default.
111115
E.g:

Diff for: benchmarks/benchmarks/aux_factory.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""AuxFactory benchmark tests.
6-
7-
"""
5+
"""AuxFactory benchmark tests."""
86

97
import numpy as np
108

@@ -18,7 +16,9 @@ class FactoryCommon:
1816
# * make class an ABC
1917
# * remove NotImplementedError
2018
# * combine setup_common into setup
21-
"""A base class running a generalised suite of benchmarks for any factory.
19+
"""Run a generalised suite of benchmarks for any factory.
20+
21+
A base class running a generalised suite of benchmarks for any factory.
2222
Factory to be specified in a subclass.
2323
2424
ASV will run the benchmarks within this class for any subclasses.

Diff for: benchmarks/benchmarks/coords.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""Coord benchmark tests.
6-
7-
"""
5+
"""Coord benchmark tests."""
86

97
import numpy as np
108

@@ -25,7 +23,9 @@ class CoordCommon:
2523
# * make class an ABC
2624
# * remove NotImplementedError
2725
# * combine setup_common into setup
28-
"""A base class running a generalised suite of benchmarks for any coord.
26+
"""Run a generalised suite of benchmarks for any coord.
27+
28+
A base class running a generalised suite of benchmarks for any coord.
2929
Coord to be specified in a subclass.
3030
3131
ASV will run the benchmarks within this class for any subclasses.

Diff for: benchmarks/benchmarks/cperf/equality.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""Equality benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project.
6-
"""
5+
"""Equality benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project."""
76
from .. import on_demand_benchmark
87
from . import SingleDiagnosticMixin
98

109

1110
class EqualityMixin(SingleDiagnosticMixin):
12-
r"""Uses :class:`SingleDiagnosticMixin` as the realistic case will be comparing
11+
r"""Use :class:`SingleDiagnosticMixin` as the realistic case.
12+
13+
Uses :class:`SingleDiagnosticMixin` as the realistic case will be comparing
1314
:class:`~iris.cube.Cube`\\ s that have been loaded from file.
15+
1416
"""
1517

1618
# Cut down the parent parameters.
@@ -24,9 +26,7 @@ def setup(self, file_type, three_d=False, three_times=False):
2426

2527
@on_demand_benchmark
2628
class CubeEquality(EqualityMixin):
27-
r"""Benchmark time and memory costs of comparing LFRic and UM
28-
:class:`~iris.cube.Cube`\\ s.
29-
"""
29+
r"""Benchmark time & memory costs of comparing LFRic & UM :class:`~iris.cube.Cube`\\ s."""
3030

3131
def _comparison(self):
3232
_ = self.cube == self.other_cube

Diff for: benchmarks/benchmarks/cperf/load.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""File loading benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project.
6-
"""
5+
"""File loading benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project."""
76
from .. import on_demand_benchmark
87
from . import SingleDiagnosticMixin
98

109

1110
@on_demand_benchmark
1211
class SingleDiagnosticLoad(SingleDiagnosticMixin):
1312
def time_load(self, _, __, ___):
14-
"""The 'real world comparison'
13+
"""Perform a 'real world comparison'.
14+
1515
* UM coords are always realised (DimCoords).
1616
* LFRic coords are not realised by default (MeshCoords).
1717
@@ -26,7 +26,7 @@ def time_load(self, _, __, ___):
2626
assert coord.has_lazy_bounds() == expecting_lazy_coords
2727

2828
def time_load_w_realised_coords(self, _, __, ___):
29-
"""A valuable extra comparison where both UM and LFRic coords are realised."""
29+
"""Valuable extra comparison where both UM and LFRic coords are realised."""
3030
cube = self.load()
3131
for coord_name in "longitude", "latitude":
3232
coord = cube.coord(coord_name)

Diff for: benchmarks/benchmarks/cperf/save.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""File saving benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project.
6-
"""
5+
"""File saving benchmarks for the CPerf scheme of the UK Met Office's NG-VAT project."""
76

87
from iris import save
98

@@ -15,6 +14,7 @@
1514
@on_demand_benchmark
1615
class NetcdfSave:
1716
"""Benchmark time and memory costs of saving ~large-ish data cubes to netcdf.
17+
1818
Parametrised by file type.
1919
2020
"""

Diff for: benchmarks/benchmarks/cube.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""Cube benchmark tests.
6-
7-
"""
5+
"""Cube benchmark tests."""
86

97
import numpy as np
108

@@ -30,7 +28,9 @@ class ComponentCommon:
3028
# * make class an ABC
3129
# * remove NotImplementedError
3230
# * combine setup_common into setup
33-
"""A base class running a generalised suite of benchmarks for cubes that
31+
"""Run a generalised suite of benchmarks for cubes.
32+
33+
A base class running a generalised suite of benchmarks for cubes that
3434
include a specified component (e.g. Coord, CellMeasure etc.). Component to
3535
be specified in a subclass.
3636
@@ -45,7 +45,7 @@ def setup(self):
4545
raise NotImplementedError
4646

4747
def create(self):
48-
"""Generic cube creation.
48+
"""Create a cube (generic).
4949
5050
cube_kwargs allow dynamic inclusion of different components;
5151
specified in subclasses.

Diff for: benchmarks/benchmarks/experimental/__init__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""Benchmark tests for the experimental module.
6-
7-
"""
5+
"""Benchmark tests for the experimental module."""

Diff for: benchmarks/benchmarks/experimental/ugrid/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#
33
# This file is part of Iris and is released under the BSD license.
44
# See LICENSE in the root of the repository for full licensing details.
5-
"""Benchmark tests for the experimental.ugrid module.
6-
7-
"""
5+
"""Benchmark tests for the experimental.ugrid module."""
86

97
from copy import deepcopy
108

@@ -17,7 +15,9 @@
1715

1816

1917
class UGridCommon:
20-
"""A base class running a generalised suite of benchmarks for any ugrid object.
18+
"""Run a generalised suite of benchmarks for any ugrid object.
19+
20+
A base class running a generalised suite of benchmarks for any ugrid object.
2121
Object to be specified in a subclass.
2222
2323
ASV will run the benchmarks within this class for any subclasses.

0 commit comments

Comments
 (0)