diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..14e9a95d30 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,9 @@ +# benchmark_this automatically triggers the benchmark workflow when added by +# a user. No triggering happens when GitHub Actions adds the label (this +# avoids security vulnerabilities), so alternative triggers for the below +# files are therefore included in workflows/benchmarks_run.yml. Automatic +# labelling is still included here to make it easier to search pull requests, +# and to reinforce the culture of using this label. +benchmark_this: +- changed-files: + - any-glob-to-any-file: ['requirements/locks/*.lock', "setup.py"] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 597c413457..34bc59182c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,3 +7,8 @@ --- [Consult Iris pull request check list]( https://scitools-iris.readthedocs.io/en/latest/developers_guide/contributing_pull_request_checklist.html) + +--- +Add any of the below labels to trigger actions on this PR: + +- https://github.com/SciTools/iris/labels/benchmark_this diff --git a/.github/workflows/benchmarks_run.yml b/.github/workflows/benchmarks_run.yml index 0d9d7f0756..626db393db 100644 --- a/.github/workflows/benchmarks_run.yml +++ b/.github/workflows/benchmarks_run.yml @@ -16,15 +16,46 @@ on: required: false type: string pull_request: - types: [labeled] + # Add the `labeled` type to the default list. + types: [labeled, opened, synchronize, reopened] jobs: + pre-checks: + runs-on: ubuntu-latest + if: github.repository == 'SciTools/iris' + outputs: + overnight: ${{ steps.overnight.outputs.check }} + branch: ${{ steps.branch.outputs.check }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - id: files-changed + uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb + with: + # SEE ALSO .github/labeler.yml . + paths: requirements/locks/*.lock setup.py + - id: overnight + if: github.event_name != 'pull_request' + run: echo "check=true" >> "$GITHUB_OUTPUT" + - id: branch + if: > + github.event_name == 'pull_request' + && + ( + steps.files-changed.outputs.changed == 'true' + || + github.event.label.name == 'benchmark_this' + ) + run: echo "check=true" >> "$GITHUB_OUTPUT" + + benchmark: - if: > - github.repository == 'SciTools/iris' && - (github.event_name != 'pull_request' || - github.event.label.name == 'benchmark_this') runs-on: ubuntu-latest + needs: pre-checks + if: > + needs.pre-checks.outputs.overnight == 'true' || + needs.pre-checks.outputs.branch == 'true' env: IRIS_TEST_DATA_LOC_PATH: benchmarks @@ -76,7 +107,7 @@ jobs: echo "OVERRIDE_TEST_DATA_REPOSITORY=${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_PATH}/test_data" >> $GITHUB_ENV - name: Benchmark this pull request - if: ${{ github.event.label.name == 'benchmark_this' }} + if: needs.pre-checks.outputs.branch == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.number }} @@ -85,7 +116,7 @@ jobs: - name: Run overnight benchmarks id: overnight - if: ${{ github.event_name != 'pull_request' }} + if: needs.pre-checks.outputs.overnight == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/ci-manifest.yml b/.github/workflows/ci-manifest.yml index 0868811ac6..8cd2931730 100644 --- a/.github/workflows/ci-manifest.yml +++ b/.github/workflows/ci-manifest.yml @@ -23,4 +23,4 @@ concurrency: jobs: manifest: name: "check-manifest" - uses: scitools/workflows/.github/workflows/ci-manifest.yml@2024.02.0 + uses: scitools/workflows/.github/workflows/ci-manifest.yml@2024.03.3 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..7914ec2531 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,15 @@ +# Reference +# - https://github.com/actions/labeler + +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 \ No newline at end of file diff --git a/.github/workflows/refresh-lockfiles.yml b/.github/workflows/refresh-lockfiles.yml index 082aed2cb1..495c941fbf 100644 --- a/.github/workflows/refresh-lockfiles.yml +++ b/.github/workflows/refresh-lockfiles.yml @@ -14,5 +14,5 @@ on: jobs: refresh_lockfiles: - uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2024.02.0 + uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2024.03.3 secrets: inherit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac83b6178b..7f8544f5af 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.2.1" + rev: "v0.3.4" hooks: - id: ruff types: [file, python] @@ -61,3 +61,10 @@ repos: hooks: - id: sort-all types: [file, python] + +- repo: https://github.com/numpy/numpydoc + rev: v1.7.0rc0 + hooks: + - id: numpydoc-validation + exclude: "^lib/iris/tests/|docs/gallery_code/" + types: [file, python] diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 4184629448..51983ec04d 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -6,6 +6,10 @@ "environment_type": "conda-delegated", "show_commit_url": "https://github.com/scitools/iris/commit/", "branches": ["upstream/main"], + "build_command": [ + "python setup.py build", + "python -mpip wheel --no-deps -w {build_cache_dir} {build_dir}" + ], "benchmark_dir": "./benchmarks", "env_dir": ".asv/env", diff --git a/benchmarks/asv_delegated_conda.py b/benchmarks/asv_delegated_conda.py index c8070b063a..7d8b6e109c 100644 --- a/benchmarks/asv_delegated_conda.py +++ b/benchmarks/asv_delegated_conda.py @@ -47,17 +47,15 @@ def __init__( Parameters ---------- - conf : Config instance - + conf : Config + Config instance. python : str Version of Python. Must be of the form "MAJOR.MINOR". - requirements : dict Dictionary mapping a PyPI package name to a version identifier string. - tagged_env_vars : dict - Environment variables, tagged for build vs. non-build + Environment variables, tagged for build vs. non-build. """ ignored = ["`python`"] diff --git a/benchmarks/benchmarks/__init__.py b/benchmarks/benchmarks/__init__.py index 87a77fa5a4..14b28b3070 100644 --- a/benchmarks/benchmarks/__init__.py +++ b/benchmarks/benchmarks/__init__.py @@ -3,6 +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. """Common code for benchmarks.""" + from os import environ import resource @@ -10,11 +11,12 @@ def disable_repeat_between_setup(benchmark_object): - """Benchmarks where object persistence would be inappropriate (decorator). + """Benchmark where object persistence would be inappropriate (decorator). E.g: - * Benchmarking data realisation - * Benchmarking Cube coord addition + + * Benchmarking data realisation + * Benchmarking Cube coord addition Can be applied to benchmark classes/methods/functions. @@ -107,14 +109,15 @@ def _wrapper(*args, **kwargs): def on_demand_benchmark(benchmark_object): - """Disables these benchmark(s) unless ON_DEMAND_BENCHARKS env var is set. + """Disable these benchmark(s) unless ON_DEMAND_BENCHARKS env var is set. This is a decorator. For benchmarks that, for whatever reason, should not be run by default. E.g: - * Require a local file - * Used for scalability analysis instead of commit monitoring. + + * Require a local file + * Used for scalability analysis instead of commit monitoring. Can be applied to benchmark classes/methods/functions. diff --git a/benchmarks/benchmarks/cperf/__init__.py b/benchmarks/benchmarks/cperf/__init__.py index eaff9cf5e0..df28a66265 100644 --- a/benchmarks/benchmarks/cperf/__init__.py +++ b/benchmarks/benchmarks/cperf/__init__.py @@ -9,6 +9,7 @@ Files available from the UK Met Office: moo ls moose:/adhoc/projects/avd/asv/data_for_nightly_tests/ """ + import numpy as np from iris import load_cube diff --git a/benchmarks/benchmarks/cperf/equality.py b/benchmarks/benchmarks/cperf/equality.py index 16f8c10aab..ffe61ef938 100644 --- a/benchmarks/benchmarks/cperf/equality.py +++ b/benchmarks/benchmarks/cperf/equality.py @@ -3,6 +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. """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 cafc4631c0..07c2de9e79 100644 --- a/benchmarks/benchmarks/cperf/load.py +++ b/benchmarks/benchmarks/cperf/load.py @@ -3,6 +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. """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/experimental/ugrid/regions_combine.py b/benchmarks/benchmarks/experimental/ugrid/regions_combine.py index 10711d0349..6657e70056 100644 --- a/benchmarks/benchmarks/experimental/ugrid/regions_combine.py +++ b/benchmarks/benchmarks/experimental/ugrid/regions_combine.py @@ -16,6 +16,7 @@ run-time that scale with data size. """ + import os import dask.array as da @@ -92,7 +93,7 @@ def setup_cache(self): ) def setup(self, n_cubesphere, imaginary_data=True, create_result_cube=True): - """Combine-tests "standard" setup operation. + """Combine tests "standard" setup operation. Load the source cubes (full-mesh + region) from disk. These are specific to the cubesize parameter. diff --git a/benchmarks/benchmarks/generate_data/__init__.py b/benchmarks/benchmarks/generate_data/__init__.py index 4d80429889..bb53e26b2f 100644 --- a/benchmarks/benchmarks/generate_data/__init__.py +++ b/benchmarks/benchmarks/generate_data/__init__.py @@ -14,6 +14,7 @@ benchmark sequence runs over two different Python versions. """ + from contextlib import contextmanager from inspect import getsource from os import environ diff --git a/benchmarks/benchmarks/generate_data/ugrid.py b/benchmarks/benchmarks/generate_data/ugrid.py index 713e5dc7df..de76d63798 100644 --- a/benchmarks/benchmarks/generate_data/ugrid.py +++ b/benchmarks/benchmarks/generate_data/ugrid.py @@ -3,6 +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. """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 566ffca78b..ff5f19e421 100644 --- a/benchmarks/benchmarks/import_iris.py +++ b/benchmarks/benchmarks/import_iris.py @@ -3,7 +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. -"""import iris benchmarking.""" +"""Import iris benchmarking.""" from importlib import import_module, reload diff --git a/benchmarks/benchmarks/iterate.py b/benchmarks/benchmarks/iterate.py index 9353cf42ee..3716602be1 100644 --- a/benchmarks/benchmarks/iterate.py +++ b/benchmarks/benchmarks/iterate.py @@ -3,6 +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. """Iterate benchmark tests.""" + import numpy as np from iris import coords, cube, iterate diff --git a/benchmarks/benchmarks/load/__init__.py b/benchmarks/benchmarks/load/__init__.py index 8a7aa182d3..c977e924af 100644 --- a/benchmarks/benchmarks/load/__init__.py +++ b/benchmarks/benchmarks/load/__init__.py @@ -112,7 +112,7 @@ class ManyVars: @staticmethod def _create_file(save_path: str) -> None: - """Is run externally - everything must be self-contained.""" + """Run externally - everything must be self-contained.""" import numpy as np from iris import save diff --git a/benchmarks/benchmarks/metadata_manager_factory.py b/benchmarks/benchmarks/metadata_manager_factory.py index 01a2b661b8..cd50a767a1 100644 --- a/benchmarks/benchmarks/metadata_manager_factory.py +++ b/benchmarks/benchmarks/metadata_manager_factory.py @@ -2,7 +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/plot.py b/benchmarks/benchmarks/plot.py index 9b008ec41c..681d8ef9dd 100644 --- a/benchmarks/benchmarks/plot.py +++ b/benchmarks/benchmarks/plot.py @@ -3,6 +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. """Plot benchmark tests.""" + import matplotlib as mpl import numpy as np diff --git a/benchmarks/benchmarks/save.py b/benchmarks/benchmarks/save.py index 0c5f79947d..f2a2611eae 100644 --- a/benchmarks/benchmarks/save.py +++ b/benchmarks/benchmarks/save.py @@ -11,6 +11,7 @@ run-time that scale with data size. """ + from iris import save from iris.experimental.ugrid import save_mesh diff --git a/benchmarks/benchmarks/sperf/__init__.py b/benchmarks/benchmarks/sperf/__init__.py index 0a87dbb25c..e51bef5ca2 100644 --- a/benchmarks/benchmarks/sperf/__init__.py +++ b/benchmarks/benchmarks/sperf/__init__.py @@ -7,6 +7,7 @@ SPerf = assessing performance against a series of increasingly large LFRic datasets. """ + from iris import load_cube # TODO: remove uses of PARSE_UGRID_ON_LOAD once UGRID parsing is core behaviour. diff --git a/benchmarks/benchmarks/sperf/combine_regions.py b/benchmarks/benchmarks/sperf/combine_regions.py index 7d677ed74f..d375f44719 100644 --- a/benchmarks/benchmarks/sperf/combine_regions.py +++ b/benchmarks/benchmarks/sperf/combine_regions.py @@ -3,6 +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. """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 @@ -83,7 +84,7 @@ def setup_cache(self): ) def setup(self, n_cubesphere, imaginary_data=True, create_result_cube=True): - """Combine-tests "standard" setup operation. + """Combine tests "standard" setup operation. Load the source cubes (full-mesh + region) from disk. These are specific to the cubesize parameter. diff --git a/benchmarks/benchmarks/sperf/equality.py b/benchmarks/benchmarks/sperf/equality.py index 339687a22c..3f70c6fd7f 100644 --- a/benchmarks/benchmarks/sperf/equality.py +++ b/benchmarks/benchmarks/sperf/equality.py @@ -3,6 +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. """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 f3c5ef1136..d304a30c82 100644 --- a/benchmarks/benchmarks/sperf/load.py +++ b/benchmarks/benchmarks/sperf/load.py @@ -3,6 +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. """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 3fb8133659..8d9a90f7cf 100644 --- a/benchmarks/benchmarks/sperf/save.py +++ b/benchmarks/benchmarks/sperf/save.py @@ -3,6 +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. """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/bm_runner.py b/benchmarks/bm_runner.py index 10dc5f469a..f2883f079c 100644 --- a/benchmarks/bm_runner.py +++ b/benchmarks/bm_runner.py @@ -66,7 +66,7 @@ def _check_requirements(package: str) -> None: def _prep_data_gen_env() -> None: - """Create/access a separate, unchanging environment for generating test data.""" + """Create or access a separate, unchanging environment for generating test data.""" python_version = "3.11" data_gen_var = "DATA_GEN_PYTHON" if data_gen_var in environ: @@ -171,7 +171,7 @@ def _gh_create_reports(commit_sha: str, results_full: str, results_shifts: str) performance_report = dedent( ( """ - ### Performance Benchmark Report: {commit_sha} + # :stopwatch: Performance Benchmark Report: {commit_sha}
Performance shifts diff --git a/docs/gallery_code/general/plot_custom_aggregation.py b/docs/gallery_code/general/plot_custom_aggregation.py index 540f785ed6..65fadfb473 100644 --- a/docs/gallery_code/general/plot_custom_aggregation.py +++ b/docs/gallery_code/general/plot_custom_aggregation.py @@ -39,14 +39,14 @@ def count_spells(data, threshold, axis, spell_length): Parameters ---------- data : array - raw data to be compared with value threshold. + Raw data to be compared with value threshold. threshold : float - threshold point for 'significant' datapoints. + Threshold point for 'significant' datapoints. axis : int - number of the array dimension mapping the time sequences. - (Can also be negative, e.g. '-1' means last dimension) + Number of the array dimension mapping the time sequences. + (Can also be negative, e.g. '-1' means last dimension). spell_length : int - number of consecutive times at which value > threshold to "count". + Number of consecutive times at which value > threshold to "count". """ if axis < 0: diff --git a/docs/gallery_code/general/plot_rotated_pole_mapping.py b/docs/gallery_code/general/plot_rotated_pole_mapping.py index 60b187ee56..e9e3656184 100644 --- a/docs/gallery_code/general/plot_rotated_pole_mapping.py +++ b/docs/gallery_code/general/plot_rotated_pole_mapping.py @@ -1,6 +1,6 @@ """ Rotated Pole Mapping -===================== +==================== This example uses several visualisation methods to achieve an array of differing images, including: diff --git a/docs/gallery_code/oceanography/plot_load_nemo.py b/docs/gallery_code/oceanography/plot_load_nemo.py index 36ff363a15..aac89fec0e 100644 --- a/docs/gallery_code/oceanography/plot_load_nemo.py +++ b/docs/gallery_code/oceanography/plot_load_nemo.py @@ -45,11 +45,11 @@ def main(): # Include the point's position in the plot's title lat_point = cube.coord("latitude").points[y_point_index, x_point_index] - lat_string = "{:.3f}\u00B0 {}".format( + lat_string = "{:.3f}\u00b0 {}".format( abs(lat_point), "N" if lat_point > 0.0 else "S" ) lon_point = cube.coord("longitude").points[y_point_index, x_point_index] - lon_string = "{:.3f}\u00B0 {}".format( + lon_string = "{:.3f}\u00b0 {}".format( abs(lon_point), "E" if lon_point > 0.0 else "W" ) plt.title("{} at {} {}".format(cube.long_name.capitalize(), lat_string, lon_string)) diff --git a/docs/src/common_links.inc b/docs/src/common_links.inc index 73f7a95e10..476796396f 100644 --- a/docs/src/common_links.inc +++ b/docs/src/common_links.inc @@ -8,8 +8,8 @@ .. _cirrus-ci: https://cirrus-ci.com/github/SciTools/iris .. _codespell: https://github.com/codespell-project/codespell .. _conda: https://docs.conda.io/en/latest/ -.. _contributor: https://github.com/SciTools/scitools.org.uk/blob/master/contributors.json -.. _core developers: https://github.com/SciTools/scitools.org.uk/blob/master/contributors.json +.. _contributor: https://github.com/SciTools/iris/graphs/contributors +.. _core developers: https://github.com/orgs/SciTools/teams/iris-devs/members .. _generating ssh keys for GitHub: https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account .. _GitHub Actions: https://docs.github.com/en/actions .. _GitHub Help Documentation: https://docs.github.com/en/github @@ -45,6 +45,7 @@ .. _python-stratify: https://github.com/SciTools/python-stratify .. _iris-esmf-regrid: https://github.com/SciTools-incubator/iris-esmf-regrid .. _netCDF4: https://github.com/Unidata/netcdf4-python +.. _SciTools Contributor's License Agreement (CLA): https://cla-assistant.io/SciTools/ .. comment diff --git a/docs/src/community/iris_xarray.rst b/docs/src/community/iris_xarray.rst index 9d795fcd9e..71585d8b9f 100644 --- a/docs/src/community/iris_xarray.rst +++ b/docs/src/community/iris_xarray.rst @@ -38,9 +38,28 @@ There are multiple ways to convert between Iris and Xarray objects. feasible to save a NetCDF file using one package then load that file using the other package. This will be lossy in places, as both Iris and Xarray are opinionated on how certain NetCDF concepts relate to their data models. -* The Iris development team are exploring an improved 'bridge' between the two - packages. Follow the conversation on GitHub: `iris#4994`_. This project is - expressly intended to be as lossless as possible. +* `ncdata `_ is a package which + the Iris development team have developed to manage netcdf data, which can act as an + improved 'bridge' between Iris and Xarray : + +Ncdata can convert Iris cubes to an Xarray dataset, or vice versa, with minimal +overhead and as lossless as possible. + +For example : + +.. code-block:: python + + from ncdata.iris_xarray import cubes_from_xarray, cubes_to_xarray + cubes = cubes_from_xarray(dataset) + xrds = cubes_to_xarray(cubes) + +Ncdata avoids the feature limitations previously mentioned regarding Xarray's +:meth:`~xarray.DataArray.to_iris` and :meth:`~xarray.DataArray.from_iris`, +because it doesn't replicate any logic of either Xarray or Iris. +Instead, it uses the netcdf file interfaces of both to exchange data +"as if" via a netcdf file. So, these conversions *behave* just like exchanging data +via a file, but are far more efficient because they can transfer data without copying +arrays or fetching lazy data. Regridding ---------- @@ -98,7 +117,7 @@ Iris :class:`~iris.cube.Cube`\ s, although an ambition for the future. NetCDF File Control ------------------- -(More info: :term:`NetCDF Format`) +(More info: :ref:`netcdf_io`) Unlike Iris, Xarray generally provides full control of major file structures, i.e. dimensions + variables, including their order in the file. It mostly @@ -107,15 +126,41 @@ However, attribute handling is not so complete: like Iris, it interprets and modifies some recognised aspects, and can add some extra attributes not in the input. -.. todo: - More detail on dates and fill values (@pp-mo suggestion). - -Handling of dates and fill values have some special problems here. - -Ultimately, nearly everything wanted in a particular desired result file can -be achieved in Xarray, via provided override mechanisms (`loading keywords`_ +Whereas Iris is primarily designed to handle netCDF data encoded according to +`CF Conventions `_ , this is not so important to Xarray, +which therefore may make it harder to correctly manage this type of data. +While Xarray CF support is not complete, it may improve, and obviously +:ref:`cfxarray` may be relevant here. +There is also relevant documentation +`at this page `_. + +In some particular aspects, CF data is not loaded well (or at all), and in many cases +output is not fully CF compliant (as-per `the cf checker `_). + +* xarray has it's own interpretation of coordinates, which is different from the CF-based + approach in Iris, and means that the use of the "coordinates" attribute in output is + often not CF compliant. +* dates are converted to datetime-like objects internally. There are special features + providing `support for non-standard calendars `_, + however date units may not always be saved correctly. +* CF-style coordinate bounds variables are not fully understood. The CF approach + where bounds variables do not usually define their units or standard_names can cause + problems. Certain files containing bounds variables with more than 2 bounds (e.g. + unstructured data) may not load at all. +* missing points are always represented as NaNs, as-per Pandas usage. + (See :ref:`xarray_missing_data` ). + This means that fill values are not preserved, and that masked integer data is + converted to floats. + The netCDF default fill-values are not supported, so that variables with no + "_FillValue" attribute will have missing points equal to the fill-value + in place of NaNs. By default, output variables generally have ``_FillValue = NaN``. + +Ultimately, however, nearly everything wanted in a particular desired result file +**can** be achieved in Xarray, via provided override mechanisms (`loading keywords`_ and the '`encoding`_' dictionaries). +.. _xarray_missing_data: + Missing Data ------------ Xarray uses :data:`numpy.nan` to represent missing values and this will support diff --git a/docs/src/conf.py b/docs/src/conf.py index af364bb9c0..2fb62b256e 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -17,7 +17,7 @@ # serve to show the default. # ---------------------------------------------------------------------------- -"""sphinx config.""" +"""Config for sphinx.""" import datetime from importlib.metadata import version as get_version diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index 799e3fc1c0..542178c2ff 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -92,12 +92,11 @@ Iris target branch by a core developer. .. _testing_cla: -SciTools CLA Checker -******************** +`CLA Assistant`_ +**************** -A bot which checks that the GitHub author of the pull-request has signed the -**SciTools Contributor's License Agreement (CLA)**. For more information on -this please see https://scitools.org.uk/organisation.html#governance. +A bot which checks that the GitHub authors of the pull-request have signed the +|SciTools Contributor's License Agreement (CLA)|_. .. _pre_commit_ci: @@ -147,4 +146,6 @@ For more information on how to use `ruff`_ please see the `ruff documentation`_. .. _.pre-commit-config.yaml: https://github.com/SciTools/iris/blob/main/.pre-commit-config.yaml .. _pre-commit.ci dashboard: https://results.pre-commit.ci/repo/github/5312648 +.. _CLA Assistant: https://github.com/cla-assistant/cla-assistant +.. |SciTools Contributor's License Agreement (CLA)| replace:: **SciTools Contributor's License Agreement (CLA)** .. _ruff documentation: https://docs.astral.sh/ruff/tutorial/ diff --git a/docs/src/developers_guide/contributing_documentation_easy.rst b/docs/src/developers_guide/contributing_documentation_easy.rst index 51554f9e19..a0513fe560 100755 --- a/docs/src/developers_guide/contributing_documentation_easy.rst +++ b/docs/src/developers_guide/contributing_documentation_easy.rst @@ -1,4 +1,6 @@ +.. include:: ../common_links.inc + .. _contributing.documentation_easy: Contributing to the Documentation (the easy way) @@ -15,11 +17,10 @@ the improvement yourself)! First Time Only Steps ^^^^^^^^^^^^^^^^^^^^^ - + 1. Create a `GitHub `_ account. -2. Complete the Scitools Contributor License Agreement (`link to Google Form - `_). +2. Complete the `SciTools Contributor's License Agreement (CLA)`_. This is a one-off requirement for anyone who wishes to contribute to a Scitools repository - including the documentation. diff --git a/docs/src/developers_guide/contributing_getting_involved.rst b/docs/src/developers_guide/contributing_getting_involved.rst index 6ade098b6b..9da6cd13eb 100644 --- a/docs/src/developers_guide/contributing_getting_involved.rst +++ b/docs/src/developers_guide/contributing_getting_involved.rst @@ -22,9 +22,12 @@ Alternatively, **join the conversation** in Iris `GitHub Discussions`_, when you would like the opinions of the Iris community. A `pull request`_ may also be created by anyone who has become a -**contributor** to Iris_. Permissions to merge pull requests to the -``main`` branch are only given to **core developers** of Iris_, this is -to ensure a measure of control. +|contributor|_ to Iris_. Permissions to merge pull requests to the +``main`` branch are only given to |core developers|_ of Iris_, this is +to ensure a measure of control. All authors on a pull request will +automatically be asked to sign the +`SciTools Contributor's License Agreement (CLA)`_, if they have not already +done so. To get started we suggest reading recent `issues`_, `GitHub Discussions`_ and `pull requests`_ for Iris. @@ -32,12 +35,9 @@ To get started we suggest reading recent `issues`_, `GitHub Discussions`_ and If you are new to using GitHub we recommend reading the `GitHub getting started`_ -.. note:: For more information on becoming a contributor_ including a link to - the Contributors Licence Agreement (CLA) see the - `Governance `_ - section of the `SciTools`_ ogranization web site. - .. _GitHub getting started: https://docs.github.com/en/github/getting-started-with-github +.. |contributor| replace:: **contributor** +.. |core developers| replace:: **core developers** .. toctree:: diff --git a/docs/src/developers_guide/documenting/docstrings_attribute.py b/docs/src/developers_guide/documenting/docstrings_attribute.py index 9b85ecb201..1714373a62 100644 --- a/docs/src/developers_guide/documenting/docstrings_attribute.py +++ b/docs/src/developers_guide/documenting/docstrings_attribute.py @@ -1,4 +1,4 @@ -"""docstring attribute example.""" +"""Docstring attribute example.""" class ExampleClass: diff --git a/docs/src/developers_guide/documenting/docstrings_sample_routine.py b/docs/src/developers_guide/documenting/docstrings_sample_routine.py index 4c26bc3569..7feec6dbd0 100644 --- a/docs/src/developers_guide/documenting/docstrings_sample_routine.py +++ b/docs/src/developers_guide/documenting/docstrings_sample_routine.py @@ -1,4 +1,4 @@ -"""docstring routine example.""" +"""Docstring routine example.""" def sample_routine(arg1, arg2, kwarg1="foo", kwarg2=None): @@ -12,16 +12,16 @@ def sample_routine(arg1, arg2, kwarg1="foo", kwarg2=None): First argument description. arg2 : numpy.ndarray Second argument description. - kwarg1: str, optional + kwarg1 : str, optional The first keyword argument. This argument description can be multi-lined. - kwarg2 : bool, optional + **kwarg2 : bool, optional The second keyword argument. Returns ------- numpy.ndarray - numpy.ndarray of arg1 * arg2 + A numpy.ndarray of arg1 * arg2. """ pass diff --git a/docs/src/further_topics/filtering_warnings.rst b/docs/src/further_topics/filtering_warnings.rst index a3a7aed7a9..5175475922 100644 --- a/docs/src/further_topics/filtering_warnings.rst +++ b/docs/src/further_topics/filtering_warnings.rst @@ -16,7 +16,7 @@ you to ``ignore`` Warnings which you do not find helpful. import iris import iris.coord_systems - import iris.exceptions + import iris.warnings # Hack to ensure doctests actually see Warnings that are raised, and that # they have a relative path (so a test pass is not machine-dependent). @@ -47,9 +47,9 @@ Warnings: >>> my_operation() ... - iris/coord_systems.py:442: 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:768: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. + iris/coord_systems.py:444: 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.warnings.IrisUserWarning) + 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,8 +110,8 @@ You can target specific Warning messages, e.g. ... warnings.filterwarnings("ignore", message="Discarding false_easting") ... my_operation() ... - iris/coord_systems.py:442: 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:444: 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.warnings.IrisUserWarning) :: @@ -125,16 +125,16 @@ Or you can target Warnings raised by specific lines of specific modules, e.g. .. doctest:: filtering_warnings >>> with warnings.catch_warnings(): - ... warnings.filterwarnings("ignore", module="iris.coord_systems", lineno=442) + ... warnings.filterwarnings("ignore", module="iris.coord_systems", lineno=444) ... my_operation() ... - iris/coord_systems.py:768: 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( :: - python -W ignore:::iris.coord_systems:442 - export PYTHONWARNINGS=ignore:::iris.coord_systems:442 + python -W ignore:::iris.coord_systems:444 + export PYTHONWARNINGS=ignore:::iris.coord_systems:444 Warnings from a Common Source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,7 +176,7 @@ Warnings of a Common Type code you are calling.** The below example will ``ignore`` any -:class:`~iris.exceptions.IrisDefaultingWarning` that gets raised by *any* +:class:`~iris.warnings.IrisDefaultingWarning` that gets raised by *any* module during execution: .. doctest:: filtering_warnings @@ -184,25 +184,25 @@ module during execution: >>> with warnings.catch_warnings(): ... warnings.filterwarnings( ... "ignore", - ... category=iris.exceptions.IrisDefaultingWarning + ... category=iris.warnings.IrisDefaultingWarning ... ) ... my_operation() ... - iris/coord_systems.py:442: 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:444: 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.warnings.IrisUserWarning) ---- -Using :class:`~iris.exceptions.IrisUserWarning` in the filter will ``ignore`` -both Warnings, since :class:`~iris.exceptions.IrisDefaultingWarning` subclasses -:class:`~iris.exceptions.IrisUserWarning` : +Using :class:`~iris.warnings.IrisUserWarning` in the filter will ``ignore`` +both Warnings, since :class:`~iris.warnings.IrisDefaultingWarning` subclasses +:class:`~iris.warnings.IrisUserWarning` : .. doctest:: filtering_warnings >>> with warnings.catch_warnings(): ... warnings.filterwarnings( ... "ignore", - ... category=iris.exceptions.IrisUserWarning + ... category=iris.warnings.IrisUserWarning ... ) ... my_operation() @@ -220,10 +220,10 @@ There are several built-in Python warning categories that can be used here (:class:`DeprecationWarning` being a popular example, see :external+python:mod:`warnings` for more). Since Iris has so many different warnings that might be raised, Iris subclasses -:class:`UserWarning` to :class:`~iris.exceptions.IrisUserWarning`, which itself +:class:`UserWarning` to :class:`~iris.warnings.IrisUserWarning`, which itself has **many** specialised subclasses. These subclasses exist to give you more granularity in your warning filtering; you can see the full list by -searching the :mod:`iris.exceptions` page for ``warning`` . +viewing the :mod:`iris.warnings` module. .. attention:: diff --git a/docs/src/further_topics/which_regridder_to_use.rst b/docs/src/further_topics/which_regridder_to_use.rst index 4c1b8864bb..5d7d7fdba1 100644 --- a/docs/src/further_topics/which_regridder_to_use.rst +++ b/docs/src/further_topics/which_regridder_to_use.rst @@ -64,7 +64,7 @@ AreaWeighted | **Lazy | ``True`` | | Regridding** | | +-----------------+--------------------------------------------------------+ -| **Weights | ``False`` | +| **Weights | ``True`` | | Caching** | | +-----------------+--------------------------------------------------------+ | **Notes** | Supports masked data with ``mdtol`` argument. | diff --git a/docs/src/userguide/plotting_examples/cube_contour.py b/docs/src/userguide/plotting_examples/cube_contour.py index 0d8c1e02aa..e338d395ff 100644 --- a/docs/src/userguide/plotting_examples/cube_contour.py +++ b/docs/src/userguide/plotting_examples/cube_contour.py @@ -3,6 +3,7 @@ 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 531dd45d25..b76645b380 100644 --- a/docs/src/userguide/plotting_examples/cube_contourf.py +++ b/docs/src/userguide/plotting_examples/cube_contourf.py @@ -3,6 +3,7 @@ Can use iris.plot.contour() or iris.quickplot.contour(). """ + import matplotlib.pyplot as plt import iris diff --git a/docs/src/userguide/plotting_examples/masking_brazil_plot.py b/docs/src/userguide/plotting_examples/masking_brazil_plot.py index 3dc521d451..d1a75a700f 100644 --- a/docs/src/userguide/plotting_examples/masking_brazil_plot.py +++ b/docs/src/userguide/plotting_examples/masking_brazil_plot.py @@ -1,4 +1,5 @@ """Global cube masked to Brazil and plotted with quickplot.""" + import cartopy.io.shapereader as shpreader import matplotlib.pyplot as plt diff --git a/docs/src/whatsnew/3.7.rst b/docs/src/whatsnew/3.7.rst index 3472374711..f5070b341d 100644 --- a/docs/src/whatsnew/3.7.rst +++ b/docs/src/whatsnew/3.7.rst @@ -36,6 +36,21 @@ This document explains the changes made to Iris for this release any issues or feature requests for improving Iris. Enjoy! +v3.7.1 (04 Mar 2024) +==================== + +.. dropdown:: v3.7.1 Patches + :color: primary + :icon: alert + :animate: fade-in + + The patches in this release of Iris include: + + #. `@stephenworsley`_ fixed a potential memory leak for Iris uses of + :func:`dask.array.map_blocks`; known specifically to be a problem in the + :class:`iris.analysis.AreaWeighted` regridder. (:pull:`5767`) + + 📢 Announcements ================ diff --git a/docs/src/whatsnew/3.8.rst b/docs/src/whatsnew/3.8.rst new file mode 100644 index 0000000000..9fa87a9337 --- /dev/null +++ b/docs/src/whatsnew/3.8.rst @@ -0,0 +1,308 @@ +.. include:: ../common_links.inc + +v3.8 (29 Feb 2024) +****************** + +This document explains the changes made to Iris for this release +(:doc:`View all changes `.) + + +.. dropdown:: v3.8 Release Highlights + :color: primary + :icon: info + :animate: fade-in + :open: + + The highlights for this major/minor release of Iris include: + + * We have significantly improved :class:`~iris.analysis.AreaWeighted` + regridding performance, and added improved regridding documentation (see + :ref:`which_regridder_to_use`). + + * We have improved :class:`~iris.cube.Cube` + :attr:`~iris.cube.Cube.attributes` handling to better preserve local and + global attribute metadata. + + * We have implemented the + :data:`iris.fileformats.netcdf.loader.CHUNK_CONTROL` context manager to + offer greater control to NetCDF chunking (see :ref:`netcdf_io`). + + * We have added functionality to mask cubes using shapefiles via + :func:`iris.util.mask_cube_from_shapefile` (see + :ref:`masking-from-shapefile`). + + * We have added :attr:`~iris.coords.Coord.ignore_axis` to allow for + preventing :func:`~iris.util.guess_coord_axis` acting on desired + coordinates. + + * We have begun adding improvements to Iris' warnings, to prevent warning + duplication. + + And finally, get in touch with us on :issue:`GitHub` if you have + any issues or feature requests for improving Iris. Enjoy! + + +v3.8.1 (04 Mar 2024) +==================== + +.. dropdown:: v3.8.1 Patches + :color: primary + :icon: alert + :animate: fade-in + :open: + + The patches in this release of Iris include: + + #. `@stephenworsley`_ fixed a potential memory leak for Iris uses of + :func:`dask.array.map_blocks`; known specifically to be a problem in the + :class:`iris.analysis.AreaWeighted` regridder. (:pull:`5767`) + + +📢 Announcements +================ + +#. `@lbdreyer`_ relicensed Iris from LGPL-3 to BSD-3. (:pull:`5577`) + +#. `@HGWright`_, `@bjlittle`_ and `@trexfeathers`_ (reviewers) added a + CITATION.cff file to Iris and updated the :ref:`citation documentation ` + , to help users cite Iris in their work. (:pull:`5483`) + + +✨ Features +=========== +#. `@pp-mo`_, `@lbdreyer`_ and `@trexfeathers`_ improved + :class:`~iris.cube.Cube` :attr:`~iris.cube.Cube.attributes` handling to + better preserve the distinction between dataset-level and variable-level + attributes, allowing file-Cube-file round-tripping of NetCDF attributes. See + :class:`~iris.cube.CubeAttrsDict`, NetCDF + :func:`~iris.fileformats.netcdf.saver.save` and :data:`~iris.Future` for more. + (:pull:`5152`, `split attributes project`_) + +#. `@rcomer`_ rewrote :func:`~iris.util.broadcast_to_shape` so it now handles + lazy data. (:pull:`5307`) + +#. `@trexfeathers`_ and `@HGWright`_ (reviewer) sub-categorised all Iris' + :class:`UserWarning`\s for richer filtering. The full index of + sub-categories can be seen here: :mod:`iris.warnings` . (:pull:`5498`, + :pull:`5760`) + +#. `@trexfeathers`_ added the :class:`~iris.coord_systems.ObliqueMercator` + and :class:`~iris.coord_systems.RotatedMercator` coordinate systems, + complete with NetCDF loading and saving. (:pull:`5548`) + +#. `@trexfeathers`_ added the ``use_year_at_season_start`` parameter to + :func:`iris.coord_categorisation.add_season_year`. When + ``use_year_at_season_start==True``: seasons spanning the year boundary (e.g. + Winter - December to February) will be assigned to the preceding year (e.g. + the year of December) instead of the following year (the default behaviour). + (:pull:`5573`) + +#. `@HGWright`_ added :attr:`~iris.coords.Coord.ignore_axis` to allow manual + intervention preventing :func:`~iris.util.guess_coord_axis` from acting on a + coordinate. `@trexfeathers`_ documented this. (:pull:`5551`, :pull:`5744`) + +#. `@pp-mo`_, `@trexfeathers`_ and `@ESadek-MO`_ added more control over + NetCDF chunking with the use of the :data:`iris.fileformats.netcdf.loader.CHUNK_CONTROL` + context manager. (:pull:`5588`) + +#. `@acchamber`_ and `@trexfeathers`_ (reviewer) added + :func:`iris.util.mask_cube_from_shapefile`. This builds on the original work + of `@ckmo`_, `@david-bentley`_, `@jmendesmetoffice`_, `@evyve`_ and + `@pelson`_ for the UK Met Office **ASCEND** library. See + :ref:`masking-from-shapefile` for documentation. (:pull:`5470`) + +#. `@trexfeathers`_ updated to the latest CF Standard Names Table v84 + (19 January 2024). (:pull:`5761`) + + +🐛 Bugs Fixed +============= + +#. `@scottrobinson02`_ fixed the output units when dividing a coordinate by a + cube. (:issue:`5305`, :pull:`5331`) + +#. `@ESadek-MO`_ has updated :mod:`iris.tests.graphics.idiff` to stop duplicated file names + preventing acceptance. (:issue:`5098`, :pull:`5482`) + +#. `@acchamber`_ and `@rcomer`_ modified 2D plots so that time axes and their + ticks have more sensible default labels. (:issue:`5426`, :pull:`5561`) + +#. `@rcomer`_ and `@trexfeathers`_ (reviewer) added handling for realization + coordinates when saving pp files (:issue:`4747`, :pull:`5568`) + +#. `@ESadek-MO`_ has updated + :mod:`iris.fileformats._nc_load_rules.helpers` to lessen warning duplication. + (:issue:`5536`, :pull:`5685`) + +#. `@bjlittle`_ fixed coordinate construction in the NetCDF loading pipeline to + ensure that bounds have the same units as the associated points. + (:issue:`1801`, :pull:`5746`) + + +💣 Incompatible Changes +======================= + +#. `@bouweandela`_ and `@trexfeathers`_ (reviewer) updated :class:`~iris.cube.Cube` + comparison so equality is now possible between cubes with data containing a + :obj:`numpy.nan`. e.g. ``Cube([np.nan, 1.0]) == Cube([np.nan, 1.0])`` will now + evaluate to :obj:`True`, while previously this would have been :obj:`False`. (:pull:`5713`) + + +🚀 Performance Enhancements +=========================== + +#. `@stephenworsley`_ improved the speed of :class:`~iris.analysis.AreaWeighted` + regridding. (:pull:`5543`) + +#. `@bouweandela`_ made :func:`iris.util.array_equal` faster when comparing + lazy data from file. This will also speed up coordinate comparison. + (:pull:`5610`) + +#. `@bouweandela`_ changed :func:`iris.coords.Coord.cell` so it does not realize + all coordinate data and only loads a single cell instead. (:pull:`5693`) + +#. `@rcomer`_ and `@trexfeathers`_ (reviewer) modified + :func:`~iris.analysis.stats.pearsonr` so it preserves lazy data in all cases + and also runs a little faster. (:pull:`5638`) + +#. `@bouweandela`_ made comparing coordinates and arrays to themselves faster. (:pull:`5691`) + +#. `@bouweandela`_ and `@trexfeathers`_ (reviewer) made comparing cubes to + themselves faster. (:pull:`5713`) + + +🔥 Deprecations +=============== + +#. N/A + + +🔗 Dependencies +=============== + +#. `@bjlittle`_ enforced the minimum pin of ``numpy>1.21`` in accordance with the `NEP29 Drop Schedule`_. + (:pull:`5525`) + +#. `@bjlittle`_ enforced the minimum pin of ``numpy>1.22`` in accordance with the `NEP29 Drop Schedule`_. + (:pull:`5668`) + +#. `@bjlittle`_ updated ``ubuntu`` and ``mambaforge`` to the latest versions for ``readthedocs`` + (:pull:`5702`) + + +📚 Documentation +================ + +#. `@trexfeathers`_ documented the intended use of warnings filtering with + Iris. See :ref:`filtering-warnings`. (:pull:`5509`) + +#. `@rcomer`_ updated the + :ref:`sphx_glr_generated_gallery_meteorology_plot_COP_maps.py` to show how + a colourbar may steal space from multiple axes. (:pull:`5537`) + +#. `@tkknight`_ improved the top navgation bar alignment and amount of + links shown. Also improved how the warning banner is implemented. + (:pull:`5505` and :pull:`5508`) + +#. `@tkknight`_ removed broken git links. (:pull:`5569`) + +#. `@ESadek-MO`_ added a phrasebook for synonymous terms used in similar + packages. (:pull:`5564`) + +#. `@ESadek-MO`_ and `@trexfeathers`_ created a technical paper for NetCDF + saving and loading, :ref:`netcdf_io` with a section on chunking, and placeholders + for further topics. (:pull:`5588`) + +#. `@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`) + +#. `@trexfeathers`_ improved the documentation of acceptable + :class:`~iris.cube.Cube` standard names in + :func:`iris.analysis.calculus.curl`. (:pull:`5680`) + +#. `@tkknight`_ added ruff documentation in the :ref:`developer_testing_ci` of the + :ref:`developers_guide`. (:pull:`5701`) + +#. `@tkknight`_ configured the API documentation to show 2 levels + for the ToC (Table of Contents) for each page. (:pull:`5714`) + + +💼 Internal +=========== + +#. `@trexfeathers`_ and `@ESadek-MO`_ (reviewer) performed a suite of fixes and + improvements for benchmarking, primarily to get + :ref:`on demand pull request benchmarking ` + working properly. (Main pull request: :pull:`5437`, more detail: + :pull:`5430`, :pull:`5431`, :pull:`5432`, :pull:`5434`, :pull:`5436`) + +#. `@trexfeathers`_ set a number of memory benchmarks to be on-demand, as they + were vulnerable to false positives in CI runs. (:pull:`5481`) + +#. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce + number of warnings raised during tests. + (:pull:`5493`, :pull:`5511`) + +#. `@trexfeathers`_ replaced all uses of the ``logging.WARNING`` level, in + favour of using Python warnings, following team agreement. (:pull:`5488`) + +#. `@trexfeathers`_ adapted benchmarking to work with ASV ``>=v0.6`` by no + longer using the ``--strict`` argument. (:pull:`5496`) + +#. `@fazledyn-or`_ replaced ``NotImplementedError`` with ``NotImplemented`` as + a proper method call. (:pull:`5544`) + +#. `@bjlittle`_ corrected various comment spelling mistakes detected by + `codespell`_. (:pull:`5546`) + +#. `@rcomer`_ reduced the size of the conda environment used for testing. + (:pull:`5606`) + +#. `@trexfeathers`_ and `@pp-mo`_ improved how the conda-forge feedstock + release candidate branch is managed, via: + :doc:`../developers_guide/release_do_nothing`. + (:pull:`5515`) + +#. `@bjlittle`_ adopted and configured the `ruff`_ linter. (:pull:`5623`) + +#. `@bjlittle`_ configured the ``line-length = 88`` for `black`_, `isort`_ + and `ruff`_. (:pull:`5632`) + +#. `@bjlittle`_ replaced `isort`_ with `ruff`_. (:pull:`5633`) + +#. `@bjlittle`_ replaced `black`_ with `ruff`_. (:pull:`5634`) + +#. `@tkknight`_ and `@bjlittle`_ (reviewer) updated codebase to be compliant with + almost all of the rules for `ruff pydocstyle`_. + (https://github.com/SciTools/iris/issues/5625#issuecomment-1859159734) + +#. `@tkknight`_ and `@bjlittle`_ (reviewer) updated codebase to ensure docstrings + that are not covered by the ruff checks, are consistent with numpydocstyle. + (:issue:`4721`) + +.. comment + Whatsnew author names (@github name) in alphabetical order. Note that, + core dev names are automatically included by the common_links.inc: + +.. _@scottrobinson02: https://github.com/scottrobinson02 +.. _@acchamber: https://github.com/acchamber +.. _@fazledyn-or: https://github.com/fazledyn-or +.. _@ckmo: https://github.com/ckmo +.. _@david-bentley: https://github.com/david-bentley +.. _@jmendesmetoffice: https://github.com/jmendesmetoffice +.. _@evyve: https://github.com/evyve + + +.. comment + Whatsnew resources in alphabetical order: + +.. _NEP29 Drop Schedule: https://numpy.org/neps/nep-0029-deprecation_policy.html#drop-schedule +.. _codespell: https://github.com/codespell-project/codespell +.. _split attributes project: https://github.com/orgs/SciTools/projects/5?pane=info +.. _ruff pydocstyle: https://docs.astral.sh/ruff/rules/#pydocstyle-d \ No newline at end of file diff --git a/docs/src/whatsnew/index.rst b/docs/src/whatsnew/index.rst index c556f82761..23cd022f52 100644 --- a/docs/src/whatsnew/index.rst +++ b/docs/src/whatsnew/index.rst @@ -12,6 +12,7 @@ What's New in Iris :hidden: latest.rst + 3.8.rst 3.7.rst 3.6.rst 3.5.rst diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index ed42de42f4..f59f623c6a 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -24,110 +24,39 @@ This document explains the changes made to Iris for this release 📢 Announcements ================ -#. `@lbdreyer`_ relicensed Iris from LGPL-3 to BSD-3. (:pull:`5577`) - -#. `@HGWright`_, `@bjlittle`_ and `@trexfeathers`_ (reviewers) added a - CITATION.cff file to Iris and updated the :ref:`citation documentation ` - , to help users cite Iris in their work. (:pull:`5483`) +#. ⏱️ Performance benchmarking has shown that loading + :term:`Fields File (FF) Format` with a large number of fields via + :func:`iris.fileformats.um.structured_um_loading` has become ~30% slower + since `Dask version 2024.2.1`_. ✨ Features =========== -#. `@pp-mo`_, `@lbdreyer`_ and `@trexfeathers`_ improved - :class:`~iris.cube.Cube` :attr:`~iris.cube.Cube.attributes` handling to - better preserve the distinction between dataset-level and variable-level - attributes, allowing file-Cube-file round-tripping of NetCDF attributes. See - :class:`~iris.cube.CubeAttrsDict`, NetCDF - :func:`~iris.fileformats.netcdf.saver.save` and :data:`~iris.Future` for more. - (:pull:`5152`, `split attributes project`_) - -#. `@rcomer`_ rewrote :func:`~iris.util.broadcast_to_shape` so it now handles - lazy data. (:pull:`5307`) - -#. `@trexfeathers`_ and `@HGWright`_ (reviewer) sub-categorised all Iris' - :class:`UserWarning`\s for richer filtering. The full index of - sub-categories can be seen here: :mod:`iris.exceptions` . (:pull:`5498`) - -#. `@trexfeathers`_ added the :class:`~iris.coord_systems.ObliqueMercator` - and :class:`~iris.coord_systems.RotatedMercator` coordinate systems, - complete with NetCDF loading and saving. (:pull:`5548`) - -#. `@trexfeathers`_ added the ``use_year_at_season_start`` parameter to - :func:`iris.coord_categorisation.add_season_year`. When - ``use_year_at_season_start==True``: seasons spanning the year boundary (e.g. - Winter - December to February) will be assigned to the preceding year (e.g. - the year of December) instead of the following year (the default behaviour). - (:pull:`5573`) - -#. `@HGWright`_ added :attr:`~iris.coords.Coord.ignore_axis` to allow manual - intervention preventing :func:`~iris.util.guess_coord_axis` from acting on a - coordinate. `@trexfeathers`_ documented this. (:pull:`5551`, :pull:`5744`) - -#. `@pp-mo`_, `@trexfeathers`_ and `@ESadek-MO`_ added more control over - NetCDF chunking with the use of the :data:`iris.fileformats.netcdf.loader.CHUNK_CONTROL` - context manager. (:pull:`5588`) - -#. `@acchamber`_ and `@trexfeathers`_ (reviewer) added - :func:`iris.util.mask_cube_from_shapefile`. This builds on the original work - of `@ckmo`_, `@david-bentley`_, `@jmendesmetoffice`_, `@evyve`_ and - `@pelson`_ for the UK Met Office **ASCEND** library. See - :ref:`masking-from-shapefile` for documentation. (:pull:`5470`) + +#. N/A 🐛 Bugs Fixed ============= -#. `@scottrobinson02`_ fixed the output units when dividing a coordinate by a - cube. (:issue:`5305`, :pull:`5331`) - -#. `@ESadek-MO`_ has updated :mod:`iris.tests.graphics.idiff` to stop duplicated file names - preventing acceptance. (:issue:`5098`, :pull:`5482`) - -#. `@acchamber`_ and `@rcomer`_ modified 2D plots so that time axes and their - ticks have more sensible default labels. (:issue:`5426`, :pull:`5561`) - -#. `@rcomer`_ and `@trexfeathers`_ (reviewer) added handling for realization - coordinates when saving pp files (:issue:`4747`, :pull:`5568`) - -#. `@ESadek-MO`_ has updated - :mod:`iris.fileformats._nc_load_rules.helpers` to lessen warning duplication. - (:issue:`5536`, :pull:`5685`) - -#. `@bjlittle`_ fixed coordinate construction in the NetCDF loading pipeline to - ensure that bounds have the same units as the associated points. - (:issue:`1801`, :pull:`5746`) +#. N/A 💣 Incompatible Changes ======================= -#. `@bouweandela`_ and `@trexfeathers`_ (reviewer) updated :class:`~iris.cube.Cube` - comparison so equality is now possible between cubes with data containing a - :obj:`numpy.nan`. e.g. ``Cube([np.nan, 1.0]) == Cube([np.nan, 1.0])`` will now - evaluate to :obj:`True`, while previously this would have been :obj:`False`. (:pull:`5713`) +#. N/A 🚀 Performance Enhancements =========================== -#. `@stephenworsley`_ improved the speed of :class:`~iris.analysis.AreaWeighted` - regridding. (:pull:`5543`) - -#. `@bouweandela`_ made :func:`iris.util.array_equal` faster when comparing - lazy data from file. This will also speed up coordinate comparison. - (:pull:`5610`) +#. `@bouweandela`_ made :func:`iris.util.rolling_window` work with lazy arrays. + (:pull:`5775`) -#. `@bouweandela`_ changed :func:`iris.coords.Coord.cell` so it does not realize - all coordinate data and only loads a single cell instead. (:pull:`5693`) - -#. `@rcomer`_ and `@trexfeathers`_ (reviewer) modified - :func:`~iris.analysis.stats.pearsonr` so it preserves lazy data in all cases - and also runs a little faster. (:pull:`5638`) - -#. `@bouweandela`_ made comparing coordinates and arrays to themselves faster. (:pull:`5691`) - -#. `@bouweandela`_ and `@trexfeathers`_ (reviewer) made comparing cubes to - themselves faster. (:pull:`5713`) +#. `@stephenworsley`_ fixed a potential memory leak for Iris uses of + :func:`dask.array.map_blocks`; known specifically to be a problem in the + :class:`iris.analysis.AreaWeighted` regridder. (:pull:`5767`) 🔥 Deprecations @@ -139,129 +68,41 @@ This document explains the changes made to Iris for this release 🔗 Dependencies =============== -#. `@bjlittle`_ enforced the minimum pin of ``numpy>1.21`` in accordance with the `NEP29 Drop Schedule`_. - (:pull:`5525`) - -#. `@bjlittle`_ enforced the minimum pin of ``numpy>1.22`` in accordance with the `NEP29 Drop Schedule`_. - (:pull:`5668`) - -#. `@bjlittle`_ updated ``ubuntu`` and ``mambaforge`` to the latest versions for ``readthedocs`` - (:pull:`5702`) +#. N/A 📚 Documentation ================ -#. `@trexfeathers`_ documented the intended use of warnings filtering with - Iris. See :ref:`filtering-warnings`. (:pull:`5509`) - -#. `@rcomer`_ updated the - :ref:`sphx_glr_generated_gallery_meteorology_plot_COP_maps.py` to show how - a colourbar may steal space from multiple axes. (:pull:`5537`) - -#. `@tkknight`_ improved the top navgation bar alignment and amount of - links shown. Also improved how the warning banner is implemented. - (:pull:`5505` and :pull:`5508`) - -#. `@tkknight`_ removed broken git links. (:pull:`5569`) - -#. `@ESadek-MO`_ added a phrasebook for synonymous terms used in similar - packages. (:pull:`5564`) - -#. `@ESadek-MO`_ and `@trexfeathers`_ created a technical paper for NetCDF - saving and loading, :ref:`netcdf_io` with a section on chunking, and placeholders - for further topics. (:pull:`5588`) - -#. `@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`) - -#. `@trexfeathers`_ improved the documentation of acceptable - :class:`~iris.cube.Cube` standard names in - :func:`iris.analysis.calculus.curl`. (:pull:`5680`) - -#. `@tkknight`_ added ruff documentation in the :ref:`developer_testing_ci` of the - :ref:`developers_guide`. (:pull:`5701`) - -#. `@tkknight`_ configured the API documentation to show 2 levels - for the ToC (Table of Contents) for each page. (:pull:`5714`) +#. N/A 💼 Internal =========== -#. `@trexfeathers`_ and `@ESadek-MO`_ (reviewer) performed a suite of fixes and - improvements for benchmarking, primarily to get - :ref:`on demand pull request benchmarking ` - working properly. (Main pull request: :pull:`5437`, more detail: - :pull:`5430`, :pull:`5431`, :pull:`5432`, :pull:`5434`, :pull:`5436`) - -#. `@trexfeathers`_ set a number of memory benchmarks to be on-demand, as they - were vulnerable to false positives in CI runs. (:pull:`5481`) - -#. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce - number of warnings raised during tests. - (:pull:`5493`, :pull:`5511`) - -#. `@trexfeathers`_ replaced all uses of the ``logging.WARNING`` level, in - favour of using Python warnings, following team agreement. (:pull:`5488`) +#. `@trexfeathers`_ setup automatic benchmarking on pull requests that modify + files likely to affect performance or performance testing. Such pull + requests are also labelled using the `Pull Request Labeler Github action`_ + to increase visibility. (:pull:`5763`, :pull:`5776`) -#. `@trexfeathers`_ adapted benchmarking to work with ASV ``>=v0.6`` by no - longer using the ``--strict`` argument. (:pull:`5496`) +#. `@tkknight`_ updated codebase to comply with a new enforced rule `NPY002`_ for + `ruff`_. (:pull:`5786`) -#. `@fazledyn-or`_ replaced ``NotImplementedError`` with ``NotImplemented`` as - a proper method call. (:pull:`5544`) - -#. `@bjlittle`_ corrected various comment spelling mistakes detected by - `codespell`_. (:pull:`5546`) - -#. `@rcomer`_ reduced the size of the conda environment used for testing. - (:pull:`5606`) - -#. `@trexfeathers`_ and `@pp-mo`_ improved how the conda-forge feedstock - release candidate branch is managed, via: - :doc:`../developers_guide/release_do_nothing`. - (:pull:`5515`) - -#. `@bjlittle`_ adopted and configured the `ruff`_ linter. (:pull:`5623`) - -#. `@bjlittle`_ configured the ``line-length = 88`` for `black`_, `isort`_ - and `ruff`_. (:pull:`5632`) - -#. `@bjlittle`_ replaced `isort`_ with `ruff`_. (:pull:`5633`) - -#. `@bjlittle`_ replaced `black`_ with `ruff`_. (:pull:`5634`) - -#. `@tkknight`_ and `@bjlittle`_ (reviewer) updated codebase to be compliant with - almost all of the rules for `ruff pydocstyle`_. - (https://github.com/SciTools/iris/issues/5625#issuecomment-1859159734) - -#. `@tkknight`_ and `@bjlittle`_ (reviewer) updated codebase to ensure docstrings - that are not covered by the ruff checks, are consistent with numpydocstyle. - (:issue:`4721`) +#. `@tkknight`_ enabled `numpydoc validation`_ via the pre-commit hook. The docstrings + have been updated to comply and some rules have been ignored for now. + (:pull:`5762`) .. comment Whatsnew author names (@github name) in alphabetical order. Note that, core dev names are automatically included by the common_links.inc: -.. _@scottrobinson02: https://github.com/scottrobinson02 -.. _@acchamber: https://github.com/acchamber -.. _@fazledyn-or: https://github.com/fazledyn-or -.. _@ckmo: https://github.com/ckmo -.. _@david-bentley: https://github.com/david-bentley -.. _@jmendesmetoffice: https://github.com/jmendesmetoffice -.. _@evyve: https://github.com/evyve + .. comment Whatsnew resources in alphabetical order: -.. _NEP29 Drop Schedule: https://numpy.org/neps/nep-0029-deprecation_policy.html#drop-schedule -.. _codespell: https://github.com/codespell-project/codespell -.. _split attributes project: https://github.com/orgs/SciTools/projects/5?pane=info -.. _ruff pydocstyle: https://docs.astral.sh/ruff/rules/#pydocstyle-d \ No newline at end of file +.. _Pull Request Labeler GitHub action: https://github.com/actions/labeler +.. _NPY002: https://docs.astral.sh/ruff/rules/numpy-legacy-random/ +.. _numpydoc validation: https://numpydoc.readthedocs.io/en/latest/validation.html# +.. _Dask version 2024.2.1: https://docs.dask.org/en/stable/changelog.html#v2024-2-1 \ No newline at end of file diff --git a/etc/cf-standard-name-table.xml b/etc/cf-standard-name-table.xml index 6e3c014849..ef05fde69a 100644 --- a/etc/cf-standard-name-table.xml +++ b/etc/cf-standard-name-table.xml @@ -1,7 +1,7 @@ - 82 - 2023-07-06T13:17:07Z + 84 + 2024-01-19T15:55:10Z Centre for Environmental Data Analysis support@ceda.ac.uk @@ -2239,6 +2239,13 @@ "Content" indicates a quantity per unit area. The "atmosphere content" of a quantity refers to the vertical integral from the surface to the top of the atmosphere. For the content between specified levels in the atmosphere, standard names including content_of_atmosphere_layer are used. + + m + + + The height in the atmosphere, L, that buoyant production or destruction of turbulent energy balances the shear production of turbulent kinetic energy: L = -u*3 / (kB0), where u* is the wind frictional velocity, k is the von Karman constant, and B0 is the atmospheric surface buoyancy flux. If the buoyancy flux is destabilizing, L is negative. + + 1 @@ -2715,6 +2722,13 @@ "Vegetation" means any plants e.g. trees, shrubs, grass. "Litter" is dead plant material in or above the soil. In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. + + kg s-1 + + + The amount of total carbon mass transported in the river channels from land into the ocean. This quantity can be provided at a certain location within the river network and floodplain (over land) or at the river mouth (over ocean) where the river enters the ocean. "River" refers to water in the fluvial system (stream and floodplain). + + m2 @@ -3261,6 +3275,27 @@ "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. "Ambient_aerosol" means that the aerosol is measured or modelled at the ambient state of pressure, temperature and relative humidity that exists in its immediate environment. "Ambient aerosol particles" are aerosol particles that have taken up ambient water through hygroscopic growth. The extent of hygroscopic growth depends on the relative humidity and the composition of the particles. To specify the relative humidity and temperature at which the quantity described by the standard name applies, provide scalar coordinate variables with standard names of "relative_humidity" and "air_temperature". + + degree_C + + + This variable quantifies the temperature difference between the skin temperature (sea_surface_skin_temperature) and the subskin temperature (sea_surface_subskin_temperature) due to the turbulent and radiative heat fluxes at the air-sea interface. This difference is commonly referred to as the “cool skin effect” as the solar radiation absorbed within the very thin thermal subskin layer is typically negligible compared to ocean surface heat loss from the combined sensible, latent, and net longwave radiation heat fluxes. + + + + degree_C + + + This variable quantifies the temperature difference between the top (sea_surface_subskin_temperature) and bottom (sea_surface_foundation_temperature) of the diurnal warm layer. This diurnal warm layer, caused by absorption of solar radiation in the absence of strong mixing, together with a cool skin effect, account for the total temperature difference between the sea_surface_skin_temperature and the sea_surface_foundation_temperature. The cool skin effect is associated with the turbulent and infrared radiative heat loss at the air-sea interface. Freshwater fluxes may also affect this variable (sea_surface_subskin_temperature_minus_sea_surface_foundation_temperature). + + + + degree_C + + + This variable quantifies the temperature difference between the top of the diurnal warm layer (sea_surface_subskin_temperature) and the in-situ measured sea surface temperature at depth (sea_surface_temperature). A diurnal warm layer can develop in the top few meters of the ocean through the absorption of solar radiation, if surface mixing is sufficiently weak. + + K @@ -3737,6 +3772,13 @@ The quantity with standard name drainage_amount_through_base_of_soil_model is the amount of water that drains through the bottom of a soil column extending from the surface to a specified depth. "Drainage" is the process of removal of excess water from soil by gravitational flow. "Amount" means mass per unit area. A vertical coordinate variable or scalar coordinate with standard name "depth" should be used to specify the depth to which the soil column extends. + + kg m-2 + + + “Drainage” is the process of removal of excess water from soil by gravitational flow. "Amount" means mass per unit area. The vertical drainage amount in soil is the amount of water that drains through the bottom of a soil column extending from the surface to a specified depth. + + 1 @@ -3926,6 +3968,13 @@ A velocity is a vector quantity. "Eastward" indicates a vector component which is positive when directed eastward (negative westward). The velocity at the sea floor is that adjacent to the ocean bottom, which would be the deepest grid cell in an ocean model and within the benthic boundary layer for measurements. + + m s-1 + + + A velocity is a vector quantity. "Eastward" indicates a vector component which is positive when directed eastward (negative westward).The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. + + m s-1 @@ -3968,13 +4017,6 @@ "Eastward" indicates a vector component which is positive when directed eastward (negative westward). Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) - - s-1 - 45 - - "Eastward" indicates a vector component which is positive when directed eastward (negative westward). Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) Wind shear is the derivative of wind with respect to height. - - m @@ -4612,11 +4654,11 @@ A period is an interval of time, or the time-period of an oscillation. - + W m-2 hfcorr - Flux correction is also called "flux adjustment". A positive flux correction is downward i.e. added to the ocean. In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. + A positive flux adjustment is downward i.e. added to the ocean. In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. @@ -4850,6 +4892,13 @@ The phrase "integral_wrt_X_of_Y" means int Y dX. To specify the limits of the integral the data variable should have an axis for X and associated coordinate bounds. If no axis for X is associated with the data variable, or no coordinate bounds are specified, it is assumed that the integral is calculated over the entire vertical extent of the medium, e.g, if the medium is air the integral is assumed to be calculated over the full depth of the atmosphere. "wrt" means with respect to. "tendency_of_X" means derivative of X with respect to time. Depth is the vertical distance below the surface. 'sea_water_alkalinity_expressed_as_mole_equivalent' is the total alkalinity equivalent concentration (including carbonate, nitrogen, silicate, and borate components). The specification of a physical process by the phrase due_to_process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. + + kg m-1 s-1 + + + Eastward vertically-integrated moisture flux per unit length in latitude. "Eastward" indicates a vector component which is positive when directed eastward (negative westward). Height is the vertical distance above the surface. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name "upward_air_velocity"). The phrase "product_of_X_and_Y" means X*Y. The abbreviation "wrt" means "with respect to". The phrase "integral_wrt_X_of_Y" means int Y dX. To specify the limits of the integral the data variable should have an axis for X and associated coordinate bounds. If no axis for X is associated with the data variable, or no coordinate bounds are specified, it is assumed that the integral is calculated over the entire vertical extent of the medium, e.g, if the medium is air the integral is assumed to be calculated over the full depth of the atmosphere. "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". + + m2 s-1 @@ -4857,6 +4906,13 @@ The phrase "integral_wrt_X_of_Y" means int Y dX. To specify the limits of the integral the data variable should have an axis for X and associated coordinate bounds. If no axis for X is associated with the data variable, or no coordinate bounds are specified, it is assumed that the integral is calculated over the entire vertical extent of the medium, e.g, if the medium is air the integral is assumed to be calculated over the full depth of the atmosphere. The phrase "wrt" means "with respect to". Height is the vertical distance above the surface. The phrase "product_of_X_and_Y" means X*Y. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name "upward_air_velocity".) "Eastward" indicates a vector component which is positive when directed eastward (negative westward). Specific humidity is the mass fraction of water vapor in (moist) air. + + kg m-1 s-1 + + + Northward vertically-integrated moisture flux per unit length in longitude. "Northward" indicates a vector component which is positive when directed northward (negative southward). Height is the vertical distance above the surface. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name "upward_air_velocity"). The phrase "product_of_X_and_Y" means X*Y. The abbreviation "wrt" means "with respect to". The phrase "integral_wrt_X_of_Y" means int Y dX. To specify the limits of the integral the data variable should have an axis for X and associated coordinate bounds. If no axis for X is associated with the data variable, or no coordinate bounds are specified, it is assumed that the integral is calculated over the entire vertical extent of the medium, e.g, if the medium is air the integral is assumed to be calculated over the full depth of the atmosphere. "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". + + m2 s-1 @@ -7724,7 +7780,7 @@ kg - "Land ice not displacing sea water" means land ice that would not alter sea level if the ice were converted to water and added to the ocean. It excludes ice shelves (and any other sort of floating ice) and it excludes a fraction of grounded ice-sheet mass equivalent to the mass of any sea water it displaces. It includes glaciers and a portion of grounded ice-sheet mass exceeding the mass of any sea water displaced. The quantity with standard name land_ice_mass_not_displacing_sea_water is the total mass integrated over an area of land ice. The geographical extent of the ice over which the mass was calculated should be described by providing bounds on the horizontal coordinate variable or scalar with the standard name of "region" supplied according to section 6.1.1 of the CF convention. + "Land ice not displacing sea water" means land ice that would alter sea level if the ice were converted to water and added to the ocean. It excludes ice shelves (and any other sort of floating ice) and it excludes a fraction of grounded ice-sheet mass equivalent to the mass of any sea water it displaces. It includes glaciers and a portion of grounded ice-sheet mass exceeding the mass of any sea water displaced. The quantity with standard name land_ice_mass_not_displacing_sea_water is the total mass integrated over an area of land ice. The geographical extent of the ice over which the mass was calculated should be described by providing bounds on the horizontal coordinate variable or scalar with the standard name of "region" supplied according to section 6.1.1 of the CF convention. "Land ice not displacing sea water" is sometimes referred to as "ice above flotation" or "ice above floatation". @@ -8301,6 +8357,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. The chemical formula for alpha_pinene is C10H16. The IUPAC name for alpha-pinene is (1S,5S)-2,6,6-trimethylbicyclo[3.1.1]hept-2-ene. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Aluminium means aluminium in all chemical forms, commonly referred to as "total aluminium". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -8329,6 +8392,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. Aromatic compounds in organic chemistry are compounds that contain at least one benzene ring of six carbon atoms joined by alternating single and double covalent bonds. The simplest aromatic compound is benzene itself. In standard names "aromatic_compounds" is the term used to describe the group of aromatic chemical species that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. Standard names exist for some individual aromatic species, e.g. benzene and xylene. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Arsenic means arsenic in all chemical forms, commonly referred to as "total arsenic". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -8441,6 +8511,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. The chemical formula for butane is C4H10. Butane is a member of the group of hydrocarbons known as alkanes. There are standard names for the alkane group as well as for some of the individual species. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Cadmium means cadmium in all chemical forms, commonly referred to as "total cadmium". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -8567,6 +8644,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. The chemical formula for chlorine nitrate is ClONO2. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Chlorophylls are the green pigments found in most plants, algae and cyanobacteria; their presence is essential for photosynthesis to take place. There are several different forms of chlorophyll that occur naturally. All contain a chlorin ring (chemical formula C20H16N4) which gives the green pigment and a side chain whose structure varies. The naturally occurring forms of chlorophyll contain between 35 and 55 carbon atoms. Chlorophyll-a is the most commonly occurring form of natural chlorophyll. The chemical formula of chlorophyll-a is C55H72O5N4Mg. "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -8630,6 +8714,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. Chlorophylls are the green pigments found in most plants, algae and cyanobacteria; their presence is essential for photosynthesis to take place. There are several different forms of chlorophyll that occur naturally. All contain a chlorin ring (chemical formula C20H16N4) which gives the green pigment and a side chain whose structure varies. The naturally occurring forms of chlorophyll contain between 35 and 55 carbon atoms. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Chromium means chromium in all chemical forms, commonly referred to as "total chromium". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -8651,6 +8742,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. "Ambient_aerosol" means that the aerosol is measured or modelled at the ambient state of pressure, temperature and relative humidity that exists in its immediate environment. "Ambient aerosol particles" are aerosol particles that have taken up ambient water through hygroscopic growth. The extent of hygroscopic growth depends on the relative humidity and the composition of the particles. Coarse mode aerosol particles have a diameter of more than 1 micrometer. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as "nox_expressed_as_nitrogen". Cobalt means cobalt in all chemical forms, commonly referred to as "total cobalt". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -8658,6 +8756,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. Condensed water means liquid and ice. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Copper means copper in all chemical forms, commonly referred to as "total copper". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9001,6 +9106,13 @@ 'Mass concentration' means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. 'Inorganic nitrogen' describes a family of chemical species which, in an ocean model, usually includes nitrite, nitrate and ammonium which act as nitrogen nutrients. 'Inorganic nitrogen' is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Iron means iron in all chemical forms, commonly referred to as "total iron". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9008,6 +9120,13 @@ "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for isoprene is CH2=C(CH3)CH=CH2. The IUPAC name for isoprene is 2-methylbuta-1,3-diene. Isoprene is a member of the group of hydrocarbons known as terpenes. There are standard names for the terpene group as well as for some of the individual species. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Lead means lead in all chemical forms, commonly referred to as "total lead". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9022,6 +9141,13 @@ Mass concentration means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The mass concentration of liquid water takes into account all cloud droplets and liquid precipitation regardless of drop size or fall speed. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Lithium means lithium in all chemical forms, commonly referred to as "total lithium". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9029,6 +9155,13 @@ "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula of lutein is C40H56O2. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Manganese means manganese in all chemical forms, commonly referred to as "total manganese". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9036,6 +9169,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. Aerosol particles take up ambient water (a process known as hygroscopic growth) depending on the relative humidity and the composition of the particles. "Dry aerosol particles" means aerosol particles without any water uptake. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Mercury means mercury in all chemical forms, commonly referred to as "total mercury". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9113,6 +9253,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Chlorophylls are the green pigments found in most plants, algae and cyanobacteria; their presence is essential for photosynthesis to take place. There are several different forms of chlorophyll that occur naturally. All contain a chlorin ring (chemical formula C20H16N4) which gives the green pigment and a side chain whose structure varies. The naturally occurring forms of chlorophyll contain between 35 and 55 carbon atoms. Nanophytoplankton are phytoplankton between 2 and 20 micrometers in size. Phytoplankton are algae that grow where there is sufficient light to support photosynthesis. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Nickel means nickel in all chemical forms, commonly referred to as "total nickel". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9148,6 +9295,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. The chemical formula for nitrogen dioxide is NO2. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Total nitrogen means nitrogen in all chemical forms. "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9218,6 +9372,13 @@ "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. Aerosol particles take up ambient water (a process known as hygroscopic growth) depending on the relative humidity and the composition of the particles. "Dry aerosol particles" means aerosol particles without any water uptake. "Pm2p5 aerosol" means atmospheric particulate compounds with an aerodynamic diameter of less than or equal to 2.5 micrometers. Chemically, "organic carbon aerosol" refers to the carbonaceous fraction of particulate matter contained in any of the vast number of compounds where carbon is chemically combined with hydrogen and other elements like O, S, N, P, Cl, etc. In measurements of carbonaceous aerosols, organic carbon samples may also include some inorganic carbon compounds, whose mass is neglected and assumed to be distributed between the elemental and organic carbon components of the aerosol particles. Reference: Petzold, A., Ogren, J. A., Fiebig, M., Laj, P., Li, S.-M., Baltensperger, U., Holzer-Popp, T., Kinne, S., Pappalardo, G., Sugimoto, N., Wehrli, C., Wiedensohler, A., and Zhang, X.-Y.: Recommendations for reporting "black carbon" measurements, Atmos. Chem. Phys., 13, 8365–8379, https://doi.org/10.5194/acp-13-8365-2013, 2013. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Organic carbon describes a family of chemical species and is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9295,6 +9456,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. It means the ratio of the mass of X to the mass of Y (including X). A chemical species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Petroleum hydrocarbons are compounds containing just carbon and hydrogen originating from the fossil fuel crude oil. + + kg m-3 + + + Concentration of phaeopigment per unit volume of the water body, where the filtration size or collection method is unspecified (equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/. "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Phaeopigments are a group of non-photosynthetic pigments that are the degradation product of algal chlorophyll pigments. Phaeopigments contain phaeophytin, which fluoresces in response to excitation light, and phaeophorbide, which is colorless and does not fluoresce (source: https://academic.oup.com/plankt/article/24/11/1221/1505482). Phaeopigment concentration commonly increases during the development phase of marine phytoplankton blooms, and declines in the post bloom stage (source: https://www.sciencedirect.com/science/article/pii/0967063793901018). "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9316,6 +9484,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Phosphorus means phosphorus in all chemical forms, commonly referred to as "total phosphorus". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9456,6 +9631,13 @@ Mass concentration means mass per unit volume and is used in the construction mass_concentration_of_X_in_Y, where X is a material constituent of Y. A chemical species denoted by X may be described by a single term such as 'nitrogen' or a phrase such as 'nox_expressed_as_nitrogen'. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Silver means silver in all chemical forms, commonly referred to as "total silver". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9498,6 +9680,13 @@ "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for toluene is C6H5CH3. Toluene has the same structure as benzene, except that one of the hydrogen atoms is replaced by a methyl group. The IUPAC name for toluene is methylbenzene. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Vanadium means vanadium in all chemical forms, commonly referred to as "total vanadium". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -9540,6 +9729,13 @@ "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula of zeaxanthin is C40H56O2. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/ZEAXXXXX/2/. + + kg m-3 + + + "Mass concentration" means mass per unit volume and is used in the construction "mass_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Zinc means zinc in all chemical forms, commonly referred to as "total zinc". "Sea floor sediment" is sediment deposited at the sea bed. + + kg m-3 @@ -11626,6 +11822,13 @@ Mole concentration means number of moles per unit volume, also called "molarity", and is used in the construction "mole_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". In ocean biogeochemistry models, an "abiotic analogue" is used to simulate the effect on a modelled variable when biological effects on ocean carbon concentration and alkalinity are ignored. "Dissolved inorganic carbon" describes a family of chemical species in solution, including carbon dioxide, carbonic acid and the carbonate and bicarbonate anions. "Dissolved inorganic carbon" is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. + + mol m-3 + + + "Mole concentration" means number of moles per unit volume, also called "molarity", and is used in the construction "mole_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Dissolved inorganic carbon" describes a family of chemical species in solution, including carbon dioxide, carbonic acid and the carbonate and bicarbonate anions. "Dissolved inorganic carbon" is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. "Sea floor sediment" is sediment deposited at the sea bed. "Water" means water in all phases. + + mol m-3 @@ -11710,6 +11913,13 @@ The sum of dissolved organic carbon-13 component concentrations. "Mole concentration" means number of moles per unit volume, also called "molarity", and is used in the construction "mole_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Organic carbon" describes a family of chemical species and is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. "C" means the element carbon and "13C" is the stable isotope "carbon-13", having six protons and seven neutrons. + + mol m-3 + + + "Mole concentration" means number of moles per unit volume, also called "molarity", and is used in the construction "mole_concentration_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen' or a phrase such as "nox_expressed_as_nitrogen". "Organic carbon" describes a family of chemical species and is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. "Sea floor sediment" is sediment deposited at the sea bed. "Water" means water in all phases. + + mol m-3 @@ -12641,6 +12851,13 @@ Mole fraction is used in the construction mole_fraction_of_X_in_Y, where X is a material constituent of Y. + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "in_dry_air" means that the quantity is calculated as the total number of particles of X divided by the number of dry air particles, i.e. the effect of water vapor is excluded. The chemical formula for carbon dioxide is CO2. + + 1 @@ -12648,6 +12865,13 @@ Mole fraction is used in the construction mole_fraction_of_X_in_Y, where X is a material constituent of Y. + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "in_dry_air" means that the quantity is calculated as the total number of particles of X divided by the number of dry air particles, i.e. the effect of water vapor is excluded. The chemical formula of carbon monoxide is CO. + + 1 @@ -12718,6 +12942,13 @@ "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for CFC12 is CF2Cl2. The IUPAC name for CFC12 is dichloro(difluoro)methane. + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for CFC13 is CF3Cl. The IUPAC name for CFC13 is chloro(trifluoro)methane. + + 1 @@ -12907,6 +13138,20 @@ "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for hcfc124 is C2HClF4. The IUPAC name for hcfc124 is 1-chloro-1,2,2,2-tetrafluoroethane. + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for HCFC132b is CH2ClCClF2. The IUPAC name for HCFC132b is 1,2-dichloro-1,1-difluoroethane. + + + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical or biological species denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula for HCFC133a is CH2ClCF3. The IUPAC name for HCFC133a is 2-chloro-1,1,1-trifluoroethane. + + 1 @@ -13117,6 +13362,13 @@ Mole fraction is used in the construction mole_fraction_of_X_in_Y, where X is a material constituent of Y. + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "in_dry_air" means that the quantity is calculated as the number of particles of X divided by the number of dry air particles, i.e. the effect of water vapor is excluded. The chemical formula for methane is CH4. Methane is a member of the group of hydrocarbons known as alkanes. There are standard names for the alkane group as well as for some of the individual species. + + 1 @@ -13222,6 +13474,13 @@ Mole fraction is used in the construction mole_fraction_of_X_in_Y, where X is a material constituent of Y. The chemical formula of nitrous oxide is N2O. + + 1 + + + "Mole fraction" is used in the construction "mole_fraction_of_X_in_Y", where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "in_dry_air" means that the quantity is calculated as the number of particles of X divided by the number of dry air particles, i.e. the effect of water vapor is excluded. The chemical formula for nitrous oxide is N2O. + + 1 @@ -13383,6 +13642,20 @@ "Mole ratio" is used in the construction "mole_ratio_of_X_to_Y_in_medium", where X and Y are both material constituents of the medium. "Medium" can take any of the values given in the "medium" section of the standard name Guidelines document. The phrase "ratio_of_X_to_Y" means X/Y. The chemical formula for the nitrate anion is NO3-. The chemical formula of the phosphate anion is PO4 with a charge of minus three. + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/ATPXZZDZ/2/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula of ammonium is NH4. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/MDMAP004/3/. + + mol kg-1 @@ -13397,6 +13670,49 @@ The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Dissolved inorganic carbon" describes a family of chemical species in solution, including carbon dioxide, carbonic acid and the carbonate and bicarbonate anions. "Dissolved inorganic carbon" is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Dissolved nitrogen" means the sum of all nitrogen in solution: inorganic nitrogen (nitrite, nitrate and ammonium) plus nitrogen in carbon compounds. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Organic carbon" describes a family of chemical species and is the term used in standard names for all species belonging to the family that are represented within a given model. The list of individual species that are included in a quantity having a group chemical standard name can vary between models. Where possible, the data variable should be accompanied by a complete description of the species represented, for example, by using a comment attribute. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/CORGZZKG/1/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". "Dissolved organic nitrogen" describes the nitrogen held in carbon compounds in solution. These are mostly generated by plankton excretion and decay. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/MDMAP008/3/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen”. "Organic phosphorus" means phosphorus in carbon compounds. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/ORGPMSZZ/4/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". “Phosphorus” means phosphorus in all chemical forms, commonly referred to as "total phosphorus". The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at +http://vocab.nerc.ac.uk/collection/P01/current/TPHSDSZZ/6/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula of guanosine triphosphate is C10H16N5O14P3. + + mol kg-1 @@ -13453,6 +13769,48 @@ The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". Particulate means suspended solids of all sizes. Particulate inorganic carbon is carbon bound in molecules ionically that may be liberated from the particles as carbon dioxide by acidification. + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Particulate means suspended solids of all sizes. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/MDMAP011/4/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Particulate means suspended solids of all sizes. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/MDMAP013/4/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Particulate means suspended solids of all sizes. Phosphorus means phosphorus in all chemical forms, commonly referred to as "total phosphorus". The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/TPHSVLPT/5/. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Particulate means suspended solids of all sizes. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Particulate means suspended solids of all sizes. + + + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The phrase "expressed_as" is used in the construction A_expressed_as_B, where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. Particulate means suspended solids of all sizes. Phosphorus means phosphorus in all chemical forms, commonly referred to as "total phosphorus". The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/OPHSVLPT/6/. + + mol kg-1 @@ -13467,6 +13825,13 @@ moles_of_X_per_unit_mass_inY is also called "molality" of X in Y, where X is a material constituent of Y. + + mol kg-1 + + + The construction "moles_of_X_per_unit_mass_in_Y" is also called "molality" of X in Y, where X is a material constituent of Y. A chemical species or biological group denoted by X may be described by a single term such as "nitrogen" or a phrase such as "nox_expressed_as_nitrogen". The chemical formula of sulfur hexafluoride is SF6. + + 1 @@ -13775,6 +14140,13 @@ In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. "Vegetation" means any living plants e.g. trees, shrubs, grass. "Litter" is dead plant material in or above the soil. + + kg s-1 + + + The amount of total nitrogen mass transported in the river channels from land into the ocean. This quantity can be provided at a certain location within the river network and floodplain (over land) or at the river mouth (over ocean) where the river enters the ocean. "River" refers to water in the fluvial system (stream and floodplain). + + m @@ -14069,6 +14441,13 @@ A velocity is a vector quantity. "Northward" indicates a vector component which is positive when directed northward (negative southward). The velocity at the sea floor is that adjacent to the ocean bottom, which would be the deepest grid cell in an ocean model and within the benthic boundary layer for measurements. + + m s-1 + + + A velocity is a vector quantity. "Northward" indicates a vector component which is positive when directed northward (negative southward). The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. + + m s-1 @@ -14125,13 +14504,6 @@ "Northward" indicates a vector component which is positive when directed northward (negative southward). Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) - - s-1 - 46 - - "Northward" indicates a vector component which is positive when directed northward (negative southward). Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) Wind shear is the derivative of wind with respect to height. - - kg m-2 @@ -14608,6 +14980,13 @@ Montgomery potential is defined as M = ap + gz, where a = specific volume, p = pressure, g = gravity, and z=depth. It represents an exact streamfunction on specific volume anomaly surfaces. + + m + + + The depth in the ocean, L, that buoyant production or destruction of turbulent energy balances the turbulent kinetic energy: L = -u*3 / (kB0), where u* is the oceanic surface frictional velocity, k is the von Karman constant, and B0 is the oceanic surface buoyancy flux. If the buoyancy flux is destabilizing, L is negative. + + s-1 @@ -14965,6 +15344,13 @@ Global average sea level change is due to change in volume of the water in the ocean, caused by mass and/or density change, or to change in the volume of the ocean basins, caused by tectonics etc. It is sometimes called "eustatic", which is a term that also has other definitions. It differs from the change in the global average sea surface height relative to the centre of the Earth by the global average vertical movement of the ocean floor. Zero sea level change is an arbitrary level. Phase is the initial angle of a wave modelled by a sinusoidal function. A coordinate variable of harmonic_period should be used to specify the period of the sinusoidal wave. Because global average sea level change quantifies the change in volume of the world ocean, it is not calculated necessarily by considering local changes in mean sea level. + + kg s-1 + + + The amount of total phosphorus mass transported in the river channels from land into the ocean. This quantity can be provided at a certain location within the river network and floodplain (over land) or at the river mouth (over ocean) where the river enters the ocean. "River" refers to water in the fluvial system (stream and floodplain). Phosphorus means phosphorus in all chemical forms, commonly referred to as "total phosphorus". + + s-1 @@ -19571,6 +19957,13 @@ sea_water_alkalinity_expressed_as_mole_equivalent is the total alkalinity equivalent concentration (including carbonate, nitrogen, silicate, and borate components). In ocean biogeochemistry models, a "natural analogue" is used to simulate the effect on a modelled variable of imposing preindustrial atmospheric carbon dioxide concentrations, even when the model as a whole may be subjected to varying forcings. + + mol kg-1 + + + The standard name sea_water_alkalinity_per_unit_mass_expressed_as_mole_equivalent is the total alkalinity equivalent concentration (including carbonate, nitrogen, silicate, and borate components) expressed as the number of moles of alkalinity per unit mass of seawater. The phrase "expressed_as" is used in the construction "A_expressed_as_B", where B is a chemical constituent of A. It means that the quantity indicated by the standard name is calculated solely with respect to the B contained in A, neglecting all other chemical constituents of A. The equivalent term in the NERC P01 Parameter Usage Vocabulary may be found at http://vocab.nerc.ac.uk/collection/P01/current/MDMAP014/1/. + + K @@ -20047,6 +20440,13 @@ The magnitude of an acoustic signal emitted by the instrument toward a reflecting surface and received again by the instrument. + + kg s-1 + + + The amount of silicate mass transported in the river channels from land into the ocean. This quantity can be provided at a certain location within the river network and floodplain (over land) or at the river mouth (over ocean) where the river enters the ocean. "River" refers to water in the fluvial system (stream and floodplain). + + 1 @@ -20215,6 +20615,13 @@ Hydraulic conductivity is the constant k in Darcy's Law q=-k grad h for fluid flow q (volume transport per unit area i.e. velocity) through a porous medium, where h is the hydraulic head (pressure expressed as an equivalent depth of water). + + kg m-2 + + + "Content" indicates a quantity per unit area. The "soil content" of a quantity refers to the vertical integral from the surface down to the bottom of the soil model. For the content between specified levels in the soil, standard names including "content_of_soil_layer" are used. + + kg m-2 @@ -20964,6 +21371,20 @@ The surface called "surface" means the lower boundary of the atmosphere.The brightness temperature of a body is the temperature of a black body which radiates the same power per unit solid angle per unit area. + + m2 s-3 + + + A variable quantifying net density gains or losses in air parcel buoyancy based on turbulent heat and moisture fluxes, represented by virtual temperature flux, at the air-sea interface. Positive values indicate a buoyancy flux out of the ocean (into the air) that will destabilize the atmosphere. + + + + m2 s-3 + + + A variable quantifying net density gains or losses in water parcel buoyancy based on thermal (net surface heat flux) and haline (precipitation minus evaporation) forcings at the air-sea interface. A positive value indicates a buoyancy flux into the ocean that will stabilize (i.e., stratify) the surface ocean layer. + + Pa @@ -31550,16 +31971,16 @@ s-1 - + 45 The quantity with standard name upward_derivative_of_eastward_wind is the derivative of the eastward component of wind with respect to height. The phrase "component_derivative_of_X" means derivative of X with respect to distance in the component direction, which may be "northward", "southward", "eastward", "westward", "upward", "downward", "x" or "y". The last two indicate derivatives along the axes of the grid, in the case where they are not true longitude and latitude. A positive value indicates that X is increasing with distance along the positive direction of the axis. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name "upward_air_velocity"). s-1 - + 46 - The quantity with standard name upward_derivative_of_northward_wind is the derivative of the northward component of wind speed with respect to height. The phrase "component_derivative_of_X" means derivative of X with respect to distance in the component direction, which may be "northward", "southward", "eastward", "westward", "upward", "downward", "x" or "y". The last two indicate derivatives along the axes of the grid, in the case where they are not true longitude and latitude. A positive value indicates that X is increasing with distance along the positive direction of the axis. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name "upward_air_velocity"). + The quantity with standard name upward_derivative_of_northward_wind is the derivative of the northward component of wind with respect to height. The phrase "component_derivative_of_X" means derivative of X with respect to distance in the component direction, which may be "northward", "southward", "eastward", "westward", "upward", "downward", "x" or "y". The last two indicate derivatives along the axes of the grid, in the case where they are not true longitude and latitude. A positive value indicates that X is increasing with distance along the positive direction of the axis. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name "upward_air_velocity"). @@ -31940,11 +32361,11 @@ The visibility is the distance at which something can be seen. - + m-1 - The volume scattering/absorption/attenuation coefficient is the fractional change of radiative flux per unit path length due to the stated process. Coefficients with canonical units of m2 s-1 i.e. multiplied by density have standard names with "specific_" instead of "volume_". The scattering/absorption/attenuation coefficient is assumed to be an integral over all wavelengths unless a coordinate of "radiation_wavelength" or "radiation_frequency" is included to specify the wavelength. "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. "Dried_aerosol" means that the aerosol sample has been dried from the ambient state, but that the dry state (relative humidity less than 40 per cent) has not necessarily been reached. To specify the relative humidity at which the sample was measured, provide a scalar coordinate variable with the standard name of "relative_humidity". The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. + The volume scattering/absorption/attenuation coefficient is the fractional change of radiative flux per unit path length due to the stated process. Coefficients with canonical units of m2 s-1 i.e. multiplied by density have standard names with "specific_" instead of "volume_". The scattering/absorption/attenuation coefficient is assumed to be an integral over all wavelengths unless a coordinate of "radiation_wavelength" or "radiation_frequency" is included to specify the wavelength. Radiative flux is the sum of shortwave and longwave radiative fluxes. "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. "Dried_aerosol" means that the aerosol sample has been dried from the ambient state, but that the dry state (relative humidity less than 40 per cent) has not necessarily been reached. To specify the relative humidity at which the sample was measured, provide a scalar coordinate variable with the standard name of "relative_humidity". The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. @@ -31961,18 +32382,18 @@ The specification of a physical process by the phrase due_to_process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. Radiative flux is the sum of shortwave and longwave radiative fluxes. In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. The volume scattering/absorption/attenuation coefficient is the fractional change of radiative flux per unit path length due to the stated process. Coefficients with canonical units of m2 s-1 i.e. multiplied by density have standard names with specific_ instead of volume_. The scattering/absorption/attenuation coefficient is assumed to be an integral over all wavelengths, unless a coordinate of radiation_wavelength is included to specify the wavelength. - + m-1 sr-1 Attenuation is the sum of absorption and scattering. Attenuation is sometimes called "extinction". The attenuated backwards scattering function includes the effects of two-way attenuation by the medium between a radar source and receiver. The volume scattering function is the fraction of incident radiative flux scattered into unit solid angle per unit path length. Backwards scattering refers to the sum of scattering into all backward angles i.e. scattering_angle exceeding pi/2 radians. A scattering_angle should not be specified with this quantity. - + m-1 sr-1 - Attenuation is the sum of absorption and scattering. Attenuation is sometimes called "extinction". The attenuated backwards scattering function includes the effects of two-way attenuation by the medium between a radar source and receiver. The volume scattering function is the fraction of incident radiative flux scattered into unit solid angle per unit path length. Backwards scattering refers to the sum of scattering into all backward angles i.e. scattering_angle exceeding pi/2 radians. A scattering_angle should not be specified with this quantity. A phrase "assuming_condition" indicates that the named quantity is the value which would obtain if all aspects of the system were unaltered except for the assumption of the circumstances specified by the condition. "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. + Attenuation is the sum of absorption and scattering. Attenuation is sometimes called "extinction". The attenuated backwards scattering coefficient includes the effects of two-way attenuation by the medium between a radar source and receiver. The volume scattering coefficient is the fraction of incident radiative flux scattered into unit solid angle per unit path length. Backwards scattering refers to the sum of scattering into all backward angles i.e. scattering_angle exceeding pi/2 radians. A scattering_angle should not be specified with this quantity. The scattering coefficient is assumed to be an integral over all wavelengths unless a coordinate of "radiation_wavelength" or "radiation_frequency" is included to specify the wavelength. Coefficients with canonical units of m2 s-1, i.e. multiplied by density, have standard names with "specific_" instead of "volume_". Radiative flux is the sum of shortwave and longwave radiative fluxes. A phrase "assuming_condition" indicates that the named quantity is the value which would obtain if all aspects of the system were unaltered except for the assumption of the circumstances specified by the condition. "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. @@ -31982,18 +32403,18 @@ Downwelling radiation is radiation from above. It does not mean "net downward". The sign convention is that "upwelling" is positive upwards and "downwelling" is positive downwards. Radiative flux is the sum of shortwave and longwave radiative fluxes. When thought of as being incident on a surface, a radiative flux is sometimes called "irradiance". In addition, it is identical with the quantity measured by a cosine-collector light-meter and sometimes called "vector irradiance". In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. The volume scattering/absorption/attenuation coefficient is the fractional change of radiative flux per unit path length due to the stated process. Coefficients with canonical units of m2 s-1 i.e. multiplied by density have standard names with specific_ instead of volume_. The scattering/absorption/attenuation coefficient is assumed to be an integral over all wavelengths, unless a coordinate of radiation_wavelength is included to specify the wavelength. Attenuation is the sum of absorption and scattering. Attenuation is sometimes called "extinction". Also called "diffuse" attenuation, the attenuation of downwelling radiative flux refers to the decrease with decreasing height or increasing depth of the downwelling component of radiative flux, regardless of incident direction. - - m-1 + + m-1 sr-1 - The volume scattering/absorption/attenuation coefficient is the fractional change of radiative flux per unit path length due to the stated process. Coefficients with canonical units of m2 s-1 i.e. multiplied by density have standard names with specific_ instead of volume_. Backwards scattering refers to the sum of scattering into all backward angles i.e. scattering_angle exceeds pi/2 radians. A scattering_angle should not be specified with this quantity. The scattering/absorption/attenuation coefficient is assumed to be an integral over all wavelengths, unless a coordinate of radiation_wavelength is included to specify the wavelength. "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. "Dried_aerosol" means that the aerosol sample has been dried from the ambient state, but that the dry state (relative humidity less than 40 per cent) has not necessarily been reached. To specify the relative humidity at which the sample was measured, provide a scalar coordinate variable with the standard name of "relative_humidity". The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. + Volume backwards scattering coefficient by ranging instrument is the fraction of radiative flux, per unit path length and per unit solid angle, scattered at 180 degrees angle respect to the incident radiation and obtained through ranging techniques like lidar and radar. Backwards scattering coefficient is assumed to be related to the same wavelength of incident radiation. "Ambient_aerosol" means that the aerosol is measured or modelled at the ambient state of pressure, temperature and relative humidity that exists in its immediate environment. "Ambient aerosol particles" are aerosol particles that have taken up ambient water through hygroscopic growth. The extent of hygroscopic growth depends on the relative humidity and the composition of the particles. The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. - - m-1 sr-1 + + m-1 - Volume backwards scattering coefficient by ranging instrument is the fraction of radiative flux, per unit path length and per unit solid angle, scattered at 180 degrees angle respect to the incident radiation and obtained through ranging techniques like lidar and radar. Backwards scattering coefficient is assumed to be related to the same wavelength of incident radiation. "Ambient_aerosol" means that the aerosol is measured or modelled at the ambient state of pressure, temperature and relative humidity that exists in its immediate environment. "Ambient aerosol particles" are aerosol particles that have taken up ambient water through hygroscopic growth. The extent of hygroscopic growth depends on the relative humidity and the composition of the particles. The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. + The volume scattering/absorption/attenuation coefficient is the fractional change of radiative flux per unit path length due to the stated process. Coefficients with canonical units of m2 s-1 i.e. multiplied by density have standard names with specific_ instead of volume_. Backwards scattering refers to the sum of scattering into all backward angles i.e. scattering_angle exceeds pi/2 radians. A scattering_angle should not be specified with this quantity. The scattering/absorption/attenuation coefficient is assumed to be an integral over all wavelengths, unless a coordinate of radiation_wavelength is included to specify the wavelength. Radiative flux is the sum of shortwave and longwave radiative fluxes. "Aerosol" means the system of suspended liquid or solid particles in air (except cloud droplets) and their carrier gas, the air itself. "Dried_aerosol" means that the aerosol sample has been dried from the ambient state, but that the dry state (relative humidity less than 40 per cent) has not necessarily been reached. To specify the relative humidity at which the sample was measured, provide a scalar coordinate variable with the standard name of "relative_humidity". The specification of a physical process by the phrase "due_to_" process means that the quantity named is a single term in a sum of terms which together compose the general quantity named by omitting the phrase. @@ -32087,6 +32508,13 @@ "Volume fraction" is used in the construction "volume_fraction_of_X_in_Y", where X is a material constituent of Y. It is evaluated as the volume of X divided by the volume of Y (including X). It may be expressed as a fraction, a percentage, or any other dimensionless representation of a fraction. The phrase "frozen_water" means ice. + + + + + "Volume fraction" is used in the construction "volume_fraction_of_X_in_Y", where X is a material constituent of Y. It is evaluated as the volume of X divided by the volume of Y (including X). It may be expressed as a fraction, a percentage, or any other dimensionless representation of a fraction. "Sea floor sediment" is sediment deposited at the sea bed. "Water" means water in all phases. + + 1 @@ -32108,6 +32536,13 @@ "Volume fraction" is used in the construction "volume_fraction_of_X_in_Y", where X is a material constituent of Y. It is evaluated as the volume of X divided by the volume of Y (including X). It may be expressed as a fraction, a percentage, or any other dimensionless representation of a fraction. + + 1 + + + "Volume fraction" is used in the construction volume_fraction_of_X_in_Y, where X is a material constituent of Y. It is evaluated as the volume of X divided by the volume of Y (including X). It may be expressed as a fraction, a percentage, or any other dimensionless representation of a fraction. The volume_fraction_of_water_in_soil_at_saturation is the volume fraction at which a soil has reached it's maximum water holding capacity. + + 1 @@ -32192,18 +32627,18 @@ Water means water in all phases. "Evapotranspiration" means all water vapor fluxes into the atmosphere from the surface: liquid evaporation, sublimation and transpiration. Evaporation is the conversion of liquid or solid into vapor. Transpiration is the process by which liquid water in plant stomata is transferred as water vapor into the atmosphere. (The conversion of solid alone into vapor is called "sublimation".) In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. Unless indicated in the cell_methods attribute, a quantity is assumed to apply to the whole area of each horizontal grid box. - + kg m-2 s-1 - - "Water" means water in all phases. Flux correction is also called "flux adjustment". A positive flux correction is downward i.e. added to the ocean. In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. + wfo + "Water" means water in all phases. The water flux into sea water is the freshwater entering as a result of precipitation, evaporation, river inflow, sea ice effects and water flux relaxation and correction (if applied). In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. - + kg m-2 s-1 - wfo - "Water" means water in all phases. The water flux into sea water is the freshwater entering as a result of precipitation, evaporation, river inflow, sea ice effects and water flux relaxation and correction (if applied). In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. + + "Water" means water in all phases. Flux correction is also called "flux adjustment". A positive flux correction is downward i.e. added to the ocean. In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. @@ -32551,14 +32986,6 @@ isotropic_shortwave_radiance_in_air - - water_evapotranspiration_flux - - - - drainage_amount_through_base_of_soil_model - - mole_fraction_of_ozone_in_air @@ -32587,6 +33014,50 @@ surface_drag_coefficient_in_air + + sea_surface_swell_wave_period + + + + sea_surface_wind_wave_period + + + + mass_fraction_of_convective_cloud_condensed_water_in_air + + + + mass_fraction_of_ozone_in_air + + + + wave_frequency + + + + northward_eliassen_palm_flux_in_air + + + + northward_heat_flux_in_air_due_to_eddy_advection + + + + upward_eliassen_palm_flux_in_air + + + + upward_eastward_momentum_flux_in_air_due_to_nonorographic_eastward_gravity_waves + + + + upward_eastward_momentum_flux_in_air_due_to_nonorographic_westward_gravity_waves + + + + upward_eastward_momentum_flux_in_air_due_to_orographic_gravity_waves + + water_flux_into_sea_water @@ -32627,64 +33098,196 @@ surface_upward_sensible_heat_flux + + atmosphere_moles_of_carbon_monoxide + + + + atmosphere_moles_of_methane + + + + atmosphere_moles_of_methyl_bromide + + + + atmosphere_moles_of_methyl_chloride + + + + atmosphere_moles_of_molecular_hydrogen + + + + atmosphere_moles_of_nitrous_oxide + + mass_concentration_of_suspended_matter_in_sea_water - - universal_thermal_comfort_index + + mole_concentration_of_mesozooplankton_expressed_as_nitrogen_in_sea_water - - sea_surface_swell_wave_period + + mole_concentration_of_microzooplankton_expressed_as_nitrogen_in_sea_water - - sea_surface_wind_wave_period + + mole_concentration_of_organic_detritus_expressed_as_nitrogen_in_sea_water + + + + mole_concentration_of_organic_detritus_expressed_as_silicon_in_sea_water + + + + tendency_of_atmosphere_moles_of_methyl_bromide + + + + tendency_of_atmosphere_moles_of_methyl_chloride + + + + tendency_of_atmosphere_moles_of_molecular_hydrogen + + + + tendency_of_atmosphere_moles_of_nitrous_oxide + + + + tendency_of_middle_atmosphere_moles_of_carbon_monoxide + + + + tendency_of_middle_atmosphere_moles_of_methane + + + + tendency_of_middle_atmosphere_moles_of_methyl_bromide + + + + tendency_of_middle_atmosphere_moles_of_methyl_chloride + + + + tendency_of_middle_atmosphere_moles_of_molecular_hydrogen + + + + tendency_of_troposphere_moles_of_carbon_monoxide + + + + tendency_of_troposphere_moles_of_methane + + + + tendency_of_troposphere_moles_of_methyl_bromide + + + + tendency_of_troposphere_moles_of_methyl_chloride + + + + tendency_of_troposphere_moles_of_molecular_hydrogen atmosphere_net_upward_convective_mass_flux - - tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_deep_convection + + eastward_water_vapor_flux_in_air - - tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_shallow_convection + + kinetic_energy_dissipation_in_atmosphere_boundary_layer - - tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_turbulence + + lwe_stratiform_snowfall_rate - - wave_frequency + + lwe_thickness_of_stratiform_snowfall_amount - - northward_eliassen_palm_flux_in_air + + northward_water_vapor_flux_in_air - - northward_heat_flux_in_air_due_to_eddy_advection + + stratiform_rainfall_amount - - upward_eliassen_palm_flux_in_air + + stratiform_rainfall_flux - - upward_eastward_momentum_flux_in_air_due_to_nonorographic_eastward_gravity_waves + + stratiform_rainfall_rate - - upward_eastward_momentum_flux_in_air_due_to_nonorographic_westward_gravity_waves + + stratiform_snowfall_amount - - upward_eastward_momentum_flux_in_air_due_to_orographic_gravity_waves + + stratiform_snowfall_flux + + + + thickness_of_stratiform_rainfall_amount + + + + thickness_of_stratiform_snowfall_amount + + + + atmosphere_mass_content_of_cloud_condensed_water + + + + atmosphere_mass_content_of_cloud_ice + + + + atmosphere_mass_content_of_convective_cloud_condensed_water + + + + atmosphere_mass_content_of_water_vapor + + + + surface_downward_mole_flux_of_carbon_dioxide + + + + surface_upward_mole_flux_of_carbon_dioxide + + + + atmosphere_mass_content_of_sulfate + + + + atmosphere_mass_content_of_sulfate + + + + change_over_time_in_atmosphere_mass_content_of_water_due_to_advection + + + + change_over_time_in_atmosphere_mass_content_of_water_due_to_advection @@ -32739,240 +33342,96 @@ tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_convection - - tendency_of_middle_atmosphere_moles_of_carbon_monoxide - - - - tendency_of_middle_atmosphere_moles_of_methane - - - - tendency_of_middle_atmosphere_moles_of_methyl_bromide - - - - tendency_of_middle_atmosphere_moles_of_methyl_chloride - - - - tendency_of_middle_atmosphere_moles_of_molecular_hydrogen - - - - tendency_of_troposphere_moles_of_carbon_monoxide - - - - tendency_of_troposphere_moles_of_methane - - - - tendency_of_troposphere_moles_of_methyl_bromide - - - - tendency_of_troposphere_moles_of_methyl_chloride - - - - tendency_of_troposphere_moles_of_molecular_hydrogen - - - - mass_fraction_of_convective_cloud_condensed_water_in_air - - - - mass_fraction_of_ozone_in_air - - - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_due_to_emission - - - - tendency_of_atmosphere_mass_content_of_dust_dry_aerosol_particles_due_to_emission - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_residential_and_commercial_combustion - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_waste_treatment_and_disposal - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_savanna_and_grassland_fires - - - - tendency_of_atmosphere_mass_content_of_primary_particulate_organic_matter_dry_aerosol_particles_due_to_emission - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_land_transport - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_agricultural_waste_burning - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_energy_production_and_distribution - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_maritime_transport - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_due_to_net_chemical_production_and_emission - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_due_to_net_chemical_production_and_emission - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_forest_fires - - - - tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_industrial_processes_and_combustion - - - - sea_surface_swell_wave_significant_height - - - - sea_surface_wind_wave_significant_height - - - - sea_surface_wave_significant_height - - - - mass_content_of_water_in_soil_layer - - - - mass_content_of_water_in_soil - - - - sea_surface_swell_wave_to_direction - - - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_gravitational_settling - - - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_gravitational_settling - - - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_turbulent_deposition - - - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_turbulent_deposition - - - - tendency_of_atmosphere_moles_of_nitric_acid_trihydrate_ambient_aerosol_particles + + tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_deep_convection - - eastward_water_vapor_flux_in_air + + tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_shallow_convection - - kinetic_energy_dissipation_in_atmosphere_boundary_layer + + tendency_of_mass_content_of_water_vapor_in_atmosphere_layer_due_to_turbulence - - lwe_stratiform_snowfall_rate + + equivalent_thickness_at_stp_of_atmosphere_ozone_content - - lwe_thickness_of_stratiform_snowfall_amount + + sea_water_x_velocity - - northward_water_vapor_flux_in_air + + sea_water_y_velocity - - stratiform_rainfall_amount + + x_wind - - stratiform_rainfall_flux + + y_wind - - stratiform_rainfall_rate + + tendency_of_atmosphere_mass_content_of_water_vapor_due_to_advection - - stratiform_snowfall_amount + + land_ice_surface_specific_mass_balance_rate - - stratiform_snowfall_flux + + land_ice_lwe_surface_specific_mass_balance_rate - - thickness_of_stratiform_rainfall_amount + + isotropic_radiance_per_unit_wavelength_in_air - - thickness_of_stratiform_snowfall_amount + + isotropic_radiance_per_unit_wavelength_in_air - - atmosphere_mass_content_of_cloud_condensed_water + + omnidirectional_spherical_irradiance_per_unit_wavelength_in_sea_water - - atmosphere_mass_content_of_cloud_ice + + mass_concentration_of_chlorophyll_in_sea_water - - atmosphere_mass_content_of_convective_cloud_condensed_water + + mass_concentration_of_chlorophyll_in_sea_water - - atmosphere_mass_content_of_water_vapor + + atmosphere_convective_available_potential_energy - - surface_downward_mole_flux_of_carbon_dioxide + + atmosphere_convective_available_potential_energy - - surface_upward_mole_flux_of_carbon_dioxide + + gross_primary_productivity_of_biomass_expressed_as_carbon - - atmosphere_mass_content_of_sulfate + + net_primary_productivity_of_biomass_expressed_as_carbon - - atmosphere_mass_content_of_sulfate + + net_primary_productivity_of_biomass_expressed_as_carbon_accumulated_in_leaves - - change_over_time_in_atmosphere_mass_content_of_water_due_to_advection + + net_primary_productivity_of_biomass_expressed_as_carbon_accumulated_in_roots - - change_over_time_in_atmosphere_mass_content_of_water_due_to_advection + + net_primary_productivity_of_biomass_expressed_as_carbon_accumulated_in_wood @@ -33283,840 +33742,868 @@ tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_dry_deposition - - x_wind + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_gravitational_settling - - y_wind + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_gravitational_settling - - land_ice_surface_specific_mass_balance_rate + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_turbulent_deposition - - land_ice_lwe_surface_specific_mass_balance_rate + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_turbulent_deposition - - isotropic_radiance_per_unit_wavelength_in_air + + tendency_of_atmosphere_moles_of_nitric_acid_trihydrate_ambient_aerosol_particles - - isotropic_radiance_per_unit_wavelength_in_air + + tendency_of_atmosphere_moles_of_sulfate_dry_aerosol_particles - - omnidirectional_spherical_irradiance_per_unit_wavelength_in_sea_water + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_due_to_emission - - mass_concentration_of_chlorophyll_in_sea_water + + tendency_of_atmosphere_mass_content_of_dust_dry_aerosol_particles_due_to_emission - - mass_concentration_of_chlorophyll_in_sea_water + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_residential_and_commercial_combustion - - tendency_of_atmosphere_moles_of_sulfate_dry_aerosol_particles + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_waste_treatment_and_disposal - - tendency_of_atmosphere_moles_of_methyl_bromide + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_savanna_and_grassland_fires - - tendency_of_atmosphere_moles_of_methyl_chloride + + tendency_of_atmosphere_mass_content_of_primary_particulate_organic_matter_dry_aerosol_particles_due_to_emission - - tendency_of_atmosphere_moles_of_molecular_hydrogen + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_land_transport - - tendency_of_atmosphere_moles_of_nitrous_oxide + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_agricultural_waste_burning - - tendency_of_atmosphere_mass_content_of_water_vapor_due_to_advection + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_energy_production_and_distribution - - atmosphere_moles_of_carbon_monoxide + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_maritime_transport - - sea_surface_wind_wave_to_direction + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_due_to_net_chemical_production_and_emission - - sea_surface_wave_mean_period + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_due_to_net_chemical_production_and_emission - - equivalent_thickness_at_stp_of_atmosphere_ozone_content + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_forest_fires - - atmosphere_moles_of_methane + + tendency_of_atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol_particles_expressed_as_carbon_due_to_emission_from_industrial_processes_and_combustion - - atmosphere_moles_of_methyl_bromide + + sea_surface_swell_wave_significant_height - - atmosphere_moles_of_methyl_chloride + + sea_surface_wind_wave_significant_height - - atmosphere_moles_of_molecular_hydrogen + + sea_surface_wave_significant_height - - atmosphere_moles_of_nitrous_oxide + + mass_content_of_water_in_soil_layer - - sea_water_x_velocity + + mass_content_of_water_in_soil - - sea_water_y_velocity + + sea_surface_swell_wave_to_direction - - integral_wrt_time_of_air_temperature_deficit + + sea_surface_wind_wave_to_direction - - integral_wrt_time_of_air_temperature_excess + + sea_surface_wave_mean_period - - integral_wrt_time_of_surface_downward_latent_heat_flux + + sea_surface_wind_wave_mean_period - - integral_wrt_time_of_surface_downward_sensible_heat_flux + + sea_surface_swell_wave_mean_period - - atmosphere_convective_available_potential_energy + + ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity_deficit - - atmosphere_convective_available_potential_energy + + atmosphere_mass_content_of_sea_salt_dry_aerosol_particles - - gross_primary_productivity_of_biomass_expressed_as_carbon + + atmosphere_mass_content_of_sea_salt_dry_aerosol_particles - - net_primary_productivity_of_biomass_expressed_as_carbon + + atmosphere_optical_thickness_due_to_sea_salt_ambient_aerosol_particles - - net_primary_productivity_of_biomass_expressed_as_carbon_accumulated_in_leaves + + atmosphere_optical_thickness_due_to_sea_salt_ambient_aerosol_particles - - net_primary_productivity_of_biomass_expressed_as_carbon_accumulated_in_roots + + mass_concentration_of_sea_salt_dry_aerosol_particles_in_air - - net_primary_productivity_of_biomass_expressed_as_carbon_accumulated_in_wood + + mass_concentration_of_sea_salt_dry_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_pm2p5_sea_salt_dry_aerosol_particles_due_to_dry_deposition + + mass_fraction_of_sea_salt_dry_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_pm2p5_sea_salt_dry_aerosol_particles_due_to_emission + + mass_fraction_of_sea_salt_dry_aerosol_particles_in_air - - sea_surface_wind_wave_mean_period + + tendency_of_atmosphere_mass_content_of_pm10_sea_salt_dry_aerosol_particles_due_to_dry_deposition - - sea_surface_swell_wave_mean_period + + tendency_of_atmosphere_mass_content_of_pm10_sea_salt_dry_aerosol_particles_due_to_emission - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_emission + + tendency_of_atmosphere_mass_content_of_pm10_sea_salt_dry_aerosol_particles_due_to_wet_deposition - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_emission + + tendency_of_atmosphere_mass_content_of_pm2p5_sea_salt_dry_aerosol_particles_due_to_wet_deposition - - sea_surface_height_above_geoid + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_dry_deposition - - sea_surface_height_above_geoid + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_dry_deposition - - sea_floor_depth_below_geoid + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_gravitational_settling - - air_pressure_at_mean_sea_level + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_gravitational_settling - - lagrangian_tendency_of_air_pressure + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_turbulent_deposition - - lagrangian_tendency_of_air_pressure + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_turbulent_deposition - - mass_concentration_of_elemental_carbon_dry_aerosol_particles_in_air + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_wet_deposition - - atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_wet_deposition - - mass_fraction_of_elemental_carbon_dry_aerosol_particles_in_air + + atmosphere_optical_thickness_due_to_pm1_ambient_aerosol_particles - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_dry_deposition + + mass_concentration_of_pm1_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission + + mass_fraction_of_pm1_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_energy_production_and_distribution + + mass_fraction_of_pm1_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_forest_fires + + atmosphere_optical_thickness_due_to_pm2p5_ambient_aerosol_particles - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_industrial_processes_and_combustion + + mass_concentration_of_pm2p5_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_land_transport + + mass_fraction_of_pm2p5_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_maritime_transport + + mass_fraction_of_pm2p5_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_residential_and_commercial_combustion + + atmosphere_optical_thickness_due_to_pm10_ambient_aerosol_particles - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_savanna_and_grassland_fires + + mass_concentration_of_pm10_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_waste_treatment_and_disposal + + mass_fraction_of_pm10_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_gravitational_settling + + mass_fraction_of_pm10_ambient_aerosol_particles_in_air - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_turbulent_deposition + + tendency_of_atmosphere_mass_content_of_pm2p5_sea_salt_dry_aerosol_particles_due_to_dry_deposition - - tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_wet_deposition + + tendency_of_atmosphere_mass_content_of_pm2p5_sea_salt_dry_aerosol_particles_due_to_emission - - tendency_of_mass_concentration_of_elemental_carbon_dry_aerosol_particles_in_air_due_to_emission_from_aviation + + sea_floor_depth_below_mean_sea_level - - integral_wrt_time_of_surface_net_downward_longwave_flux + + sea_surface_height_above_mean_sea_level - - integral_wrt_time_of_surface_net_downward_shortwave_flux + + sea_surface_height_above_mean_sea_level - - integral_wrt_time_of_toa_net_downward_shortwave_flux + + surface_geostrophic_eastward_sea_water_velocity_assuming_mean_sea_level_for_geoid - - integral_wrt_time_of_toa_outgoing_longwave_flux + + surface_geostrophic_eastward_sea_water_velocity_assuming_mean_sea_level_for_geoid - - northward_ocean_freshwater_transport_due_to_parameterized_eddy_advection + + surface_geostrophic_northward_sea_water_velocity_assuming_mean_sea_level_for_geoid - - northward_ocean_salt_transport_due_to_parameterized_eddy_advection + + surface_geostrophic_northward_sea_water_velocity_assuming_mean_sea_level_for_geoid - - ocean_heat_x_transport_due_to_parameterized_eddy_advection + + surface_geostrophic_sea_water_x_velocity_assuming_mean_sea_level_for_geoid - - ocean_heat_y_transport_due_to_parameterized_eddy_advection + + surface_geostrophic_sea_water_y_velocity_assuming_mean_sea_level_for_geoid - - ocean_mass_x_transport_due_to_advection_and_parameterized_eddy_advection + + tendency_of_sea_surface_height_above_mean_sea_level - - ocean_mass_y_transport_due_to_advection_and_parameterized_eddy_advection + + surface_geostrophic_northward_sea_water_velocity - - ocean_meridional_overturning_mass_streamfunction_due_to_parameterized_eddy_advection + + surface_geostrophic_eastward_sea_water_velocity - - ocean_y_overturning_mass_streamfunction_due_to_parameterized_eddy_advection + + tendency_of_atmosphere_mass_content_of_nitrogen_compounds_expressed_as_nitrogen_due_to_dry_deposition - - tendency_of_sea_water_salinity_due_to_parameterized_eddy_advection + + tendency_of_atmosphere_mass_content_of_nitrogen_compounds_expressed_as_nitrogen_due_to_deposition - - tendency_of_sea_water_temperature_due_to_parameterized_eddy_advection + + atmosphere_absorption_optical_thickness_due_to_sea_salt_ambient_aerosol_particles - - northward_sea_water_velocity_due_to_parameterized_mesoscale_eddies + + atmosphere_absorption_optical_thickness_due_to_sea_salt_ambient_aerosol_particles - - eastward_sea_water_velocity_due_to_parameterized_mesoscale_eddies + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_emission - - sea_water_x_velocity_due_to_parameterized_mesoscale_eddies + + tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_emission - - sea_water_y_velocity_due_to_parameterized_mesoscale_eddies + + sea_surface_height_above_geoid - - upward_sea_water_velocity_due_to_parameterized_mesoscale_eddies + + sea_surface_height_above_geoid - - ocean_tracer_biharmonic_diffusivity_due_to_parameterized_mesoscale_eddy_advection + + sea_floor_depth_below_geoid - - ocean_tracer_laplacian_diffusivity_due_to_parameterized_mesoscale_eddy_advection + + air_pressure_at_mean_sea_level - - tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection + + lagrangian_tendency_of_air_pressure - - mole_concentration_of_mesozooplankton_expressed_as_nitrogen_in_sea_water + + lagrangian_tendency_of_air_pressure - - mole_concentration_of_microzooplankton_expressed_as_nitrogen_in_sea_water + + mass_concentration_of_elemental_carbon_dry_aerosol_particles_in_air - - mole_concentration_of_organic_detritus_expressed_as_nitrogen_in_sea_water + + atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles - - mole_concentration_of_organic_detritus_expressed_as_silicon_in_sea_water + + mass_fraction_of_elemental_carbon_dry_aerosol_particles_in_air - - northward_ocean_heat_transport_due_to_parameterized_eddy_advection + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_dry_deposition - - integral_wrt_depth_of_sea_water_practical_salinity + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission - - integral_wrt_depth_of_sea_water_temperature + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_energy_production_and_distribution - - integral_wrt_depth_of_sea_water_temperature + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_forest_fires - - integral_wrt_depth_of_sea_water_temperature + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_industrial_processes_and_combustion - - integral_wrt_depth_of_sea_water_temperature + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_land_transport - - integral_wrt_height_of_product_of_eastward_wind_and_specific_humidity + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_maritime_transport - - integral_wrt_height_of_product_of_northward_wind_and_specific_humidity + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_residential_and_commercial_combustion - - water_flux_into_sea_water_from_rivers + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_savanna_and_grassland_fires - - toa_outgoing_shortwave_flux_assuming_clear_sky_and_no_aerosol + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_emission_from_waste_treatment_and_disposal - - wood_debris_mass_content_of_carbon + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_gravitational_settling - - stratiform_graupel_flux + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_turbulent_deposition - - water_volume_transport_into_sea_water_from_rivers + + tendency_of_atmosphere_mass_content_of_elemental_carbon_dry_aerosol_particles_due_to_wet_deposition - - surface_water_evaporation_flux + + tendency_of_mass_concentration_of_elemental_carbon_dry_aerosol_particles_in_air_due_to_emission_from_aviation - - northward_transformed_eulerian_mean_air_velocity + + integral_wrt_time_of_air_temperature_deficit - - ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity_deficit + + integral_wrt_time_of_air_temperature_excess - - atmosphere_mass_content_of_sea_salt_dry_aerosol_particles + + integral_wrt_time_of_surface_downward_latent_heat_flux - - atmosphere_mass_content_of_sea_salt_dry_aerosol_particles + + integral_wrt_time_of_surface_downward_sensible_heat_flux - - atmosphere_optical_thickness_due_to_sea_salt_ambient_aerosol_particles + + integral_wrt_time_of_surface_net_downward_longwave_flux - - atmosphere_optical_thickness_due_to_sea_salt_ambient_aerosol_particles + + integral_wrt_time_of_surface_net_downward_shortwave_flux - - mass_concentration_of_sea_salt_dry_aerosol_particles_in_air + + integral_wrt_time_of_toa_net_downward_shortwave_flux - - mass_concentration_of_sea_salt_dry_aerosol_particles_in_air + + integral_wrt_time_of_toa_outgoing_longwave_flux - - mass_fraction_of_sea_salt_dry_aerosol_particles_in_air + + northward_ocean_freshwater_transport_due_to_parameterized_eddy_advection - - mass_fraction_of_sea_salt_dry_aerosol_particles_in_air + + northward_ocean_salt_transport_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_pm10_sea_salt_dry_aerosol_particles_due_to_dry_deposition + + ocean_heat_x_transport_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_pm10_sea_salt_dry_aerosol_particles_due_to_emission + + ocean_heat_y_transport_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_pm10_sea_salt_dry_aerosol_particles_due_to_wet_deposition + + ocean_mass_x_transport_due_to_advection_and_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_pm2p5_sea_salt_dry_aerosol_particles_due_to_wet_deposition + + ocean_mass_y_transport_due_to_advection_and_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_dry_deposition + + ocean_meridional_overturning_mass_streamfunction_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_dry_deposition + + ocean_y_overturning_mass_streamfunction_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_gravitational_settling + + tendency_of_sea_water_salinity_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_gravitational_settling + + tendency_of_sea_water_temperature_due_to_parameterized_eddy_advection - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_turbulent_deposition + + northward_sea_water_velocity_due_to_parameterized_mesoscale_eddies - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_turbulent_deposition + + eastward_sea_water_velocity_due_to_parameterized_mesoscale_eddies - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_wet_deposition + + sea_water_x_velocity_due_to_parameterized_mesoscale_eddies - - tendency_of_atmosphere_mass_content_of_sea_salt_dry_aerosol_particles_due_to_wet_deposition + + sea_water_y_velocity_due_to_parameterized_mesoscale_eddies - - atmosphere_optical_thickness_due_to_pm1_ambient_aerosol_particles + + upward_sea_water_velocity_due_to_parameterized_mesoscale_eddies - - mass_concentration_of_pm1_ambient_aerosol_particles_in_air + + ocean_tracer_biharmonic_diffusivity_due_to_parameterized_mesoscale_eddy_advection - - mass_fraction_of_pm1_ambient_aerosol_particles_in_air + + ocean_tracer_laplacian_diffusivity_due_to_parameterized_mesoscale_eddy_advection - - mass_fraction_of_pm1_ambient_aerosol_particles_in_air + + tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection - - atmosphere_optical_thickness_due_to_pm2p5_ambient_aerosol_particles + + northward_ocean_heat_transport_due_to_parameterized_eddy_advection - - mass_concentration_of_pm2p5_ambient_aerosol_particles_in_air + + mole_concentration_of_dissolved_inorganic_13C_in_sea_water - - mass_fraction_of_pm2p5_ambient_aerosol_particles_in_air + + surface_downward_mass_flux_of_13C_dioxide_abiotic_analogue_expressed_as_13C - - mass_fraction_of_pm2p5_ambient_aerosol_particles_in_air + + surface_downward_mass_flux_of_14C_dioxide_abiotic_analogue_expressed_as_carbon - - atmosphere_optical_thickness_due_to_pm10_ambient_aerosol_particles + + mole_concentration_of_dissolved_inorganic_14C_in_sea_water - - mass_concentration_of_pm10_ambient_aerosol_particles_in_air + + stem_mass_content_of_carbon - - mass_fraction_of_pm10_ambient_aerosol_particles_in_air + + subsurface_litter_mass_content_of_carbon - - mass_fraction_of_pm10_ambient_aerosol_particles_in_air + + mass_flux_of_carbon_into_litter_from_vegetation - - sea_floor_depth_below_mean_sea_level + + litter_mass_content_of_carbon - - sea_surface_height_above_mean_sea_level + + surface_litter_mass_content_of_carbon - - sea_surface_height_above_mean_sea_level + + eastward_transformed_eulerian_mean_air_velocity - - surface_geostrophic_eastward_sea_water_velocity_assuming_mean_sea_level_for_geoid + + northward_transformed_eulerian_mean_air_velocity - - surface_geostrophic_eastward_sea_water_velocity_assuming_mean_sea_level_for_geoid + + surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_heterotrophic_respiration - - surface_geostrophic_northward_sea_water_velocity_assuming_mean_sea_level_for_geoid + + surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_respiration_in_soil - - surface_geostrophic_northward_sea_water_velocity_assuming_mean_sea_level_for_geoid + + surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_plant_respiration - - surface_geostrophic_sea_water_x_velocity_assuming_mean_sea_level_for_geoid + + surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_plant_respiration_for_biomass_growth - - surface_geostrophic_sea_water_y_velocity_assuming_mean_sea_level_for_geoid + + surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_plant_respiration_for_biomass_maintenance - - tendency_of_sea_surface_height_above_mean_sea_level + + carbon_mass_content_of_forestry_and_agricultural_products - - surface_geostrophic_northward_sea_water_velocity + + carbon_mass_content_of_forestry_and_agricultural_products - - surface_geostrophic_eastward_sea_water_velocity + + leaf_mass_content_of_carbon - - tendency_of_atmosphere_mass_content_of_nitrogen_compounds_expressed_as_nitrogen_due_to_dry_deposition + + medium_soil_pool_mass_content_of_carbon - - tendency_of_atmosphere_mass_content_of_nitrogen_compounds_expressed_as_nitrogen_due_to_deposition + + fast_soil_pool_mass_content_of_carbon - - atmosphere_absorption_optical_thickness_due_to_sea_salt_ambient_aerosol_particles + + miscellaneous_living_matter_mass_content_of_carbon - - atmosphere_absorption_optical_thickness_due_to_sea_salt_ambient_aerosol_particles + + root_mass_content_of_carbon - - mole_concentration_of_dissolved_inorganic_13C_in_sea_water + + slow_soil_pool_mass_content_of_carbon - - surface_downward_mass_flux_of_13C_dioxide_abiotic_analogue_expressed_as_13C + + soil_mass_content_of_carbon - - surface_downward_mass_flux_of_14C_dioxide_abiotic_analogue_expressed_as_carbon + + volume_scattering_coefficient_of_radiative_flux_in_air_due_to_dried_aerosol_particles - - mole_concentration_of_dissolved_inorganic_14C_in_sea_water + + volume_scattering_coefficient_of_radiative_flux_in_air_due_to_ambient_aerosol_particles - - stem_mass_content_of_carbon + + integral_wrt_depth_of_sea_water_practical_salinity - - subsurface_litter_mass_content_of_carbon + + integral_wrt_depth_of_sea_water_temperature - - mass_flux_of_carbon_into_litter_from_vegetation + + integral_wrt_depth_of_sea_water_temperature - - platform_id + + integral_wrt_depth_of_sea_water_temperature - - atmosphere_moles_of_halon1301 + + integral_wrt_depth_of_sea_water_temperature - - tendency_of_atmosphere_moles_of_halon1301 + + integral_wrt_height_of_product_of_eastward_wind_and_specific_humidity - - atmosphere_moles_of_halon1211 + + integral_wrt_height_of_product_of_northward_wind_and_specific_humidity - - tendency_of_atmosphere_moles_of_halon1211 + + water_flux_into_sea_water_from_rivers - - atmosphere_moles_of_halon1202 + + toa_outgoing_shortwave_flux_assuming_clear_sky_and_no_aerosol - - tendency_of_atmosphere_moles_of_halon1202 + + wood_debris_mass_content_of_carbon - - atmosphere_moles_of_cfc12 + + stratiform_graupel_flux - - atmosphere_mass_content_of_cloud_liquid_water + + water_volume_transport_into_sea_water_from_rivers - - effective_radius_of_cloud_liquid_water_particles + + surface_water_evaporation_flux - - effective_radius_of_convective_cloud_liquid_water_particles + + sea_ice_temperature_expressed_as_heat_content - - effective_radius_of_convective_cloud_liquid_water_particles_at_convective_liquid_water_cloud_top + + sea_ice_temperature_expressed_as_heat_content - - effective_radius_of_stratiform_cloud_liquid_water_particles + + sea_water_potential_temperature_expressed_as_heat_content - - effective_radius_of_stratiform_cloud_liquid_water_particles_at_stratiform_liquid_water_cloud_top + + sea_water_potential_temperature_expressed_as_heat_content - - magnitude_of_sea_ice_displacement + + incoming_water_volume_transport_along_river_channel - - number_concentration_of_convective_cloud_liquid_water_particles_at_convective_liquid_water_cloud_top + + surface_upwelling_longwave_flux_in_air - - number_concentration_of_stratiform_cloud_liquid_water_particles_at_stratiform_liquid_water_cloud_top + + surface_upwelling_radiance_per_unit_wavelength_in_air - - air_equivalent_potential_temperature + + surface_upwelling_radiance_per_unit_wavelength_in_air_emerging_from_sea_water - - mass_content_of_cloud_liquid_water_in_atmosphere_layer + + surface_upwelling_radiance_per_unit_wavelength_in_air_reflected_by_sea_water - - air_pseudo_equivalent_temperature + + surface_upwelling_radiance_per_unit_wavelength_in_sea_water - - air_equivalent_temperature + + surface_upwelling_radiative_flux_per_unit_wavelength_in_air - - effective_radius_of_cloud_liquid_water_particles_at_liquid_water_cloud_top + + surface_upwelling_radiative_flux_per_unit_wavelength_in_sea_water - - atmosphere_mass_content_of_convective_cloud_liquid_water + + surface_upwelling_shortwave_flux_in_air - - mole_concentration_of_phytoplankton_expressed_as_nitrogen_in_sea_water + + surface_upwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol - - tendency_of_mass_fraction_of_stratiform_cloud_ice_in_air_due_to_riming_from_cloud_liquid_water + + upwelling_radiance_per_unit_wavelength_in_air - - tendency_of_mass_fraction_of_stratiform_cloud_ice_in_air_due_to_heterogeneous_nucleation_from_cloud_liquid_water + + upwelling_radiative_flux_per_unit_wavelength_in_air - - tendency_of_mass_fraction_of_stratiform_cloud_ice_in_air_due_to_melting_to_cloud_liquid_water + + upwelling_radiative_flux_per_unit_wavelength_in_sea_water - - air_pseudo_equivalent_potential_temperature + + upwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol - - growth_limitation_of_diazotrophic_phytoplankton_due_to_solar_irradiance + + surface_upwelling_longwave_flux_in_air_assuming_clear_sky - - iron_growth_limitation_of_diazotrophic_phytoplankton + + surface_upwelling_shortwave_flux_in_air_assuming_clear_sky - - mass_concentration_of_diazotrophic_phytoplankton_expressed_as_chlorophyll_in_sea_water + + downwelling_photon_flux_per_unit_wavelength_in_sea_water - - mole_concentration_of_diazotrophic_phytoplankton_expressed_as_carbon_in_sea_water + + downwelling_photon_radiance_per_unit_wavelength_in_sea_water - - net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_diazotrophic_phytoplankton + + downwelling_photon_spherical_irradiance_per_unit_wavelength_in_sea_water - - net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_diazotrophic_phytoplankton + + downwelling_radiance_per_unit_wavelength_in_air - - nitrogen_growth_limitation_of_diazotrophic_phytoplankton + + downwelling_radiance_per_unit_wavelength_in_sea_water - - tendency_of_mole_concentration_of_particulate_organic_matter_expressed_as_carbon_in_sea_water_due_to_net_primary_production_by_diazotrophic_phytoplankton + + downwelling_radiative_flux_per_unit_wavelength_in_air - - mass_fraction_of_liquid_precipitation_in_air + + downwelling_radiative_flux_per_unit_wavelength_in_sea_water - - mass_fraction_of_liquid_precipitation_in_air + + downwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol - - area_type + + downwelling_spherical_irradiance_per_unit_wavelength_in_sea_water - - area_type + + integral_wrt_time_of_surface_downwelling_longwave_flux_in_air - - atmosphere_upward_absolute_vorticity + + integral_wrt_time_of_surface_downwelling_shortwave_flux_in_air - - atmosphere_upward_relative_vorticity + + surface_downwelling_longwave_flux_in_air - - surface_snow_density + + surface_downwelling_photon_flux_per_unit_wavelength_in_sea_water - - tendency_of_atmosphere_mass_content_of_water_vapor_due_to_sublimation_of_surface_snow_and_ice + + surface_downwelling_photon_radiance_per_unit_wavelength_in_sea_water - - mass_fraction_of_mercury_dry_aerosol_particles_in_air + + surface_downwelling_photon_spherical_irradiance_per_unit_wavelength_in_sea_water - - tendency_of_atmosphere_mass_content_of_mercury_dry_aerosol_particles_due_to_emission + + surface_downwelling_radiance_per_unit_wavelength_in_sea_water + + + + surface_downwelling_radiative_flux_per_unit_wavelength_in_air + + + + surface_downwelling_radiative_flux_per_unit_wavelength_in_sea_water + + + + surface_downwelling_shortwave_flux_in_air + + + + surface_downwelling_shortwave_flux_in_air_assuming_clear_sky + + + + surface_downwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol + + + + surface_downwelling_spherical_irradiance_per_unit_wavelength_in_sea_water + + + + magnitude_of_sea_ice_displacement @@ -34155,20 +34642,36 @@ stratiform_precipitation_flux - - tendency_of_air_temperature_due_to_stratiform_precipitation + + tendency_of_air_temperature_due_to_stratiform_precipitation + + + + tendency_of_specific_humidity_due_to_stratiform_precipitation + + + + platform_roll + + + + platform_pitch + + + + platform_yaw - - tendency_of_specific_humidity_due_to_stratiform_precipitation + + platform_id - - tendency_of_atmosphere_moles_of_methane + + platform_name - - mole_fraction_of_noy_expressed_as_nitrogen_in_air + + water_vapor_partial_pressure_in_air @@ -34187,6 +34690,14 @@ tendency_of_mole_concentration_of_dissolved_inorganic_silicon_in_sea_water_due_to_biological_processes + + mole_concentration_of_diatoms_expressed_as_nitrogen_in_sea_water + + + + net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_calcareous_phytoplankton + + net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_diatoms @@ -34203,16 +34714,12 @@ net_primary_mole_productivity_of_biomass_expressed_as_carbon_due_to_nitrate_utilization - - platform_roll - - - - platform_pitch + + mole_concentration_of_phytoplankton_expressed_as_nitrogen_in_sea_water - - platform_yaw + + tendency_of_atmosphere_mass_content_of_nitrogen_compounds_expressed_as_nitrogen_due_to_wet_deposition @@ -34243,112 +34750,116 @@ rate_of_hydroxyl_radical_destruction_due_to_reaction_with_nmvoc - - tendency_of_sea_water_conservative_temperature_expressed_as_heat_content_due_to_parameterized_dianeutral_mixing + + tendency_of_atmosphere_moles_of_methane - - tendency_of_sea_water_potential_temperature_expressed_as_heat_content_due_to_parameterized_dianeutral_mixing + + mole_fraction_of_noy_expressed_as_nitrogen_in_air - - tendency_of_atmosphere_mass_content_of_nitrogen_compounds_expressed_as_nitrogen_due_to_wet_deposition + + mole_fraction_of_dichlorine_peroxide_in_air - - eastward_transformed_eulerian_mean_air_velocity + + mole_fraction_of_methylglyoxal_in_air - - surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_heterotrophic_respiration + + atmosphere_moles_of_carbon_tetrachloride - - surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_respiration_in_soil + + floating_ice_shelf_area_fraction - - surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_plant_respiration + + stratiform_cloud_area_fraction - - surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_plant_respiration_for_biomass_growth + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_wet_deposition - - surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_plant_respiration_for_biomass_maintenance + + tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_wet_deposition - - carbon_mass_content_of_forestry_and_agricultural_products + + mass_fraction_of_mercury_dry_aerosol_particles_in_air - - carbon_mass_content_of_forestry_and_agricultural_products + + tendency_of_atmosphere_mass_content_of_mercury_dry_aerosol_particles_due_to_emission - - leaf_mass_content_of_carbon + + carbon_mass_flux_into_litter_and_soil_due_to_anthropogenic_land_use_or_land_cover_change - - medium_soil_pool_mass_content_of_carbon + + product_of_eastward_wind_and_lagrangian_tendency_of_air_pressure - - fast_soil_pool_mass_content_of_carbon + + product_of_northward_wind_and_lagrangian_tendency_of_air_pressure - - miscellaneous_living_matter_mass_content_of_carbon + + backscattering_ratio_in_air - - root_mass_content_of_carbon + + histogram_of_backscattering_ratio_in_air_over_height_above_reference_ellipsoid - - slow_soil_pool_mass_content_of_carbon + + effective_radius_of_convective_cloud_ice_particles - - soil_mass_content_of_carbon + + effective_radius_of_convective_cloud_rain_particles - - volume_scattering_coefficient_of_radiative_flux_in_air_due_to_dried_aerosol_particles + + effective_radius_of_convective_cloud_snow_particles - - volume_scattering_coefficient_of_radiative_flux_in_air_due_to_ambient_aerosol_particles + + effective_radius_of_stratiform_cloud_graupel_particles - - mole_fraction_of_dichlorine_peroxide_in_air + + effective_radius_of_stratiform_cloud_ice_particles - - mole_fraction_of_methylglyoxal_in_air + + effective_radius_of_stratiform_cloud_rain_particles - - atmosphere_moles_of_carbon_tetrachloride + + mass_concentration_of_biomass_burning_dry_aerosol_particles_in_air - - floating_ice_shelf_area_fraction + + diameter_of_ambient_aerosol_particles - - carbon_mass_flux_into_litter_and_soil_due_to_anthropogenic_land_use_or_land_cover_change + + electrical_mobility_diameter_of_ambient_aerosol_particles - - product_of_eastward_wind_and_lagrangian_tendency_of_air_pressure + + lagrangian_tendency_of_atmosphere_sigma_coordinate - - product_of_northward_wind_and_lagrangian_tendency_of_air_pressure + + lagrangian_tendency_of_atmosphere_sigma_coordinate + + + + tendency_of_atmosphere_number_content_of_aerosol_particles_due_to_turbulent_deposition @@ -34383,160 +34894,88 @@ atmosphere_moles_of_halon2402 - - upwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol - - - - surface_upwelling_longwave_flux_in_air_assuming_clear_sky - - - - surface_upwelling_shortwave_flux_in_air_assuming_clear_sky - - - - downwelling_photon_flux_per_unit_wavelength_in_sea_water - - - - downwelling_photon_radiance_per_unit_wavelength_in_sea_water - - - - downwelling_photon_spherical_irradiance_per_unit_wavelength_in_sea_water - - - - downwelling_radiance_per_unit_wavelength_in_air - - - - downwelling_radiance_per_unit_wavelength_in_sea_water - - - - downwelling_radiative_flux_per_unit_wavelength_in_air - - - - downwelling_radiative_flux_per_unit_wavelength_in_sea_water - - - - downwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol - - - - downwelling_spherical_irradiance_per_unit_wavelength_in_sea_water - - - - integral_wrt_time_of_surface_downwelling_longwave_flux_in_air - - - - integral_wrt_time_of_surface_downwelling_shortwave_flux_in_air - - - - surface_downwelling_longwave_flux_in_air - - - - surface_downwelling_photon_flux_per_unit_wavelength_in_sea_water - - - - surface_downwelling_photon_radiance_per_unit_wavelength_in_sea_water - - - - surface_downwelling_photon_spherical_irradiance_per_unit_wavelength_in_sea_water - - - - surface_downwelling_radiance_per_unit_wavelength_in_sea_water + + tendency_of_atmosphere_moles_of_halon2402 - - surface_downwelling_radiative_flux_per_unit_wavelength_in_air + + atmosphere_moles_of_halon1301 - - surface_downwelling_radiative_flux_per_unit_wavelength_in_sea_water + + tendency_of_atmosphere_moles_of_halon1301 - - surface_downwelling_shortwave_flux_in_air + + atmosphere_moles_of_halon1211 - - surface_downwelling_shortwave_flux_in_air_assuming_clear_sky + + tendency_of_atmosphere_moles_of_halon1211 - - surface_downwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol + + atmosphere_moles_of_halon1202 - - surface_downwelling_spherical_irradiance_per_unit_wavelength_in_sea_water + + tendency_of_atmosphere_moles_of_halon1202 - - sea_ice_temperature_expressed_as_heat_content + + atmosphere_moles_of_cfc12 - - sea_ice_temperature_expressed_as_heat_content + + tendency_of_atmosphere_moles_of_cfc12 - - sea_water_potential_temperature_expressed_as_heat_content + + atmosphere_moles_of_cfc115 - - sea_water_potential_temperature_expressed_as_heat_content + + tendency_of_atmosphere_moles_of_cfc115 - - incoming_water_volume_transport_along_river_channel + + atmosphere_moles_of_cfc114 - - surface_upwelling_longwave_flux_in_air + + tendency_of_atmosphere_moles_of_cfc114 - - surface_upwelling_radiance_per_unit_wavelength_in_air + + atmosphere_moles_of_cfc113 - - surface_upwelling_radiance_per_unit_wavelength_in_air_emerging_from_sea_water + + tendency_of_atmosphere_moles_of_cfc113 - - surface_upwelling_radiance_per_unit_wavelength_in_air_reflected_by_sea_water + + atmosphere_moles_of_cfc11 - - stratiform_cloud_area_fraction + + moles_of_cfc11_per_unit_mass_in_sea_water - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_wet_deposition + + tendency_of_atmosphere_moles_of_cfc11 - - tendency_of_atmosphere_mass_content_of_sulfate_dry_aerosol_particles_expressed_as_sulfur_due_to_wet_deposition + + effective_radius_of_stratiform_cloud_snow_particles - - litter_mass_content_of_carbon + + tendency_of_sea_water_conservative_temperature_expressed_as_heat_content_due_to_parameterized_dianeutral_mixing - - surface_litter_mass_content_of_carbon + + tendency_of_sea_water_potential_temperature_expressed_as_heat_content_due_to_parameterized_dianeutral_mixing @@ -34603,197 +35042,237 @@ sea_water_velocity_from_direction - - integral_wrt_time_of_surface_downward_northward_stress + + atmosphere_mass_content_of_cloud_liquid_water - - integral_wrt_time_of_surface_downward_eastward_stress + + effective_radius_of_cloud_liquid_water_particles - - temperature_in_surface_snow + + effective_radius_of_convective_cloud_liquid_water_particles - - thermal_energy_content_of_surface_snow + + effective_radius_of_convective_cloud_liquid_water_particles_at_convective_liquid_water_cloud_top - - surface_snow_thickness + + effective_radius_of_stratiform_cloud_liquid_water_particles - - liquid_water_content_of_surface_snow + + effective_radius_of_stratiform_cloud_liquid_water_particles_at_stratiform_liquid_water_cloud_top - - soot_content_of_surface_snow + + number_concentration_of_convective_cloud_liquid_water_particles_at_convective_liquid_water_cloud_top - - backscattering_ratio_in_air + + number_concentration_of_stratiform_cloud_liquid_water_particles_at_stratiform_liquid_water_cloud_top - - histogram_of_backscattering_ratio_in_air_over_height_above_reference_ellipsoid + + air_equivalent_potential_temperature - - effective_radius_of_convective_cloud_ice_particles + + mass_content_of_cloud_liquid_water_in_atmosphere_layer - - effective_radius_of_convective_cloud_rain_particles + + air_pseudo_equivalent_temperature - - effective_radius_of_convective_cloud_snow_particles + + air_equivalent_temperature - - effective_radius_of_stratiform_cloud_graupel_particles + + effective_radius_of_cloud_liquid_water_particles_at_liquid_water_cloud_top - - effective_radius_of_stratiform_cloud_ice_particles + + atmosphere_mass_content_of_convective_cloud_liquid_water - - effective_radius_of_stratiform_cloud_rain_particles + + tendency_of_mass_fraction_of_stratiform_cloud_ice_in_air_due_to_riming_from_cloud_liquid_water - - mass_concentration_of_biomass_burning_dry_aerosol_particles_in_air + + tendency_of_mass_fraction_of_stratiform_cloud_ice_in_air_due_to_heterogeneous_nucleation_from_cloud_liquid_water - - diameter_of_ambient_aerosol_particles + + tendency_of_mass_fraction_of_stratiform_cloud_ice_in_air_due_to_melting_to_cloud_liquid_water - - electrical_mobility_diameter_of_ambient_aerosol_particles + + air_pseudo_equivalent_potential_temperature - - lagrangian_tendency_of_atmosphere_sigma_coordinate + + growth_limitation_of_diazotrophic_phytoplankton_due_to_solar_irradiance - - lagrangian_tendency_of_atmosphere_sigma_coordinate + + iron_growth_limitation_of_diazotrophic_phytoplankton - - tendency_of_atmosphere_number_content_of_aerosol_particles_due_to_turbulent_deposition + + mass_concentration_of_diazotrophic_phytoplankton_expressed_as_chlorophyll_in_sea_water - - biological_taxon_lsid + + mole_concentration_of_diazotrophic_phytoplankton_expressed_as_carbon_in_sea_water - - temperature_in_ground + + net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_diazotrophic_phytoplankton - - tendency_of_atmosphere_moles_of_halon2402 + + net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_diazotrophic_phytoplankton - - tendency_of_atmosphere_moles_of_cfc12 + + nitrogen_growth_limitation_of_diazotrophic_phytoplankton - - atmosphere_moles_of_cfc115 + + tendency_of_mole_concentration_of_particulate_organic_matter_expressed_as_carbon_in_sea_water_due_to_net_primary_production_by_diazotrophic_phytoplankton - - tendency_of_atmosphere_moles_of_cfc115 + + mass_fraction_of_liquid_precipitation_in_air - - atmosphere_moles_of_cfc114 + + mass_fraction_of_liquid_precipitation_in_air - - tendency_of_atmosphere_moles_of_cfc114 + + area_type - - atmosphere_moles_of_cfc113 + + area_type - - tendency_of_atmosphere_moles_of_cfc113 + + upward_derivative_of_eastward_wind - - atmosphere_moles_of_cfc11 + + upward_derivative_of_northward_wind - - moles_of_cfc11_per_unit_mass_in_sea_water + + atmosphere_upward_absolute_vorticity - - tendency_of_atmosphere_moles_of_cfc11 + + atmosphere_upward_relative_vorticity - - effective_radius_of_stratiform_cloud_snow_particles + + surface_snow_density - - water_vapor_partial_pressure_in_air + + tendency_of_atmosphere_mass_content_of_water_vapor_due_to_sublimation_of_surface_snow_and_ice - - platform_name + + integral_wrt_time_of_surface_downward_northward_stress - - surface_upwelling_radiance_per_unit_wavelength_in_sea_water + + integral_wrt_time_of_surface_downward_eastward_stress - - surface_upwelling_radiative_flux_per_unit_wavelength_in_air + + temperature_in_surface_snow - - surface_upwelling_radiative_flux_per_unit_wavelength_in_sea_water + + thermal_energy_content_of_surface_snow - - surface_upwelling_shortwave_flux_in_air + + surface_snow_thickness - - surface_upwelling_shortwave_flux_in_air_assuming_clear_sky_and_no_aerosol + + liquid_water_content_of_surface_snow - - upwelling_radiance_per_unit_wavelength_in_air + + soot_content_of_surface_snow - - upwelling_radiative_flux_per_unit_wavelength_in_air + + biological_taxon_lsid - - upwelling_radiative_flux_per_unit_wavelength_in_sea_water + + temperature_in_ground - - mole_concentration_of_diatoms_expressed_as_nitrogen_in_sea_water + + water_evapotranspiration_flux - - net_primary_mole_productivity_of_biomass_expressed_as_carbon_by_calcareous_phytoplankton + + drainage_amount_through_base_of_soil_model moles_of_particulate_inorganic_carbon_per_unit_mass_in_sea_water + + + drainage_amount_through_base_of_soil_model + + + + universal_thermal_comfort_index + + + + water_flux_into_sea_water_due_to_flux_adjustment + + + + heat_flux_into_sea_water_due_to_flux_adjustment + + + + upward_derivative_of_eastward_wind + + + + upward_derivative_of_northward_wind + + + + volume_backwards_scattering_coefficient_of_radiative_flux_in_air_due_to_dried_aerosol_particles + + + + volume_attenuated_backwards_scattering_coefficient_of_radiative_flux_in_air_assuming_no_aerosol_or_cloud + + + + volume_attenuated_backwards_scattering_coefficient_of_radiative_flux_in_air + + + + volume_absorption_coefficient_of_radiative_flux_in_air_due_to_dried_aerosol_particles + diff --git a/lib/iris/_concatenate.py b/lib/iris/_concatenate.py index 2a73fcacea..8d929c2af2 100644 --- a/lib/iris/_concatenate.py +++ b/lib/iris/_concatenate.py @@ -14,6 +14,7 @@ import iris.cube import iris.exceptions from iris.util import array_equal, guess_coord_axis +import iris.warnings # # TODO: @@ -159,7 +160,7 @@ class _DerivedCoordAndDims( Parameters ---------- coord : :class:`iris.coord.DimCoord` or :class:`iris.coord.AuxCoord` - dims: tuple + dims : tuple A tuple of the data dimension(s) spanned by the coordinate. aux_factory : :class:`iris.aux_factory.AuxCoordFactory` @@ -195,7 +196,7 @@ def __new__(cls, ancil, dims): Parameters ---------- - ancil : :class:`iris.coord.CellMeasure` or :class:`iris.coord.AncillaryVariable`. + ancil : :class:`iris.coord.CellMeasure` or :class:`iris.coord.AncillaryVariable` dims : The dimension(s) associated with ancil. @@ -270,7 +271,6 @@ class _CoordExtent(namedtuple("CoordExtent", ["points", "bounds"])): ---------- points : :class:`_Extent` The :class:`_Extent` of the coordinate point values. - bounds : A list containing the :class:`_Extent` of the coordinate lower bound and the upper bound. Defaults to None if no associated @@ -296,7 +296,7 @@ def concatenate( cubes : iterable of :class:`iris.cube.Cube` An iterable containing one or more :class:`iris.cube.Cube` instances to be concatenated together. - error_on_mismatch: bool, default=False + error_on_mismatch : bool, default=False If True, raise an informative :class:`~iris.exceptions.ContatenateError` if registration fails. check_aux_coords : bool, default=True @@ -490,7 +490,7 @@ def _coordinate_differences(self, other, attr, reason="metadata"): between `self` and `other`. reason : str, default="metadata" The reason to give for mismatch (function is normally, but not - always, testing metadata) + always, testing metadata). Returns ------- @@ -762,9 +762,9 @@ def axis(self): return self._axis def concatenate(self): - """Concatenates all the source-cubes registered with the :class:`_ProtoCube`. + """Concatenate all the source-cubes registered with the :class:`_ProtoCube`. - Concatenates all the source-cubes registered with the + Concatenate all the source-cubes registered with the :class:`_ProtoCube` over the nominated common dimension. Returns @@ -911,7 +911,7 @@ def register( raise iris.exceptions.ConcatenateError([msg]) elif not match: msg = f"Found cubes with overlap on concatenate axis {candidate_axis}, skipping concatenation for these cubes" - warnings.warn(msg, category=iris.exceptions.IrisUserWarning) + warnings.warn(msg, category=iris.warnings.IrisUserWarning) # Check for compatible AuxCoords. if match: diff --git a/lib/iris/_constraints.py b/lib/iris/_constraints.py index 4c993885a8..b8f4665b46 100644 --- a/lib/iris/_constraints.py +++ b/lib/iris/_constraints.py @@ -282,9 +282,9 @@ def __init__(self, coord_name, coord_thing): Parameters ---------- coord_name : str - The name of the coordinate to constrain + The name of the coordinate to constrain. coord_thing : - The object to compare + The object to compare. """ self.coord_name = coord_name @@ -492,9 +492,9 @@ def list_of_constraints(constraints): def as_constraint(thing): - """Casts an object into a cube constraint where possible. + """Cast an object into a cube constraint where possible. - Casts an object into a cube constraint where possible, otherwise + Cast an object into a cube constraint where possible, otherwise a TypeError will be raised. If the given object is already a valid constraint then the given object diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index 15dfbd0030..dbd122ba04 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -171,7 +171,7 @@ def _deepcopy(self, memo, data=None): @property def data(self): - """Returns the real data. Any lazy data being managed will be realised. + """Return the real data. Any lazy data being managed will be realised. Returns ------- diff --git a/lib/iris/_lazy_data.py b/lib/iris/_lazy_data.py index 36c0825ad8..40984248d1 100644 --- a/lib/iris/_lazy_data.py +++ b/lib/iris/_lazy_data.py @@ -338,7 +338,7 @@ def as_concrete_data(data): Parameters ---------- data : - A dask array, NumPy `ndarray` or masked array + A dask array, NumPy `ndarray` or masked array. Returns ------- @@ -450,10 +450,11 @@ def lazy_elementwise(lazy_array, elementwise_op): return da.map_blocks(elementwise_op, lazy_array, dtype=dtype) -def map_complete_blocks(src, func, dims, out_sizes): +def map_complete_blocks(src, func, dims, out_sizes, *args, **kwargs): """Apply a function to complete blocks. Complete means that the data is not chunked along the chosen dimensions. + Uses :func:`dask.array.map_blocks` to implement the mapping. Parameters ---------- @@ -465,27 +466,47 @@ def map_complete_blocks(src, func, dims, out_sizes): Dimensions that cannot be chunked. out_sizes : tuple of int Output size of dimensions that cannot be chunked. + *args : tuple + Additional arguments to pass to `func`. + **kwargs : dict + Additional keyword arguments to pass to `func`. + + Returns + ------- + Array-like + + See Also + -------- + :func:`dask.array.map_blocks` : The function used for the mapping. """ + data = None + result = None + if is_lazy_data(src): data = src elif not hasattr(src, "has_lazy_data"): # Not a lazy array and not a cube. So treat as ordinary numpy array. - return func(src) + result = func(src, *args, **kwargs) elif not src.has_lazy_data(): - return func(src.data) + result = func(src.data, *args, **kwargs) else: data = src.lazy_data() - # Ensure dims are not chunked - in_chunks = list(data.chunks) - for dim in dims: - in_chunks[dim] = src.shape[dim] - data = data.rechunk(in_chunks) + if result is None and data is not None: + # Ensure dims are not chunked + in_chunks = list(data.chunks) + for dim in dims: + in_chunks[dim] = src.shape[dim] + data = data.rechunk(in_chunks) - # Determine output chunks - out_chunks = list(data.chunks) - for dim, size in zip(dims, out_sizes): - out_chunks[dim] = size + # Determine output chunks + out_chunks = list(data.chunks) + for dim, size in zip(dims, out_sizes): + out_chunks[dim] = size - return data.map_blocks(func, chunks=out_chunks, dtype=src.dtype) + result = data.map_blocks( + func, *args, chunks=out_chunks, dtype=src.dtype, **kwargs + ) + + return result diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index 85012c0ef8..8d1a0f052a 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -877,7 +877,7 @@ def _build_separable_group( dependency on any other candidate dimensions within the space. group : A set of related (chained) inseparable candidate dimensions. - separable_consistent_groups: + separable_consistent_groups : A list of candidate dimension groups that are consistently separable. positions : A list containing a dictionary of candidate dimension key to @@ -1047,7 +1047,7 @@ def derive_space(groups, relation_matrix, positions, function_matrix=None): ---------- groups : A list of all related (chained) inseparable candidate dimensions. - relation_matrix: + relation_matrix : The relation dictionary for each candidate dimension. positions : A list containing a dictionary of candidate dimension key to @@ -1294,7 +1294,7 @@ def register(self, cube, error_on_mismatch=False): cube : Candidate :class:`iris.cube.Cube` to be associated with this :class:`ProtoCube`. - error_on_mismatch :bool, default=False + error_on_mismatch : bool, default=False If True, raise an informative :class:`~iris.exceptions.MergeError` if registration fails. @@ -1335,7 +1335,8 @@ def _guess_axis(self, name): Returns ------- - axis : {'T', 'Z', 'Y', 'X'} or None. + str or None + {'T', 'Z', 'Y', 'X'} or None. """ axis = None diff --git a/lib/iris/_representation/cube_printout.py b/lib/iris/_representation/cube_printout.py index 3c418bde64..1e648b25f6 100644 --- a/lib/iris/_representation/cube_printout.py +++ b/lib/iris/_representation/cube_printout.py @@ -3,6 +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. """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 64a6aadbf3..2b0658d4a7 100644 --- a/lib/iris/_representation/cube_summary.py +++ b/lib/iris/_representation/cube_summary.py @@ -3,6 +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. """Provides objects describing cube summaries.""" + import re from iris.common.metadata import hexdigest diff --git a/lib/iris/_shapefiles.py b/lib/iris/_shapefiles.py index 6213128cf6..74b24b6627 100644 --- a/lib/iris/_shapefiles.py +++ b/lib/iris/_shapefiles.py @@ -17,7 +17,7 @@ import shapely.geometry as sgeom import shapely.ops -from iris.exceptions import IrisDefaultingWarning, IrisUserWarning +from iris.warnings import IrisDefaultingWarning, IrisUserWarning def create_shapefile_mask( @@ -35,20 +35,20 @@ def create_shapefile_mask( ---------- geometry : :class:`shapely.Geometry` cube : :class:`iris.cube.Cube` - A :class:`~iris.cube.Cube` which has 1d x and y coordinates + A :class:`~iris.cube.Cube` which has 1d x and y coordinates. minimum_weight : float, default 0.0 A float between 0 and 1 determining what % of a cell a shape must cover for the cell to remain unmasked. eg: 0.1 means that at least 10% of the shape overlaps the cell to be unmasked. Requires geometry to be a Polygon or MultiPolygon - Defaults to 0.0 (eg only test intersection) + Defaults to 0.0 (eg only test intersection). Returns ------- :class:`np.array` An array of the shape of the x & y coordinates of the cube, with points - to mask equal to True + to mask equal to True. """ from iris.cube import Cube, CubeList @@ -121,19 +121,19 @@ def _transform_coord_system(geometry, cube, geometry_system=None): Parameters ---------- - geometry: :class:`shapely.Geometry` - cube: :class:`iris.cube.Cube` + geometry : :class:`shapely.Geometry` + cube : :class:`iris.cube.Cube` :class:`~iris.cube.Cube` with the coord_system to be projected to and - a x coordinate - geometry_system: :class:`iris.coord_systems`, optional + a x coordinate. + geometry_system : :class:`iris.coord_systems`, optional A :class:`~iris.coord_systems` object describing the coord_system of the shapefile. Defaults to None, - which is treated as GeogCS + which is treated as GeogCS. Returns ------- :class:`shapely.Geometry` - A transformed copy of the provided :class:`shapely.Geometry` + A transformed copy of the provided :class:`shapely.Geometry`. """ y_name, x_name = _cube_primary_xy_coord_names(cube) @@ -196,7 +196,7 @@ def _cube_primary_xy_coord_names(cube): Returns ------- tuple of str - The names of the primary latitude and longitude coordinates + The names of the primary latitude and longitude coordinates. """ latc = ( @@ -225,12 +225,12 @@ def _get_mod_rebased_coord_bounds(coord): Parameters ---------- coord : :class:`iris.coords.Coord` - An Iris coordinate with a modulus + An Iris coordinate with a modulus. Returns ------- :class:`np.array` - A 1d Numpy array of [start,end] pairs for bounds of the coord + A 1d Numpy array of [start,end] pairs for bounds of the coord. """ modulus = coord.units.modulus diff --git a/lib/iris/analysis/__init__.py b/lib/iris/analysis/__init__.py index 773e804a14..6678237c1c 100644 --- a/lib/iris/analysis/__init__.py +++ b/lib/iris/analysis/__init__.py @@ -203,7 +203,7 @@ def _dimensional_metadata_comparison(*cubes, object_get=None): Convenience function to help compare coordinates, cell-measures or ancillary-variables, on one or more cubes, by their metadata. - .. Note:: + .. note:: Up to Iris 2.x, this _used_ to be the public API method "iris.analysis.coord_comparison". @@ -217,70 +217,72 @@ def _dimensional_metadata_comparison(*cubes, object_get=None): Parameters ---------- cubes : iterable of `iris.cube.Cube` - a set of cubes whose coordinates, cell-measures or ancillary-variables are to + A set of cubes whose coordinates, cell-measures or ancillary-variables are to be compared. object_get : callable(cube) or None, optional If not None, this must be a cube method returning a list of all cube elements of the required type, i.e. one of `iris.cube.Cube.coords`, `iris.cube.Cube.cell_measures`, or `iris.cube.Cube.ancillary_variables`. - If not specified, defaults to `iris.cube.Cube.coords` + If not specified, defaults to `iris.cube.Cube.coords`. Returns ------- - result : dict mapping str, list of _CoordGroup + (dict mapping str, list of _CoordGroup) A dictionary whose keys are match categories and values are groups of coordinates, cell-measures or ancillary-variables. - The values of the returned dictionary are lists of _CoordGroup representing - grouped coordinates. Each _CoordGroup contains all the input 'cubes', and a - matching list of the coord within each cube that matches some specific CoordDefn - (or maybe None). - - The keys of the returned dictionary are strings naming 'categories' : Each - represents a statement, - "Given these cubes list the coordinates which, - when grouped by metadata, are/have..." - - Returned Keys: - - * **grouped_coords**. - A list of coordinate groups of all the coordinates grouped together - by their coordinate definition - * **ungroupable**. - A list of coordinate groups which contain at least one None, - meaning not all Cubes provide an equivalent coordinate - * **not_equal**. - A list of coordinate groups of which not all are equal - (superset of ungroupable) - * **no_data_dimension**> - A list of coordinate groups of which all have no data dimensions on - their respective cubes - * **scalar**> - A list of coordinate groups of which all have shape (1, ) - * **non_equal_data_dimension**. - A list of coordinate groups of which not all have the same - data dimension on their respective cubes - * **non_equal_shape**. - A list of coordinate groups of which not all have the same shape - * **equal_data_dimension**. - A list of coordinate groups of which all have the same data dimension - on their respective cubes - * **equal**. - A list of coordinate groups of which all are equal - * **ungroupable_and_dimensioned**. - A list of coordinate groups of which not all cubes had an equivalent - (in metadata) coordinate which also describe a data dimension - * **dimensioned**. - A list of coordinate groups of which all describe a data dimension on - their respective cubes - * **ignorable**. - A list of scalar, ungroupable non_equal coordinate groups - * **resamplable**. - A list of equal, different data dimensioned coordinate groups - * **transposable**. - A list of non equal, same data dimensioned, non scalar coordinate groups - - Example usage:: + The values of the returned dictionary are lists of _CoordGroup representing + grouped coordinates. Each _CoordGroup contains all the input 'cubes', and a + matching list of the coord within each cube that matches some specific CoordDefn + (or maybe None). + + The keys of the returned dictionary are strings naming 'categories' : Each + represents a statement, + "Given these cubes list the coordinates which, + when grouped by metadata, are/have..." + + Returned Keys: + + * **grouped_coords**. + A list of coordinate groups of all the coordinates grouped together + by their coordinate definition + * **ungroupable**. + A list of coordinate groups which contain at least one None, + meaning not all Cubes provide an equivalent coordinate + * **not_equal**. + A list of coordinate groups of which not all are equal + (superset of ungroupable) + * **no_data_dimension**> + A list of coordinate groups of which all have no data dimensions on + their respective cubes + * **scalar**> + A list of coordinate groups of which all have shape (1, ) + * **non_equal_data_dimension**. + A list of coordinate groups of which not all have the same + data dimension on their respective cubes + * **non_equal_shape**. + A list of coordinate groups of which not all have the same shape + * **equal_data_dimension**. + A list of coordinate groups of which all have the same data dimension + on their respective cubes + * **equal**. + A list of coordinate groups of which all are equal + * **ungroupable_and_dimensioned**. + A list of coordinate groups of which not all cubes had an equivalent + (in metadata) coordinate which also describe a data dimension + * **dimensioned**. + A list of coordinate groups of which all describe a data dimension on + their respective cubes + * **ignorable**. + A list of scalar, ungroupable non_equal coordinate groups + * **resamplable**. + A list of equal, different data dimensioned coordinate groups + * **transposable**. + A list of non equal, same data dimensioned, non scalar coordinate groups + + Examples + -------- + :: result = _dimensional_metadata_comparison(cube1, cube2) print('All equal coordinates: ', result['equal']) @@ -607,14 +609,16 @@ def update_metadata(self, cube, coords, **kwargs): else: # new style (preferred) cube.units = self.units_func(cube.units, **kwargs) - def post_process(self, collapsed_cube, data_result, coords, **kwargs): + def post_process( + self, collapsed_cube, data_result, coords, **kwargs + ): # numpydoc ignore=SS05 """Process the result from :func:`iris.analysis.Aggregator.aggregate`. Parameters ---------- - collapsed_cube: :class:`iris.cube.Cube`. + collapsed_cube : :class:`iris.cube.Cube` data_result : - Result from :func:`iris.analysis.Aggregator.aggregate` + Result from :func:`iris.analysis.Aggregator.aggregate`. coords : The one or more coordinates that were aggregated over. **kwargs : dict, optional @@ -779,14 +783,16 @@ def lazy_aggregate(self, data, axis, **kwargs): """ return self._base_aggregate(data, axis, lazy=True, **kwargs) - def post_process(self, collapsed_cube, data_result, coords, **kwargs): + def post_process( + self, collapsed_cube, data_result, coords, **kwargs + ): # numpydoc ignore=SS05 """Process the result from :func:`iris.analysis.Aggregator.aggregate`. Parameters ---------- collapsed_cube : :class:`iris.cube.Cube` data_result : - Result from :func:`iris.analysis.Aggregator.aggregate` + Result from :func:`iris.analysis.Aggregator.aggregate`. coords : The one or more coordinates that were aggregated over. **kwargs : dict, optional @@ -945,7 +951,9 @@ def __init__(self, units_func=None, lazy_func=None, **kwargs): #: A list of keywords associated with weighted behaviour. self._weighting_keywords = ["returned", "weights"] - def post_process(self, collapsed_cube, data_result, coords, **kwargs): + def post_process( + self, collapsed_cube, data_result, coords, **kwargs + ): # numpydoc ignore=SS05 """Process the result from :func:`iris.analysis.Aggregator.aggregate`. Returns a tuple(cube, weights) if a tuple(data, weights) was returned @@ -955,7 +963,7 @@ def post_process(self, collapsed_cube, data_result, coords, **kwargs): ---------- collapsed_cube : :class:`iris.cube.Cube` data_result : - Result from :func:`iris.analysis.Aggregator.aggregate` + Result from :func:`iris.analysis.Aggregator.aggregate`. coords : The one or more coordinates that were aggregated over. **kwargs : dict, optional @@ -1101,7 +1109,9 @@ def uses_weighting(self, **kwargs): break return result - def post_process(self, collapsed_cube, data_result, coords, **kwargs): + def post_process( + self, collapsed_cube, data_result, coords, **kwargs + ): # numpydoc ignore=SS05 """Process the result from :func:`iris.analysis.Aggregator.aggregate`. Returns a tuple(cube, weights) if a tuple(data, weights) was returned @@ -1111,7 +1121,7 @@ def post_process(self, collapsed_cube, data_result, coords, **kwargs): ---------- collapsed_cube : :class:`iris.cube.Cube` data_result : - Result from :func:`iris.analysis.Aggregator.aggregate` + Result from :func:`iris.analysis.Aggregator.aggregate`. coords : The one or more coordinates that were aggregated over. **kwargs : dict, optional @@ -1363,14 +1373,14 @@ def _percentile(data, percent, fast_percentile_method=False, **kwargs): Parameters ---------- - dataM : array-like - array from which percentiles are to be calculated - fast_percentile_method: bool, optional + data : array-like + Array from which percentiles are to be calculated. + fast_percentile_method : bool, optional When set to True, uses the numpy.percentiles method as a faster alternative to the scipy.mstats.mquantiles method. Does not handle masked arrays. **kwargs : dict, optional - passed to scipy.stats.mstats.mquantiles if fast_percentile_method is + Passed to scipy.stats.mstats.mquantiles if fast_percentile_method is False. Otherwise passed to numpy.percentile. """ @@ -1378,18 +1388,16 @@ def _percentile(data, percent, fast_percentile_method=False, **kwargs): percent = [percent] percent = np.array(percent) - # Perform the percentile calculation. - _partial_percentile = functools.partial( + result = iris._lazy_data.map_complete_blocks( + data, _calc_percentile, + (-1,), + percent.shape, percent=percent, fast_percentile_method=fast_percentile_method, **kwargs, ) - result = iris._lazy_data.map_complete_blocks( - data, _partial_percentile, (-1,), percent.shape - ) - # Check whether to reduce to a scalar result, as per the behaviour # of other aggregators. if result.shape == (1,): @@ -1406,20 +1414,20 @@ def _weighted_quantile_1D(data, weights, quantiles, **kwargs): Parameters ---------- data : array - One dimensional data array - weights: array + One dimensional data array. + weights : array Array of the same size of `data`. If data is masked, weights must have matching mask. quantiles : float or sequence of floats Quantile(s) to compute. Must have a value between 0 and 1. **kwargs : dict, optional - passed to `scipy.interpolate.interp1d` + Passed to `scipy.interpolate.interp1d`. Returns ------- array or float. Calculated quantile values (set to np.nan wherever sum - of weights is zero or masked) + of weights is zero or masked). """ # Return np.nan if no usable points found if np.isclose(weights.sum(), 0.0) or ma.is_masked(weights.sum()): @@ -1457,9 +1465,9 @@ def _weighted_percentile(data, axis, weights, percent, returned=False, **kwargs) ---------- data : ndarray or masked array axis : int - axis to calculate percentiles over + Axis to calculate percentiles over. weights : ndarray - array with the weights. Must have same shape as data + Array with the weights. Must have same shape as data. percent : float or sequence of floats Percentile rank/s at which to extract value/s. returned : bool, default=False @@ -2641,7 +2649,7 @@ def interpolator(self, cube, coords): Returns ------- A callable with the interface: ``callable(sample_points, collapse_scalar=True)`` - where `sample_points` is a sequence containing an array of values + Where `sample_points` is a sequence containing an array of values for each of the coordinates passed to this method, and ``collapse_scalar`` determines whether to remove length one dimensions in the result cube caused by scalar values in @@ -2690,7 +2698,7 @@ def regridder(self, src_grid, target_grid): Returns ------- A callable with the interface ``callable(cube)`` - where `cube` is a cube with the same grid as ``src_grid`` + Where `cube` is a cube with the same grid as ``src_grid`` that is to be regridded to the ``target_grid``. """ @@ -2770,7 +2778,7 @@ def regridder(self, src_grid_cube, target_grid_cube): Returns ------- A callable with the interface `callable(cube)` - where `cube` is a cube with the same grid as `src_grid_cube` + Where `cube` is a cube with the same grid as `src_grid_cube` that is to be regridded to the grid of `target_grid_cube`. """ @@ -2917,7 +2925,7 @@ class UnstructuredNearest: must be. Otherwise, the corresponding X and Y coordinates must have the same units in the source and grid cubes. - .. Note:: + .. note:: Currently only supports regridding, not interpolation. """ @@ -2972,7 +2980,7 @@ def regridder(self, src_cube, target_grid): Returns ------- A callable with the interface `callable(cube)` - where `cube` is a cube with the same grid as `src_cube` + Where `cube` is a cube with the same grid as `src_cube` that is to be regridded to the `target_grid`. """ diff --git a/lib/iris/analysis/_area_weighted.py b/lib/iris/analysis/_area_weighted.py index 263f83838c..a25a21bb47 100644 --- a/lib/iris/analysis/_area_weighted.py +++ b/lib/iris/analysis/_area_weighted.py @@ -39,7 +39,7 @@ def __init__(self, src_grid_cube, target_grid_cube, mdtol=1): Notes ----- - .. Note:: + .. note:: Both source and target cubes must have an XY grid defined by separate X and Y dimensions with dimension coordinates. @@ -392,9 +392,11 @@ def _regrid_area_weighted_rectilinear_src_and_grid__perform( tgt_shape = (len(grid_y.points), len(grid_x.points)) - # Calculate new data array for regridded cube. - regrid = functools.partial( + new_data = map_complete_blocks( + src_cube, _regrid_along_dims, + (src_y_dim, src_x_dim), + meshgrid_x.shape, x_dim=src_x_dim, y_dim=src_y_dim, weights=weights, @@ -402,10 +404,6 @@ def _regrid_area_weighted_rectilinear_src_and_grid__perform( mdtol=mdtol, ) - new_data = map_complete_blocks( - src_cube, regrid, (src_y_dim, src_x_dim), meshgrid_x.shape - ) - # Wrap up the data as a Cube. _regrid_callback = functools.partial( diff --git a/lib/iris/analysis/_grid_angles.py b/lib/iris/analysis/_grid_angles.py index 8712dd9ad1..80b73d81d7 100644 --- a/lib/iris/analysis/_grid_angles.py +++ b/lib/iris/analysis/_grid_angles.py @@ -21,13 +21,13 @@ def _3d_xyz_from_latlon(lon, lat): Parameters ---------- - lon, lat: float array + lon, lat : float array Arrays of longitudes and latitudes, in degrees. Both the same shape. Returns ------- - xyz : array, dtype=float64 + array of dtype=float64 Cartesian coordinates on a unit sphere. Shape is (3, ). The x / y / z coordinates are in xyz[0 / 1 / 2]. @@ -53,12 +53,12 @@ def _latlon_from_xyz(xyz): xyz : array Array of 3-D cartesian coordinates. Shape (3, ). - x / y / z values are in xyz[0 / 1 / 2], + x / y / z values are in xyz[0 / 1 / 2]. Returns ------- - lonlat : array - longitude and latitude position angles, in degrees. + np.array + Longitude and latitude position angles, in degrees. Shape (2, ). The longitudes / latitudes are in lonlat[0 / 1]. @@ -114,7 +114,7 @@ def _angle(p, q, r): Returns ------- - angle : float array + float array Grid angles relative to true-East, in degrees. Positive when grid-East is anticlockwise from true-East. Shape is same as . @@ -156,7 +156,7 @@ def gridcell_angles(x, y=None, cell_angle_boundpoints="mid-lhs, mid-rhs"): Parameters ---------- x : :class:`~iris.cube.Cube` - a grid cube with 2D X and Y coordinates, identified by 'axis'. + A grid cube with 2D X and Y coordinates, identified by 'axis'. The coordinates must be 2-dimensional with the same shape. The two dimensions represent grid dimensions in the order Y, then X. x, y : :class:`~iris.coords.Coord` @@ -166,10 +166,10 @@ def gridcell_angles(x, y=None, cell_angle_boundpoints="mid-lhs, mid-rhs"): If there is no coordinate system, they are assumed to be true longitudes and latitudes. Units must convertible to 'degrees'. x, y : 2-dimensional arrays of same shape (ny, nx) - longitude and latitude cell center locations, in degrees. + Longitude and latitude cell center locations, in degrees. The two dimensions represent grid dimensions in the order Y, then X. x, y : 3-dimensional arrays of same shape (ny, nx, 4) - longitude and latitude cell bounds, in degrees. + Longitude and latitude cell bounds, in degrees. The first two dimensions are grid dimensions in the order Y, then X. The last index maps cell corners anticlockwise from bottom-left. cell_angle_boundpoints : str, default="mid-lhs, mid-rhs" @@ -182,7 +182,7 @@ def gridcell_angles(x, y=None, cell_angle_boundpoints="mid-lhs, mid-rhs"): Returns ------- - angles : 2-dimensional cube + 2-dimensional cube Cube of angles of grid-x vector from true Eastward direction for each gridcell, in degrees. It also has "true" longitude and latitude coordinates, with no @@ -412,7 +412,7 @@ def rotate_grid_vectors(u_cube, v_cube, grid_angles_cube=None, grid_angles_kwarg Cubes of grid-u and grid-v vector components. Units should be differentials of true-distance, e.g. 'm/s'. grid_angles_cube : cube, optional - gridcell orientation angles. + Gridcell orientation angles. Units must be angular, i.e. can be converted to 'radians'. If not provided, grid angles are estimated from 'u_cube' using the :func:`gridcell_angles` method. @@ -422,20 +422,16 @@ def rotate_grid_vectors(u_cube, v_cube, grid_angles_cube=None, grid_angles_kwarg Returns ------- - true_u, true_v : cube - Cubes of true-north oriented vector components. + (cube, cube) + Tuple of cubes of true-north oriented vector components. Units are same as inputs. Notes ----- - .. note:: - - Vector magnitudes will always be the same as the inputs. - - .. note:: + Vector magnitudes will always be the same as the inputs. - This function does not maintain laziness when called; it realises data. - See more at :doc:`/userguide/real_and_lazy_data`. + This function does not maintain laziness when called; it realises data. + See more at :doc:`/userguide/real_and_lazy_data`. """ u_out, v_out = (cube.copy() for cube in (u_cube, v_cube)) diff --git a/lib/iris/analysis/_interpolation.py b/lib/iris/analysis/_interpolation.py index babc414ee4..6904c5ae4f 100644 --- a/lib/iris/analysis/_interpolation.py +++ b/lib/iris/analysis/_interpolation.py @@ -180,7 +180,7 @@ def __init__(self, src_cube, coords, method, extrapolation_mode): The :class:`iris.cube.Cube` which is to be interpolated. coords : The names or coordinate instances which are to be - interpolated over + interpolated over. method : Either 'linear' or 'nearest'. extrapolation_mode : str @@ -477,7 +477,7 @@ def _points(self, sample_points, data, data_dims=None): sample_points : A list of N iterables, where N is the number of coordinates passed to the constructor. - [sample_values_for_coord_0, sample_values_for_coord_1, ...] + [sample_values_for_coord_0, sample_values_for_coord_1, ...]. data : The data to interpolate - not necessarily the data from the cube that was used to construct this interpolator. If the data has @@ -573,7 +573,7 @@ def __call__(self, sample_points, collapse_scalar=True): sample_points : A list of N iterables, where N is the number of coordinates passed to the constructor. - [sample_values_for_coord_0, sample_values_for_coord_1, ...] + [sample_values_for_coord_0, sample_values_for_coord_1, ...]. collapse_scalar : bool, default=True Whether to collapse the dimension of the scalar sample points in the resulting cube. Default is True. diff --git a/lib/iris/analysis/_regrid.py b/lib/iris/analysis/_regrid.py index 4a8ba0bb67..6c10b8c404 100644 --- a/lib/iris/analysis/_regrid.py +++ b/lib/iris/analysis/_regrid.py @@ -19,8 +19,8 @@ snapshot_grid, ) from iris.analysis._scipy_interpolate import _RegularGridInterpolator -from iris.exceptions import IrisImpossibleUpdateWarning from iris.util import _meshgrid, guess_coord_axis +from iris.warnings import IrisImpossibleUpdateWarning def _transform_xy_arrays(crs_from, x, y, crs_to): @@ -30,14 +30,17 @@ def _transform_xy_arrays(crs_from, x, y, crs_to): Parameters ---------- - crs_from, crs_to : :class:`cartopy.crs.Projection` + crs_from : :class:`cartopy.crs.Projection` The coordinate reference systems. x, y : arrays - point locations defined in 'crs_from'. + Point locations defined in 'crs_from'. + crs_to : :class:`cartopy.crs.Projection` + The coordinate reference systems. Returns ------- - x, y : Arrays of locations defined in 'crs_to'. + (array, array) + Arrays of locations defined in 'crs_to' of (x, y). """ pts = crs_to.transform_points(crs_from, x, y) @@ -636,7 +639,7 @@ def _regrid( A 2-dimensional array of sample X values. sample_grid_y : A 2-dimensional array of sample Y values. - method: str, default="linear" + method : str, default="linear" Either 'linear' or 'nearest'. The default method is 'linear'. extrapolation_mode : str, default="nanmask" Must be one of the following strings: @@ -932,9 +935,11 @@ def __call__(self, src): x_dim = src.coord_dims(src_x_coord)[0] y_dim = src.coord_dims(src_y_coord)[0] - # Define regrid function - regrid = functools.partial( + data = map_complete_blocks( + src, self._regrid, + (y_dim, x_dim), + sample_grid_x.shape, x_dim=x_dim, y_dim=y_dim, src_x_coord=src_x_coord, @@ -945,8 +950,6 @@ def __call__(self, src): extrapolation_mode=self._extrapolation_mode, ) - data = map_complete_blocks(src, regrid, (y_dim, x_dim), sample_grid_x.shape) - # Wrap up the data as a Cube. _regrid_callback = functools.partial( self._regrid, diff --git a/lib/iris/analysis/calculus.py b/lib/iris/analysis/calculus.py index 560b9b1d5c..75b7db050b 100644 --- a/lib/iris/analysis/calculus.py +++ b/lib/iris/analysis/calculus.py @@ -22,8 +22,8 @@ import iris.analysis.maths import iris.coord_systems import iris.coords -from iris.exceptions import IrisUserWarning from iris.util import delta +from iris.warnings import IrisUserWarning __all__ = ["DIRECTIONAL_NAMES", "cube_delta", "curl", "differentiate"] @@ -134,7 +134,7 @@ def cube_delta(cube, coord): Parameters ---------- coord : - either a Coord instance or the unique name of a coordinate in the cube. + Either a Coord instance or the unique name of a coordinate in the cube. If a Coord instance is provided, it does not necessarily have to exist in the cube. @@ -423,7 +423,7 @@ def _coord_sin(coord): Parameters ---------- coord : - Coord instance with values in either degrees or radians + Coord instance with values in either degrees or radians. """ return _trig_method(coord, np.sin) @@ -435,7 +435,7 @@ def _coord_cos(coord): Parameters ---------- coord : - Coord instance with values in either degrees or radians + Coord instance with values in either degrees or radians. """ return _trig_method(coord, np.cos) @@ -447,9 +447,9 @@ def _trig_method(coord, trig_function): Parameters ---------- coord : - Coord instance with points values in either degrees or radians + Coord instance with points values in either degrees or radians. trig_function : - Reference to a trigonometric function e.g. numpy.sin + Reference to a trigonometric function e.g. numpy.sin. """ # If we are in degrees create a copy that is in radians. @@ -483,11 +483,11 @@ def curl(i_cube, j_cube, k_cube=None): Parameters ---------- i_cube : - The i cube of the vector to operate on + The i cube of the vector to operate on. j_cube : - The j cube of the vector to operate on + The j cube of the vector to operate on. k_cube : optional - The k cube of the vector to operate on + The k cube of the vector to operate on. Returns ------- diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index d57f8ce8a3..854347839d 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -19,6 +19,7 @@ import iris.coords import iris.exceptions from iris.util import _meshgrid +import iris.warnings from ._grid_angles import gridcell_angles, rotate_grid_vectors @@ -346,11 +347,11 @@ def _quadrant_area(radian_lat_bounds, radian_lon_bounds, radius_of_earth): Parameters ---------- radian_lat_bounds : - [n,2] array of latitude bounds (radians) + [n,2] array of latitude bounds (radians). radian_lon_bounds : - [n,2] array of longitude bounds (radians) + [n,2] array of longitude bounds (radians). radius_of_earth : - radius of the earth (currently assumed spherical) + Radius of the earth (currently assumed spherical). """ # ensure pairs of bounds @@ -412,7 +413,7 @@ def area_weights(cube, normalize=False): if cs.inverse_flattening != 0.0: warnings.warn( "Assuming spherical earth from ellipsoid.", - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) radius_of_earth = cs.semi_major_axis elif isinstance(cs, iris.coord_systems.RotatedGeogCS) and ( @@ -421,13 +422,13 @@ def area_weights(cube, normalize=False): if cs.ellipsoid.inverse_flattening != 0.0: warnings.warn( "Assuming spherical earth from ellipsoid.", - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) radius_of_earth = cs.ellipsoid.semi_major_axis else: warnings.warn( "Using DEFAULT_SPHERICAL_EARTH_RADIUS.", - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) radius_of_earth = DEFAULT_SPHERICAL_EARTH_RADIUS @@ -569,7 +570,7 @@ def cosine_latitude_weights(cube): ): warnings.warn( "Out of range latitude values will be clipped to the valid range.", - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) points = lat.points l_weights = np.cos(points).clip(0.0, 1.0) @@ -686,7 +687,7 @@ def project(cube, target_proj, nx=None, ny=None): warnings.warn( "Coordinate system of latitude and longitude " "coordinates is not specified. Assuming WGS84 Geodetic.", - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) orig_cs = iris.coord_systems.GeogCS( semi_major_axis=6378137.0, inverse_flattening=298.257223563 @@ -877,7 +878,7 @@ def project(cube, target_proj, nx=None, ny=None): lon_coord.name(), [coord.name() for coord in discarded_coords], ), - category=iris.exceptions.IrisIgnoringWarning, + category=iris.warnings.IrisIgnoringWarning, ) # TODO handle derived coords/aux_factories @@ -893,10 +894,12 @@ def _transform_xy(crs_from, x, y, crs_to): Parameters ---------- - crs_from, crs_to : :class:`cartopy.crs.Projection` + crs_from : :class:`cartopy.crs.Projection` The coordinate reference systems. x, y : array - point locations defined in 'crs_from'. + Point locations defined in 'crs_from'. + crs_to : :class:`cartopy.crs.Projection` + The coordinate reference systems. Returns ------- @@ -915,10 +918,13 @@ def _inter_crs_differentials(crs1, x, y, crs2): Parameters ---------- - crs1, crs2 : :class:`cartopy.crs.Projection` - The coordinate systems, "from" and "to". + crs1 : :class:`cartopy.crs.Projection` + The coordinate systems for "from". x, y : array Point locations defined in 'crs1'. + crs2 : :class:`cartopy.crs.Projection` + The coordinate systems for "to". + Returns ------- @@ -1046,7 +1052,7 @@ def _transform_distance_vectors_tolerance_mask(src_crs, x, y, tgt_crs, ds, dx2, tgt_crs : `cartopy.crs.Projection` The target coordinate reference systems. ds : `DistanceDifferential` - Distance differentials for src_crs and tgt_crs at specified locations + Distance differentials for src_crs and tgt_crs at specified locations. dx2, dy2 : `PartialDifferential` Partial differentials from src_crs to tgt_crs. diff --git a/lib/iris/analysis/geometry.py b/lib/iris/analysis/geometry.py index 271858716c..120b6dfaa6 100644 --- a/lib/iris/analysis/geometry.py +++ b/lib/iris/analysis/geometry.py @@ -15,6 +15,7 @@ from shapely.geometry import Polygon import iris.exceptions +import iris.warnings def _extract_relevant_cube_slice(cube, geometry): @@ -71,7 +72,7 @@ def _extract_relevant_cube_slice(cube, geometry): except ValueError: warnings.warn( "The geometry exceeds the cube's x dimension at the lower end.", - category=iris.exceptions.IrisGeometryExceedWarning, + category=iris.warnings.IrisGeometryExceedWarning, ) x_min_ix = 0 if x_ascending else x_coord.points.size - 1 @@ -81,7 +82,7 @@ def _extract_relevant_cube_slice(cube, geometry): except ValueError: warnings.warn( "The geometry exceeds the cube's x dimension at the upper end.", - category=iris.exceptions.IrisGeometryExceedWarning, + category=iris.warnings.IrisGeometryExceedWarning, ) x_max_ix = x_coord.points.size - 1 if x_ascending else 0 @@ -91,7 +92,7 @@ def _extract_relevant_cube_slice(cube, geometry): except ValueError: warnings.warn( "The geometry exceeds the cube's y dimension at the lower end.", - category=iris.exceptions.IrisGeometryExceedWarning, + category=iris.warnings.IrisGeometryExceedWarning, ) y_min_ix = 0 if y_ascending else y_coord.points.size - 1 @@ -101,7 +102,7 @@ def _extract_relevant_cube_slice(cube, geometry): except ValueError: warnings.warn( "The geometry exceeds the cube's y dimension at the upper end.", - category=iris.exceptions.IrisGeometryExceedWarning, + category=iris.warnings.IrisGeometryExceedWarning, ) y_max_ix = y_coord.points.size - 1 if y_ascending else 0 diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index f20972d1e5..80d3ead90c 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -23,6 +23,7 @@ import iris.coords import iris.exceptions import iris.util +import iris.warnings # Configure the logger. logger = get_logger(__name__) @@ -221,7 +222,7 @@ def add(cube, other, dim=None, in_place=False): ---------- cube : iris.cube.Cube First operand to add. - other: iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array + other : iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array Second operand to add. dim : int, optional If `other` is a coord which does not exist on the cube, specify the @@ -273,7 +274,7 @@ def subtract(cube, other, dim=None, in_place=False): ---------- cube : iris.cube.Cube Cube from which to subtract. - other: iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array + other : iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array Object to subtract from the cube. dim : int, optional If `other` is a coord which does not exist on the cube, specify the @@ -322,22 +323,22 @@ def _add_subtract_common( Parameters ---------- operation_function : - function which does the operation (e.g. numpy.subtract) + Function which does the operation (e.g. numpy.subtract). operation_name : - The public name of the operation (e.g. 'divide') + The public name of the operation (e.g. 'divide'). cube : - The cube whose data is used as the first argument to `operation_function` + The cube whose data is used as the first argument to `operation_function`. other : The cube, coord, ndarray, dask array or number whose - data is used as the second argument + data is used as the second argument. new_dtype : The expected dtype of the output. Used in the case of scalar - masked arrays + masked arrays. dim : optional Dimension along which to apply `other` if it's a coordinate that is not - found in `cube` + found in `cube`. in_place : bool, default=False - Whether or not to apply the operation in place to `cube` and `cube.data` + Whether or not to apply the operation in place to `cube` and `cube.data`. """ _assert_is_cube(cube) @@ -380,7 +381,7 @@ def multiply(cube, other, dim=None, in_place=False): ---------- cube : iris.cube.Cube First operand to multiply. - other: iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array + other : iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array Second operand to multiply. dim : int, optional If `other` is a coord which does not exist on the cube, specify the @@ -465,7 +466,7 @@ def divide(cube, other, dim=None, in_place=False): ---------- cube : iris.cube.Cube Numerator. - other: iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array + other : iris.cube.Cube, iris.coords.Coord, number, numpy.ndarray or dask.array.Array Denominator. dim : int, optional If `other` is a coord which does not exist on the cube, specify the @@ -481,6 +482,7 @@ def divide(cube, other, dim=None, in_place=False): ----- This function maintains laziness when called; it does not realise data. See more at :doc:`/userguide/real_and_lazy_data`. + """ _assert_is_cube(cube) @@ -711,7 +713,7 @@ def apply_ufunc(ufunc, cube, other=None, new_unit=None, new_name=None, in_place= :func:`numpy.mod`. cube : An instance of :class:`iris.cube.Cube`. - other ::class:`iris.cube.Cube`, optional + other : :class:`iris.cube.Cube`, optional An instance of :class:`iris.cube.Cube` to be given as the second argument to :func:`numpy.ufunc`. new_unit : optional @@ -812,25 +814,25 @@ def _binary_op_common( Parameters ---------- operation_function : - Function which does the operation (e.g. numpy.divide) + Function which does the operation (e.g. numpy.divide). operation_name : - The public name of the operation (e.g. 'divide') + The public name of the operation (e.g. 'divide'). cube : - The cube whose data is used as the first argument to `operation_function` + The cube whose data is used as the first argument to `operation_function`. other : The cube, coord, ndarray, dask array or number whose data is used - as the second argument - new_dtype : - The expected dtype of the output. Used in the case of scalar masked arrays + as the second argument. new_unit : optional - Unit for the resulting quantity + Unit for the resulting quantity. + new_dtype : + The expected dtype of the output. Used in the case of scalar masked arrays. dim : optional Dimension along which to apply `other` if it's a coordinate that is - not found in `cube` + not found in `cube`. in_place : bool, default=False - whether or not to apply the operation in place to `cube` and `cube.data` + Whether or not to apply the operation in place to `cube` and `cube.data`. sanitise_metadata : bool, default=True - Whether or not to remove metadata using _sanitise_metadata function + Whether or not to remove metadata using _sanitise_metadata function. """ from iris.cube import Cube @@ -941,7 +943,7 @@ def _broadcast_cube_coord_data(cube, other, operation_name, dim=None): warnings.warn( "Using {!r} with a bounded coordinate is not well " "defined; ignoring bounds.".format(operation_name), - category=iris.exceptions.IrisIgnoringBoundsWarning, + category=iris.warnings.IrisIgnoringBoundsWarning, ) points = other.points @@ -1168,13 +1170,13 @@ def __call__( other : optional A cube, coord, ndarray, dask array or number whose data is used as the second argument to the data function. - new_name : optional - Name for the resulting Cube. - in_place : bool, default=False - Whether to create a new Cube, or alter the given "cube". dim : optional Dimension along which to apply `other` if it's a coordinate that is - not found in `cube` + not found in `cube`. + in_place : bool, default=False + Whether to create a new Cube, or alter the given "cube". + new_name : optional + Name for the resulting Cube. **kwargs_data_func : Keyword arguments that get passed on to the data_func. diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 1dd19cd724..2111dd2504 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -490,7 +490,7 @@ def _cartesian_sample_points(sample_points, sample_point_coord_names): [coord][datum] list of sample_positions for each datum, formatted for fast use of :func:`_ll_to_cart()`. sample_point_coord_names : - [coord] list of n coord names + [coord] list of n coord names. Returns ------- @@ -544,7 +544,7 @@ def _nearest_neighbour_indices_ndcoords(cube, sample_points, cache=None): Because this function can be slow for multidimensional coordinates, a 'cache' dictionary can be provided by the calling code. - .. Note:: + .. note:: If the points are longitudes/latitudes, these are handled correctly as points on the sphere, but the values must be in 'degrees'. @@ -745,7 +745,7 @@ def __init__(self, src_cube, target_grid_cube): Notes ----- - .. Note:: + .. note:: For latitude-longitude coordinates, the nearest-neighbour distances are computed on the sphere, otherwise flat Euclidean distances are diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index 61b7c7ef46..cd59575f93 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -13,7 +13,7 @@ from iris.common import CFVariableMixin, CoordMetadata, metadata_manager_factory import iris.coords -from iris.exceptions import IrisIgnoringBoundsWarning +from iris.warnings import IrisIgnoringBoundsWarning class AuxCoordFactory(CFVariableMixin, metaclass=ABCMeta): @@ -57,7 +57,7 @@ def coord_system(self, value): @property def climatological(self): - """Always returns False, as a factory itself can never have points/bounds. + """Return False, as a factory itself can never have points/bounds. Always returns False, as a factory itself can never have points/bounds and therefore can never be climatological by definition. @@ -1787,9 +1787,9 @@ def _check_dependencies(s, c, eta, depth, depth_c): @property def dependencies(self): - """Returns a dicti mapping from constructor arg names to coordinates. + """Return a dicti mapping from constructor arg names to coordinates. - Returns a dictionary mapping from constructor argument names to + Return a dictionary mapping from constructor argument names to the corresponding coordinates. """ diff --git a/lib/iris/common/_split_attribute_dicts.py b/lib/iris/common/_split_attribute_dicts.py index 17b3014fb1..3e9c74cea9 100644 --- a/lib/iris/common/_split_attribute_dicts.py +++ b/lib/iris/common/_split_attribute_dicts.py @@ -15,6 +15,7 @@ So, we simply treat "global" and "local" attributes of the same name as entirely independent. Which happily is also the easiest to code, and to explain. """ + from collections.abc import Mapping, Sequence from functools import wraps diff --git a/lib/iris/common/metadata.py b/lib/iris/common/metadata.py index 403436496f..9b0edf6532 100644 --- a/lib/iris/common/metadata.py +++ b/lib/iris/common/metadata.py @@ -4,7 +4,6 @@ # See LICENSE in the root of the repository for full licensing details. """Provides the infrastructure to support the common metadata API.""" - from abc import ABCMeta from collections import namedtuple from collections.abc import Iterable, Mapping @@ -734,7 +733,7 @@ def token(cls, name): Parameters ---------- name : str - The string name to verify + The string name to verify. Returns ------- diff --git a/lib/iris/common/resolve.py b/lib/iris/common/resolve.py index 5a96b52a02..aaf36b36cc 100644 --- a/lib/iris/common/resolve.py +++ b/lib/iris/common/resolve.py @@ -1639,7 +1639,7 @@ def _get_prepared_item( Boolean stating whether the ``metadata`` is from the ``src`` (``True``) or ``tgt`` :class:`~iris.cube.Cube`. Defaults to ``True``. - from_local: bool, default=False + from_local : bool, default=False Boolean controlling whether the ``metadata`` is used to search the ``category_local`` (``True``) or the :attr:`~iris.common.resolve.Resolve.prepared_category`. Defaults to ``False``. diff --git a/lib/iris/config.py b/lib/iris/config.py index c617783dec..9cec602a95 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -31,7 +31,7 @@ import os.path import warnings -import iris.exceptions +import iris.warnings def get_logger(name, datefmt=None, fmt=None, level=None, propagate=None, handler=True): @@ -139,7 +139,7 @@ def get_dir_option(section, option, default=None): ) warnings.warn( msg.format(section, option, c_path), - category=iris.exceptions.IrisIgnoringWarning, + category=iris.warnings.IrisIgnoringWarning, ) return path @@ -246,7 +246,7 @@ def __setattr__(self, name, value): ) warnings.warn( wmsg.format(value, name, good_value), - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) value = good_value self.__dict__[name] = value diff --git a/lib/iris/coord_categorisation.py b/lib/iris/coord_categorisation.py index f4c3aa6cb4..7ccee4fca8 100644 --- a/lib/iris/coord_categorisation.py +++ b/lib/iris/coord_categorisation.py @@ -34,14 +34,15 @@ def add_categorised_coord(cube, name, from_coord, category_function, units="1"): cube : :class:`iris.cube.Cube` The cube containing 'from_coord'. The new coord will be added into it. name : str - name of the created coordinate + Name of the created coordinate. from_coord : :class:`iris.coords.Coord` or str - coordinate in 'cube', or the name of one + Coordinate in 'cube', or the name of one. category_function : callable - function(coordinate, value), returning a category value for a - coordinate point-value + Function(coordinate, value), returning a category value for a + coordinate point-value. units : str, default="1" - units of the category value, typically 'no_unit' or '1'. + Units of the category value, typically 'no_unit' or '1'. + """ # Interpret coord, if given as a name if isinstance(from_coord, str): @@ -91,9 +92,9 @@ def _pt_date(coord, time): Parameters ---------- coord : Coord - coordinate (must be Time-type) + Coordinate (must be Time-type). time : float - value of a coordinate point + Value of a coordinate point. Returns ------- @@ -385,7 +386,7 @@ def add_season_year( List of seasons defined by month abbreviations. Each month must appear once and only once. Defaults to standard meteorological seasons (``djf``, ``mam``, ``jja``, ``son``). - use_year_at_season_start: bool, default=False + use_year_at_season_start : bool, default=False Seasons spanning the year boundary (e.g. Winter ``djf``) will belong fully to the following year by default (e.g. the year of Jan and Feb). Set to ``True`` for spanning seasons to belong to the preceding diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index 5b4e593d83..96f39c3f4b 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -13,7 +13,7 @@ import numpy as np from iris._deprecation import warn_deprecated -import iris.exceptions +import iris.warnings def _arg_default(value, default, cast_as=float): @@ -161,9 +161,9 @@ def __init__( Axes of ellipsoid, in metres. At least one must be given (see note below). inverse_flattening : optional - Can be omitted if both axes given (see note below). Default 0.0 + Can be omitted if both axes given (see note below). Default 0.0. longitude_of_prime_meridian : optional - Specifies the prime meridian on the ellipsoid, in degrees. Default 0.0 + Specifies the prime meridian on the ellipsoid, in degrees. Default 0.0. Notes ----- @@ -357,14 +357,16 @@ def _crs(self): This property is created when required and then cached for speed. That cached value is cleared when an assignment is made to a property of the class that invalidates the cache. + """ return ccrs.Geodetic(self._globe) def _wipe_cached_properties(self): - """Wipes the cached properties on the object. + """Wipe the cached properties on the object. - Wipes the cached properties on the object as part of any update to a + Wipe the cached properties on the object as part of any update to a value that invalidates the cache. + """ try: delattr(self, "_crs") @@ -439,7 +441,7 @@ def inverse_flattening(self, value): "the GeogCS object. To change other properties set them explicitly" " or create a new GeogCS instance." ) - warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) + warnings.warn(wmsg, category=iris.warnings.IrisUserWarning) value = float(value) self._inverse_flattening = value @@ -768,7 +770,7 @@ def as_cartopy_crs(self): warnings.warn( "Discarding false_easting and false_northing that are " "not used by Cartopy.", - category=iris.exceptions.IrisDefaultingWarning, + category=iris.warnings.IrisDefaultingWarning, ) return ccrs.Orthographic( @@ -990,10 +992,10 @@ def __init__( Y offset from planar origin in metres. true_scale_lat : float, optional Latitude of true scale. - scale_factor_at_projection_origin : float, optional - Scale factor at the origin of the projection ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. + scale_factor_at_projection_origin : float, optional + Scale factor at the origin of the projection. Notes ----- @@ -1098,7 +1100,7 @@ def __init__( true_scale_lat : float, optional Latitude of true scale. scale_factor_at_projection_origin : float, optional - Scale factor at the origin of the projection + Scale factor at the origin of the projection. ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. @@ -1502,7 +1504,8 @@ class ObliqueMercator(CoordSystem): See Also -------- - :class:`RotatedMercator` + RotatedMercator : + :class:`ObliqueMercator` with ``azimuth_of_central_line=90``. """ @@ -1527,15 +1530,15 @@ def __init__( the centre line. latitude_of_projection_origin : float The true longitude of the central meridian in degrees. - longitude_of_projection_origin: float + longitude_of_projection_origin : float The true latitude of the planar origin in degrees. - false_easting: float, optional + false_easting : float, optional X offset from the planar origin in metres. Defaults to 0.0. - false_northing: float, optional + false_northing : float, optional Y offset from the planar origin in metres. Defaults to 0.0. - scale_factor_at_projection_origin: float, optional + scale_factor_at_projection_origin : float, optional Scale factor at the central meridian. Defaults to 1.0 . ellipsoid : :class:`GeogCS`, optional @@ -1615,6 +1618,8 @@ class RotatedMercator(ObliqueMercator): The Rotated Mercator projection is an Oblique Mercator projection with azimuth = +90. + Notes + ----- .. deprecated:: 3.8.0 This coordinate system was introduced as already scheduled for removal in a future release, since CF version 1.11 onwards now requires use of @@ -1639,18 +1644,18 @@ def __init__( ---------- latitude_of_projection_origin : float The true longitude of the central meridian in degrees. - longitude_of_projection_origin: float + longitude_of_projection_origin : float The true latitude of the planar origin in degrees. - false_easting: float, optional + false_easting : float, optional X offset from the planar origin in metres. Defaults to 0.0. - false_northing: float, optional + false_northing : float, optional Y offset from the planar origin in metres. Defaults to 0.0. - scale_factor_at_projection_origin: float, optional + scale_factor_at_projection_origin : float, optional Scale factor at the central meridian. Defaults to 1.0 . - ellipsoid: :class:`GeogCS`, optional + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. """ diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 8ba5e32397..e32c6b0bf0 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -32,6 +32,7 @@ import iris.exceptions import iris.time import iris.util +import iris.warnings #: The default value for ignore_axis which controls guess_coord_axis' behaviour DEFAULT_IGNORE_AXIS = False @@ -288,7 +289,7 @@ def summary( Returns ------- - result : str + str Output text, with embedded newlines when :attr:`shorten`\ =False. Notes @@ -1167,12 +1168,12 @@ def _get_2d_coord_bound_grid(bounds): Parameters ---------- bounds : array - Coordinate bounds array of shape (Y, X, 4) + Coordinate bounds array of shape (Y, X, 4). Returns ------- array - Grid of shape (Y+1, X+1) + Grid of shape (Y+1, X+1). """ # Check bds has the shape (ny, nx, 4) @@ -1951,7 +1952,7 @@ def is_contiguous(self, rtol=1e-05, atol=1e-08): contiguous = False return contiguous - def contiguous_bounds(self): + def contiguous_bounds(self): # numpydoc ignore=SS05 """Contiguous bounds of 1D coordinate. Return the N+1 bound values for a contiguous bounded 1D coordinate @@ -1977,7 +1978,7 @@ def contiguous_bounds(self): warnings.warn( "Coordinate {!r} is not bounded, guessing " "contiguous bounds.".format(self.name()), - category=iris.exceptions.IrisGuessBoundsWarning, + category=iris.warnings.IrisGuessBoundsWarning, ) bounds = self._guess_bounds() elif self.ndim == 2: @@ -2138,7 +2139,7 @@ def serialize(x): ) warnings.warn( msg.format(self.name()), - category=iris.exceptions.IrisVagueMetadataWarning, + category=iris.warnings.IrisVagueMetadataWarning, ) else: try: @@ -2151,7 +2152,7 @@ def serialize(x): ) warnings.warn( msg.format(str(exc), self.name()), - category=iris.exceptions.IrisVagueMetadataWarning, + category=iris.warnings.IrisVagueMetadataWarning, ) self.bounds = None else: @@ -2162,7 +2163,7 @@ def serialize(x): ) warnings.warn( msg.format(self.name()), - category=iris.exceptions.IrisVagueMetadataWarning, + category=iris.warnings.IrisVagueMetadataWarning, ) if self.has_bounds(): @@ -2613,7 +2614,7 @@ def __init__( #: Whether the coordinate wraps by ``coord.units.modulus``. self.circular = circular - def __deepcopy__(self, memo): + def __deepcopy__(self, memo): # numpydoc ignore=SS02 """coord.__deepcopy__() -> Deep copy of coordinate. Used if copy.deepcopy is called on a coordinate. diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 49876a023e..ca3039cb5b 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -45,6 +45,7 @@ import iris.coords import iris.exceptions import iris.util +import iris.warnings __all__ = ["Cube", "CubeAttrsDict", "CubeList"] @@ -168,14 +169,14 @@ def _repr_html_(self): def __add__(self, other): return CubeList(list.__add__(self, other)) - def __getitem__(self, keys): + def __getitem__(self, keys): # numpydoc ignore=SS02 """x.__getitem__(y) <==> x[y].""" result = super().__getitem__(keys) if isinstance(result, list): result = CubeList(result) return result - def __getslice__(self, start, stop): + def __getslice__(self, start, stop): # numpydoc ignore=SS02 """x.__getslice__(i, j) <==> x[i:j]. Use of negative indices is not supported. @@ -269,7 +270,8 @@ def extract_cube(self, constraint): See Also -------- - :meth:`~iris.cube.CubeList.extract` + iris.cube.CubeList.extract : + Filter each of the cubes which can be filtered by the given constraints. """ # Just validate this, so we can accept strings etc, but not multiples. @@ -292,7 +294,8 @@ def extract_cubes(self, constraints): See Also -------- - :meth:`~iris.cube.CubeList.extract` + iris.cube.CubeList.extract : + Filter each of the cubes which can be filtered by the given constraints. """ return self._extract_and_merge( @@ -716,7 +719,7 @@ def realise_data(self): # Compute these stats together (avoiding multiple data passes). CubeList([a_std, b_std, ab_mean_diff, std_err]).realise_data() - .. Note:: + .. note:: Cubes with non-lazy data are not affected. @@ -803,7 +806,7 @@ def __init__( Parameters ---------- combined : dict - values to init both 'self.globals' and 'self.locals'. If 'combined' itself + Values to init both 'self.globals' and 'self.locals'. If 'combined' itself has attributes named 'locals' and 'globals', these are used to update the respective content (after initially setting the individual ones). Otherwise, 'combined' is treated as a generic mapping, applied as @@ -811,9 +814,9 @@ def __init__( i.e. it will set locals and/or globals with the same logic as :meth:`~iris.cube.CubeAttrsDict.__setitem__` . locals : dict - initial content for 'self.locals' + Initial content for 'self.locals'. globals : dict - initial content for 'self.globals' + Initial content for 'self.globals'. Examples -------- @@ -1125,7 +1128,7 @@ def _sort_xml_attrs(cls, doc): Parameters ---------- - doc : :class:`xml.dom.minidom.Document`. + doc : :class:`xml.dom.minidom.Document` Returns ------- @@ -1208,7 +1211,7 @@ def __init__( units : optional The unit of the cube, e.g. ``"m s-1"`` or ``"kelvin"``. attributes : optional - A dictionary of cube attributes + A dictionary of cube attributes. cell_methods : optional A tuple of CellMethod objects, generally set by Iris, e.g. ``(CellMethod("mean", coords='latitude'), )``. @@ -1484,7 +1487,8 @@ def add_aux_coord(self, coord, data_dims=None): See Also -------- - :meth:`Cube.remove_coord()`. + remove_coord : + Remove a coordinate from the cube. """ if self.coords(coord): # TODO: just fail on duplicate object @@ -1625,7 +1629,8 @@ def add_cell_measure(self, cell_measure, data_dims=None): See Also -------- - :meth:`Cube.remove_cell_measure()`. + remove_cell_measure : + Remove a cell measure from the cube. """ if self.cell_measures(cell_measure): @@ -1645,7 +1650,7 @@ def add_ancillary_variable(self, ancillary_variable, data_dims=None): ---------- ancillary_variable : The :class:`iris.coords.AncillaryVariable` instance to be added to - the cube + the cube. data_dims : optional Integer or iterable of integers giving the data dimensions spanned by the ancillary variable. @@ -1655,6 +1660,7 @@ def add_ancillary_variable(self, ancillary_variable, data_dims=None): ValueError Raises a ValueError if an ancillary variable with identical metadata already exists on the cube. + """ if self.ancillary_variables(ancillary_variable): raise iris.exceptions.CannotAddError( @@ -1686,7 +1692,8 @@ def add_dim_coord(self, dim_coord, data_dim): See Also -------- - :meth:`Cube.remove_coord()`. + remove_coord : + Remove a coordinate from the cube. """ if self.coords(dim_coord): @@ -1766,8 +1773,10 @@ def remove_coord(self, coord): See Also -------- - :meth:`Cube.add_dim_coord()` - :meth:`Cube.add_aux_coord()` + add_dim_coord : + Add a CF coordinate to the cube. + add_aux_coord : + Add a CF auxiliary coordinate to the cube. """ coord = self.coord(coord) @@ -1794,15 +1803,14 @@ def remove_cell_measure(self, cell_measure): Notes ----- - .. note:: - - If the argument given does not represent a valid cell_measure on - the cube, an :class:`iris.exceptions.CellMeasureNotFoundError` - is raised. + If the argument given does not represent a valid cell_measure on + the cube, an :class:`iris.exceptions.CellMeasureNotFoundError` + is raised. See Also -------- - :meth:`Cube.add_cell_measure()` + add_cell_measure : + Add a CF cell measure to the cube. """ cell_measure = self.cell_measure(cell_measure) @@ -2091,7 +2099,8 @@ def coords( See Also -------- - :meth:`Cube.coord` for matching exactly one coordinate. + coord : + For matching exactly one coordinate. """ @@ -2254,7 +2263,9 @@ def coord( See Also -------- - :meth:`Cube.coords` for matching zero or more coordinates. + coords : + For matching zero or more coordinates. + """ coords = self.coords( name_or_coord=name_or_coord, @@ -2364,7 +2375,7 @@ def mesh(self): Returns ------- - mesh : :class:`iris.experimental.ugrid.mesh.Mesh` or None + :class:`iris.experimental.ugrid.mesh.Mesh` or None The mesh of the cube :class:`~iris.experimental.ugrid.MeshCoord`'s, or ``None``. @@ -2385,7 +2396,7 @@ def location(self): Returns ------- - location : str or None + str or None The mesh location of the cube :class:`~iris.experimental.ugrid.MeshCoords` (i.e. one of 'face' / 'edge' / 'node'), or ``None``. @@ -2405,7 +2416,7 @@ def mesh_dim(self): Returns ------- - mesh_dim : int or None + int or None The cube dimension which the cube :class:`~iris.experimental.ugrid.MeshCoord` map to, or ``None``. @@ -2434,7 +2445,8 @@ def cell_measures(self, name_or_cell_measure=None): See Also -------- - :meth:`Cube.cell_measure()`. + cell_measure : + Return a single cell_measure. """ name = None @@ -2468,7 +2480,7 @@ def cell_measure(self, name_or_cell_measure=None): See Also -------- - :meth:`Cube.cell_measures()` + cell_measures : For full keyword documentation. """ @@ -2521,7 +2533,8 @@ def ancillary_variables(self, name_or_ancillary_variable=None): See Also -------- - :meth:`Cube.ancillary_variable()`. + ancillary_variable : + Return a single ancillary_variable. """ name = None @@ -2555,7 +2568,7 @@ def ancillary_variable(self, name_or_ancillary_variable=None): See Also -------- - :meth:`Cube.ancillary_variables()` + ancillary_variables : For full keyword documentation. """ @@ -2715,7 +2728,7 @@ def data(self, data): self._data_manager.data = data def has_lazy_data(self): - """Details whether this :class:`~iris.cube.Cube` has lazy data. + """Detail whether this :class:`~iris.cube.Cube` has lazy data. Returns ------- @@ -2999,7 +3012,7 @@ def intersection(self, *args, **kwargs): ---------- coord : Either a :class:`iris.coords.Coord`, or coordinate name - (as defined in :meth:`iris.cube.Cube.coords()`) + (as defined in :meth:`iris.cube.Cube.coords()`). minimum : The minimum value of the range to select. maximum : @@ -3007,7 +3020,7 @@ def intersection(self, *args, **kwargs): min_inclusive : If True, coordinate values equal to `minimum` will be included in the selection. Default is True. - max_inclusive: + max_inclusive : If True, coordinate values equal to `maximum` will be included in the selection. Default is True. ignore_bounds : optional @@ -3379,7 +3392,7 @@ def slices_over(self, ref_to_slice): Parameters ---------- - ref_to_slice: str, coord, dimension index or a list of these + ref_to_slice : str, coord, dimension index or a list of these Determines which dimensions will be iterated along (i.e. the dimensions that are not returned in the subcubes). A mix of input types can also be provided. @@ -3405,7 +3418,8 @@ def slices_over(self, ref_to_slice): See Also -------- - :meth:`iris.cube.Cube.slices`. + iris.cube.Cube.slices : + Return an iterator of all subcubes given the coordinates or dimension indices. """ # Required to handle a mix between types. @@ -3449,7 +3463,7 @@ def slices(self, ref_to_slice, ordered=True): A mix of input types can also be provided. They must all be orthogonal (i.e. point to different dimensions). ordered : bool, default=True - if True, the order which the coords to slice or data_dims + If True, the order which the coords to slice or data_dims are given will be the order in which they represent the data in the resulting cube slices. If False, the order will follow that of the source cube. Default is True. @@ -3468,7 +3482,8 @@ def slices(self, ref_to_slice, ordered=True): See Also -------- - :meth:`iris.cube.Cube.slices_over`. + iris.cube.Cube.slices : + Return an iterator of all subcubes given the coordinates or dimension indices. """ if not isinstance(ordered, bool): @@ -4051,7 +4066,7 @@ def collapsed(self, coords, aggregator, **kwargs): for coord in lat_match: warnings.warn( msg.format(coord.name()), - category=iris.exceptions.IrisUserWarning, + category=iris.warnings.IrisUserWarning, ) # Determine the dimensions we need to collapse (and those we don't) @@ -4605,7 +4620,7 @@ def rolling_window(self, coord, aggregator, window, **kwargs): warnings.warn( "The bounds of coordinate %r were ignored in " "the rolling window operation." % coord_.name(), - category=iris.exceptions.IrisIgnoringBoundsWarning, + category=iris.warnings.IrisIgnoringBoundsWarning, ) if coord_.ndim != 1: diff --git a/lib/iris/exceptions.py b/lib/iris/exceptions.py index 0fb06f3b26..d6d2084d3c 100644 --- a/lib/iris/exceptions.py +++ b/lib/iris/exceptions.py @@ -161,186 +161,3 @@ class CannotAddError(ValueError): """Raised when an object (e.g. coord) cannot be added to a :class:`~iris.cube.Cube`.""" pass - - -############################################################################### -# WARNINGS -# Please namespace all warning objects (i.e. prefix with Iris...). - - -class IrisUserWarning(UserWarning): - r"""Base class for :class:`UserWarning` generated by Iris.""" - - pass - - -class IrisLoadWarning(IrisUserWarning): - """Any warning relating to loading.""" - - pass - - -class IrisSaveWarning(IrisUserWarning): - """Any warning relating to saving.""" - - pass - - -class IrisCfWarning(IrisUserWarning): - """Any warning relating to :term:`CF Conventions` .""" - - pass - - -class IrisIgnoringWarning(IrisUserWarning): - """Any warning that involves an Iris operation not using some information. - - E.g. :class:`~iris.aux_factory.AuxCoordFactory` generation disregarding - bounds. - """ - - pass - - -class IrisDefaultingWarning(IrisUserWarning): - """Any warning that involves Iris changing invalid/missing information. - - E.g. creating a :class:`~iris.coords.AuxCoord` from an invalid - :class:`~iris.coords.DimCoord` definition. - """ - - pass - - -class IrisVagueMetadataWarning(IrisUserWarning): - """Warnings where object metadata may not be fully descriptive.""" - - pass - - -class IrisUnsupportedPlottingWarning(IrisUserWarning): - """Warnings where support for a plotting module/function is not guaranteed.""" - - pass - - -class IrisImpossibleUpdateWarning(IrisUserWarning): - """Warnings where it is not possible to update an object. - - Mainly generated during regridding where the necessary information for - updating an :class:`~iris.aux_factory.AuxCoordFactory` is no longer - present. - """ - - pass - - -class IrisGeometryExceedWarning(IrisUserWarning): - """:mod:`iris.analysis.geometry` warnings about geometry exceeding dimensions.""" - - pass - - -class IrisMaskValueMatchWarning(IrisUserWarning): - """Warnings where the value representing masked data is actually present in data.""" - - pass - - -######## - - -class IrisCfLoadWarning(IrisCfWarning, IrisLoadWarning): - """Any warning relating to both loading and :term:`CF Conventions` .""" - - pass - - -class IrisCfSaveWarning(IrisCfWarning, IrisSaveWarning): - """Any warning relating to both saving and :term:`CF Conventions` .""" - - pass - - -class IrisCfInvalidCoordParamWarning(IrisCfLoadWarning): - """Warnings where incorrect information for CF coord construction is in a file.""" - - pass - - -class IrisCfMissingVarWarning(IrisCfLoadWarning): - """Warnings where a CF variable references another variable that is not in the file.""" - - pass - - -class IrisCfLabelVarWarning(IrisCfLoadWarning, IrisIgnoringWarning): - """Warnings where a CF string/label variable is being used inappropriately.""" - - pass - - -class IrisCfNonSpanningVarWarning(IrisCfLoadWarning, IrisIgnoringWarning): - """Warnings where a CF variable is ignored because it does not span the required dimension.""" - - pass - - -######## - - -class IrisIgnoringBoundsWarning(IrisIgnoringWarning): - """Warnings where bounds information has not been used by an Iris operation.""" - - pass - - -class IrisCannotAddWarning(IrisIgnoringWarning): - """Warnings where a member object cannot be added to a :class:`~iris.cube.Cube` .""" - - pass - - -class IrisGuessBoundsWarning(IrisDefaultingWarning): - """Warnings where Iris has filled absent bounds information with a best estimate.""" - - pass - - -class IrisPpClimModifiedWarning(IrisSaveWarning, IrisDefaultingWarning): - """Warnings where a climatology has been modified while saving :term:`Post Processing (PP) Format` .""" - - pass - - -class IrisFactoryCoordNotFoundWarning(IrisLoadWarning): - """Warnings where a referenced factory coord can not be found when loading a variable in :term:`NetCDF Format`.""" - - pass - - -class IrisNimrodTranslationWarning(IrisLoadWarning): - """For unsupported vertical coord types in :mod:`iris.file_formats.nimrod_load_rules`. - - (Pre-dates the full categorisation of Iris UserWarnings). - """ - - pass - - -class IrisUnknownCellMethodWarning(IrisCfLoadWarning): - """If a loaded :class:`~iris.coords.CellMethod` is not one the method names known to Iris. - - (Pre-dates the full categorisation of Iris UserWarnings). - """ - - pass - - -class IrisSaverFillValueWarning(IrisMaskValueMatchWarning, IrisSaveWarning): - """For fill value complications during Iris file saving :term:`NetCDF Format`. - - (Pre-dates the full categorisation of Iris UserWarnings). - """ - - pass diff --git a/lib/iris/experimental/animate.py b/lib/iris/experimental/animate.py index 5c9fa77bf8..13c1613802 100644 --- a/lib/iris/experimental/animate.py +++ b/lib/iris/experimental/animate.py @@ -8,15 +8,15 @@ ----- .. deprecated:: 3.4.0 -``iris.experimental.animate.animate()`` has been moved to -:func:`iris.plot.animate`. This module will therefore be removed in a future -release. + ``iris.experimental.animate.animate()`` has been moved to + :func:`iris.plot.animate`. This module will therefore be removed in a future + release. """ def animate(cube_iterator, plot_func, fig=None, **kwargs): - """Animates the given cube iterator. + """Animate the given cube iterator. Warnings -------- diff --git a/lib/iris/experimental/raster.py b/lib/iris/experimental/raster.py index ba7efc68b0..52ef2f651b 100644 --- a/lib/iris/experimental/raster.py +++ b/lib/iris/experimental/raster.py @@ -58,7 +58,7 @@ def _gdal_write_array(x_min, x_step, y_max, y_step, coord_system, data, fname, f coord_system : iris.coord_systems.CoordSystem Coordinate system for X and Y. data : numpy.ndarray - 2d array of values to export + 2d array of values to export. fname : str Output file name. ftype : str @@ -66,9 +66,7 @@ def _gdal_write_array(x_min, x_step, y_max, y_step, coord_system, data, fname, f Notes ----- - .. note:: - - Projection information is currently not written to the output. + Projection information is currently not written to the output. """ byte_order = data.dtype.str[0] @@ -109,14 +107,6 @@ def _gdal_write_array(x_min, x_step, y_max, y_step, coord_system, data, fname, f def export_geotiff(cube, fname): """Write cube data to raster file format as a PixelIsArea GeoTiff image. - .. deprecated:: 3.2.0 - - This method is scheduled to be removed in a future release, and no - replacement is currently planned. - If you make use of this functionality, please contact the Iris - Developers to discuss how to retain it (which could include reversing - the deprecation). - Parameters ---------- cube : Cube @@ -127,10 +117,16 @@ def export_geotiff(cube, fname): Notes ----- - .. note:: + For more details on GeoTiff specification and PixelIsArea, see: + https://www.remotesensing.org/geotiff/spec/geotiff2.5.html#2.5.2.2 + + .. deprecated:: 3.2.0 - For more details on GeoTiff specification and PixelIsArea, see: - https://www.remotesensing.org/geotiff/spec/geotiff2.5.html#2.5.2.2 + This method is scheduled to be removed in a future release, and no + replacement is currently planned. + If you make use of this functionality, please contact the Iris + Developers to discuss how to retain it (which could include reversing + the deprecation). """ wmsg = ( diff --git a/lib/iris/experimental/regrid.py b/lib/iris/experimental/regrid.py index 1bea933fbf..4ffad43a2c 100644 --- a/lib/iris/experimental/regrid.py +++ b/lib/iris/experimental/regrid.py @@ -4,9 +4,9 @@ # See LICENSE in the root of the repository for full licensing details. """Regridding functions. -.. note:: - - .. deprecated:: 3.2.0 +Notes +----- +.. deprecated:: 3.2.0 This package will be removed in a future release. The PointInCell class has now moved to :class:`iris.analysis.PointInCell`. @@ -16,6 +16,7 @@ discuss how to replace it or to retain it. """ + import copy import functools import warnings @@ -37,8 +38,8 @@ import iris.analysis.cartography import iris.coord_systems import iris.cube -from iris.exceptions import IrisImpossibleUpdateWarning from iris.util import _meshgrid +from iris.warnings import IrisImpossibleUpdateWarning wmsg = ( "The 'iris.experimental.regrid' package is deprecated since version 3.2, " @@ -57,33 +58,12 @@ def regrid_area_weighted_rectilinear_src_and_grid(src_cube, grid_cube, mdtol=0): mean of data values from src_grid regridded onto the horizontal grid of grid_cube. - .. note:: - - .. deprecated:: 3.2.0 - - This function is scheduled to be removed in a future release. - Please use :meth:`iris.cube.Cube.regrid` with the - :class:`iris.analysis.AreaWeighted` scheme instead : this is an exact - replacement. - - For example : - - .. code:: - - result = src_cube.regrid(grid_cube, AreaWeighted()) - This function requires that the horizontal grids of both cubes are rectilinear (i.e. expressed in terms of two orthogonal 1D coordinates) and that these grids are in the same coordinate system. This function also requires that the coordinates describing the horizontal grids all have bounds. - .. note:: - - Elements in data array of the returned cube that lie either partially - or entirely outside of the horizontal extent of the src_cube will - be masked irrespective of the value of mdtol. - Parameters ---------- src_cube : :class:`iris.cube.Cube` @@ -105,6 +85,25 @@ def regrid_area_weighted_rectilinear_src_and_grid(src_cube, grid_cube, mdtol=0): ------- A new :class:`iris.cube.Cube` instance. + Notes + ----- + Elements in data array of the returned cube that lie either partially + or entirely outside of the horizontal extent of the src_cube will + be masked irrespective of the value of mdtol. + + .. deprecated:: 3.2.0 + + This function is scheduled to be removed in a future release. + Please use :meth:`iris.cube.Cube.regrid` with the + :class:`iris.analysis.AreaWeighted` scheme instead : this is an exact + replacement. + + For example : + + .. code:: + + result = src_cube.regrid(grid_cube, AreaWeighted()) + """ wmsg = ( "The function " @@ -131,21 +130,6 @@ def regrid_weighted_curvilinear_to_rectilinear(src_cube, weights, grid_cube): mean of data values from :data:`src_cube` and the weights from :data:`weights` regridded onto the horizontal grid of :data:`grid_cube`. - .. note :: - - .. deprecated:: 3.2.0 - - This function is scheduled to be removed in a future release. - Please use :meth:`iris.cube.Cube.regrid` with the - :class:`iris.analysis.PointInCell` scheme instead : this is an exact - replacement. - - For example : - - .. code:: - - result = src_cube.regrid(grid_cube, PointInCell()) - This function requires that the :data:`src_cube` has a horizontal grid defined by a pair of X- and Y-axis coordinates which are mapped over the same cube dimensions, thus each point has an individually defined X and @@ -165,10 +149,10 @@ def regrid_weighted_curvilinear_to_rectilinear(src_cube, weights, grid_cube): :math:`\sum (src\_cube.data_{ij} * weights_{ij}) / \sum weights_{ij}`, for all :math:`ij` :data:`src_cube` points that are bound by that cell. - .. warning:: - - All coordinates that span the :data:`src_cube` that don't define - the horizontal curvilinear grid will be ignored. + Warnings + -------- + All coordinates that span the :data:`src_cube` that don't define + the horizontal curvilinear grid will be ignored. Parameters ---------- @@ -187,6 +171,21 @@ def regrid_weighted_curvilinear_to_rectilinear(src_cube, weights, grid_cube): ------- A :class:`iris.cube.Cube` instance. + Notes + ----- + .. deprecated:: 3.2.0 + + This function is scheduled to be removed in a future release. + Please use :meth:`iris.cube.Cube.regrid` with the + :class:`iris.analysis.PointInCell` scheme instead : this is an exact + replacement. + + For example : + + .. code:: + + result = src_cube.regrid(grid_cube, PointInCell()) + """ wmsg = ( "The function " @@ -341,7 +340,7 @@ def _regrid( projection, method, ): - """Regrids input data from the source to the target. Calculation is.""" + """Regrid input data from the source to the target. Calculation is.""" # Transform coordinates into the projection the interpolation will be # performed in. src_projection = src_x_coord.coord_system.as_cartopy_projection() @@ -622,9 +621,16 @@ def __init__(self, projection=None): Linear regridding scheme that uses scipy.interpolate.griddata on projected unstructured data. - .. note:: + Parameters + ---------- + projection : `cartopy.crs` instance, optional + The projection that the scipy calculation is performed in. + If None is given, a PlateCarree projection is used. Defaults to + None. - .. deprecated:: 3.2.0 + Notes + ----- + .. deprecated:: 3.2.0 This class is scheduled to be removed in a future release, and no replacement is currently planned. @@ -632,13 +638,6 @@ def __init__(self, projection=None): Developers to discuss how to retain it (which could include reversing the deprecation). - Parameters - ---------- - projection : `cartopy.crs instance`, optional - The projection that the scipy calculation is performed in. - If None is given, a PlateCarree projection is used. Defaults to - None. - """ self.projection = projection wmsg = ( @@ -696,7 +695,7 @@ class ProjectedUnstructuredNearest: The source cube and the target cube will be projected into a common projection for the scipy calculation to be performed. - .. Note:: + .. note:: The :class:`iris.analysis.UnstructuredNearest` scheme performs essentially the same job. That calculation is more rigorously correct and may be applied to larger data regions (including global). @@ -707,9 +706,16 @@ class ProjectedUnstructuredNearest: def __init__(self, projection=None): """Nearest regridding scheme that uses scipy.interpolate.griddata on projected unstructured data. - .. note:: + Parameters + ---------- + projection : `cartopy.crs instance`, optional + The projection that the scipy calculation is performed in. + If None is given, a PlateCarree projection is used. Defaults to + None. - .. deprecated:: 3.2.0 + Notes + ----- + .. deprecated:: 3.2.0 This class is scheduled to be removed in a future release, and no exact replacement is currently planned. @@ -718,13 +724,6 @@ def __init__(self, projection=None): contact the Iris Developers to discuss how to retain it (which could include reversing the deprecation). - Parameters - ---------- - projection : `cartopy.crs instance`, optional - The projection that the scipy calculation is performed in. - If None is given, a PlateCarree projection is used. Defaults to - None. - """ self.projection = projection wmsg = ( diff --git a/lib/iris/experimental/regrid_conservative.py b/lib/iris/experimental/regrid_conservative.py index e15b1c29a5..c4dbf965f8 100644 --- a/lib/iris/experimental/regrid_conservative.py +++ b/lib/iris/experimental/regrid_conservative.py @@ -4,9 +4,7 @@ # See LICENSE in the root of the repository for full licensing details. """Support for conservative regridding via ESMPy. -.. note:: - - .. deprecated:: 3.2.0 +.. deprecated:: 3.2.0 This package will be removed in a future release. Please use @@ -143,22 +141,6 @@ def _make_esmpy_field(x_coord, y_coord, ref_name="field", data=None, mask=None): def regrid_conservative_via_esmpy(source_cube, grid_cube): """Perform a conservative regridding with ESMPy. - .. note :: - - .. deprecated:: 3.2.0 - - This function is scheduled to be removed in a future release. - Please use - `iris-esmf-regrid `_ - instead. - - For example : - - .. code:: - - from emsf_regrid.schemes import ESMFAreaWeighted - result = src_cube.regrid(grid_cube, ESMFAreaWeighted()) - Regrids the data of a source cube onto a new grid defined by a destination cube. @@ -185,13 +167,10 @@ def regrid_conservative_via_esmpy(source_cube, grid_cube): the reference surfaces are also regridded, using ordinary bilinear interpolation. - .. note:: - - Both source and destination cubes must have two dimension coordinates - identified with axes 'X' and 'Y' which share a coord_system with a - Cartopy CRS. - The grids are defined by :meth:`iris.coords.Coord.contiguous_bounds` of - these. + Both source and destination cubes must have two dimension coordinates + identified with axes 'X' and 'Y' which share a coord_system with a + Cartopy CRS. The grids are defined by :meth:`iris.coords.Coord.contiguous_bounds` + of these. .. note:: @@ -200,6 +179,20 @@ def regrid_conservative_via_esmpy(source_cube, grid_cube): To alter this, make a prior call to ESMF.Manager(). + .. deprecated:: 3.2.0 + + This function is scheduled to be removed in a future release. + Please use + `iris-esmf-regrid `_ + instead. + + For example : + + .. code:: + + from emsf_regrid.schemes import ESMFAreaWeighted + result = src_cube.regrid(grid_cube, ESMFAreaWeighted()) + """ wmsg = ( "The function " diff --git a/lib/iris/experimental/representation.py b/lib/iris/experimental/representation.py index 4ffe176e3a..0648cc8e0d 100644 --- a/lib/iris/experimental/representation.py +++ b/lib/iris/experimental/representation.py @@ -209,13 +209,13 @@ def _make_row(self, title, body=None, col_span=0): Parameters ---------- - body : str, optional - Contains the content for each cell not in the left-most (title) column. - If None, indicates this row is a title row (see below). - title : stre, optional + title : str, optional Contains the row heading. If `body` is None, indicates that the row contains a sub-heading; e.g. 'Dimension coordinates:'. + body : str, optional + Contains the content for each cell not in the left-most (title) column. + If None, indicates this row is a title row (see below). col_span : int, default=0 Indicates how many columns the string should span. diff --git a/lib/iris/experimental/ugrid/__init__.py b/lib/iris/experimental/ugrid/__init__.py index ccdf05a387..f92cf670c4 100644 --- a/lib/iris/experimental/ugrid/__init__.py +++ b/lib/iris/experimental/ugrid/__init__.py @@ -13,6 +13,7 @@ definition at :const:`iris.experimental.ugrid.load.PARSE_UGRID_ON_LOAD`. """ + from ...config import get_logger from .load import PARSE_UGRID_ON_LOAD, load_mesh, load_meshes from .mesh import Connectivity, Mesh, MeshCoord diff --git a/lib/iris/experimental/ugrid/cf.py b/lib/iris/experimental/ugrid/cf.py index d00fd6ef24..9a56045e67 100644 --- a/lib/iris/experimental/ugrid/cf.py +++ b/lib/iris/experimental/ugrid/cf.py @@ -8,10 +8,11 @@ Eventual destination: :mod:`iris.fileformats.cf`. """ + import warnings -from ...exceptions import IrisCfLabelVarWarning, IrisCfMissingVarWarning from ...fileformats import cf +from ...warnings import IrisCfLabelVarWarning, IrisCfMissingVarWarning from .mesh import Connectivity diff --git a/lib/iris/experimental/ugrid/load.py b/lib/iris/experimental/ugrid/load.py index 8ba7448e8c..c9d66f5276 100644 --- a/lib/iris/experimental/ugrid/load.py +++ b/lib/iris/experimental/ugrid/load.py @@ -11,6 +11,7 @@ Eventual destination: :mod:`iris.fileformats.netcdf`. """ + from contextlib import contextmanager from itertools import groupby from pathlib import Path @@ -19,11 +20,11 @@ from ...config import get_logger from ...coords import AuxCoord -from ...exceptions import IrisCfWarning, IrisDefaultingWarning, IrisIgnoringWarning from ...fileformats._nc_load_rules.helpers import get_attr_units, get_names from ...fileformats.netcdf import loader as nc_loader from ...io import decode_uri, expand_filespecs from ...util import guess_coord_axis +from ...warnings import IrisCfWarning, IrisDefaultingWarning, IrisIgnoringWarning from .cf import ( CFUGridAuxiliaryCoordinateVariable, CFUGridConnectivityVariable, diff --git a/lib/iris/experimental/ugrid/mesh.py b/lib/iris/experimental/ugrid/mesh.py index 45fa344635..a798f7af77 100644 --- a/lib/iris/experimental/ugrid/mesh.py +++ b/lib/iris/experimental/ugrid/mesh.py @@ -8,6 +8,7 @@ Eventual destination: dedicated module in :mod:`iris` root. """ + from abc import ABC, abstractmethod from collections import namedtuple from collections.abc import Container @@ -934,7 +935,7 @@ def summary(self, shorten=False): Returns ------- - result : str + str """ if shorten: @@ -1889,7 +1890,7 @@ def to_MeshCoords(self, location): Returns ------- tuple of :class:`~iris.experimental.ugrid.mesh.MeshCoord` - tuple of :class:`~iris.experimental.ugrid.mesh.MeshCoord` + Tuple of :class:`~iris.experimental.ugrid.mesh.MeshCoord` referencing the current :class:`Mesh`. One for each value in :attr:`AXES`, using the value for the ``axis`` argument. @@ -2958,8 +2959,9 @@ def _construct_access_arrays(self): Returns ------- - points, bounds : array or None - lazy arrays which calculate the correct points and bounds from the + array or None + Tuple of (points, bounds). + Lazy arrays which calculate the correct points and bounds from the Mesh data, based on the location and axis. The Mesh coordinates accessed are not identified on construction, but discovered from the Mesh at the time of calculation, so that diff --git a/lib/iris/experimental/ugrid/metadata.py b/lib/iris/experimental/ugrid/metadata.py index 8969ab72a1..bc7cc677f7 100644 --- a/lib/iris/experimental/ugrid/metadata.py +++ b/lib/iris/experimental/ugrid/metadata.py @@ -8,6 +8,7 @@ Eventual destination: :mod:`iris.common.metadata`. """ + from functools import wraps from ...common import BaseMetadata diff --git a/lib/iris/experimental/ugrid/save.py b/lib/iris/experimental/ugrid/save.py index 40d1c42e90..8cfa6ba97a 100644 --- a/lib/iris/experimental/ugrid/save.py +++ b/lib/iris/experimental/ugrid/save.py @@ -8,6 +8,7 @@ Eventual destination: :mod:`iris.fileformats.netcdf`. """ + from collections.abc import Iterable from ...fileformats import netcdf diff --git a/lib/iris/experimental/ugrid/utils.py b/lib/iris/experimental/ugrid/utils.py index fce1036c6d..dcf5462ad5 100644 --- a/lib/iris/experimental/ugrid/utils.py +++ b/lib/iris/experimental/ugrid/utils.py @@ -4,6 +4,7 @@ # See LICENSE in the root of the repository for full licensing details. """Utility operations specific to unstructured data.""" + from typing import AnyStr, Iterable, Union import dask.array as da diff --git a/lib/iris/fileformats/_ff.py b/lib/iris/fileformats/_ff.py index d2ce1bcefb..35b4f65bb7 100644 --- a/lib/iris/fileformats/_ff.py +++ b/lib/iris/fileformats/_ff.py @@ -10,12 +10,11 @@ import numpy as np from iris.exceptions import ( - IrisDefaultingWarning, - IrisLoadWarning, NotYetImplementedError, ) from iris.fileformats._ff_cross_references import STASH_TRANS +from ..warnings import IrisDefaultingWarning, IrisLoadWarning from . import pp IMDI = -32768 @@ -842,9 +841,9 @@ def load_cubes(filenames, callback, constraints=None): Parameters ---------- filenames : - List of fields files filenames to load + List of fields files filenames to load. callback : - A function which can be passed on to :func:`iris.io.run_callback` + A function which can be passed on to :func:`iris.io.run_callback`. Notes ----- @@ -865,8 +864,8 @@ def load_cubes_32bit_ieee(filenames, callback, constraints=None): See Also -------- - :func:`load_cubes` - For keyword details + :func:`load_cubes` : + For keyword details. """ return pp._load_cubes_variable_loader( diff --git a/lib/iris/fileformats/_ff_cross_references.py b/lib/iris/fileformats/_ff_cross_references.py index b060ed42e9..6e9ce16363 100644 --- a/lib/iris/fileformats/_ff_cross_references.py +++ b/lib/iris/fileformats/_ff_cross_references.py @@ -2,9 +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. -""" -Table providing UM grid-code, field-code and pseudolevel-type for (some) -stash codes. Used in UM file i/o. +"""Table providing UM grid-code, field-code and pseudolevel-type for (some) stash codes. + +Used in UM file i/o. """ diff --git a/lib/iris/fileformats/_nc_load_rules/actions.py b/lib/iris/fileformats/_nc_load_rules/actions.py index fefa58ad10..1611ef7160 100644 --- a/lib/iris/fileformats/_nc_load_rules/actions.py +++ b/lib/iris/fileformats/_nc_load_rules/actions.py @@ -43,9 +43,9 @@ import warnings from iris.config import get_logger -import iris.exceptions import iris.fileformats.cf import iris.fileformats.pp as pp +import iris.warnings from . import helpers as hh @@ -54,8 +54,8 @@ class _WarnComboCfLoadIgnoring( - iris.exceptions.IrisCfLoadWarning, - iris.exceptions.IrisIgnoringWarning, + iris.warnings.IrisCfLoadWarning, + iris.warnings.IrisIgnoringWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -63,8 +63,8 @@ class _WarnComboCfLoadIgnoring( class _WarnComboLoadIgnoring( - iris.exceptions.IrisLoadWarning, - iris.exceptions.IrisIgnoringWarning, + iris.warnings.IrisLoadWarning, + iris.warnings.IrisIgnoringWarning, ): """One-off combination of warning classes - enhances user filtering.""" diff --git a/lib/iris/fileformats/_nc_load_rules/engine.py b/lib/iris/fileformats/_nc_load_rules/engine.py index 111e8320b6..48092508a4 100644 --- a/lib/iris/fileformats/_nc_load_rules/engine.py +++ b/lib/iris/fileformats/_nc_load_rules/engine.py @@ -18,6 +18,7 @@ used in :meth:`iris.fileformats.netcdf._actions_activation_stats`. """ + from .actions import run_actions diff --git a/lib/iris/fileformats/_nc_load_rules/helpers.py b/lib/iris/fileformats/_nc_load_rules/helpers.py index 3cf6aab945..43eed96fd5 100644 --- a/lib/iris/fileformats/_nc_load_rules/helpers.py +++ b/lib/iris/fileformats/_nc_load_rules/helpers.py @@ -13,6 +13,7 @@ build routines, and which it does not use. """ + from __future__ import annotations import re @@ -36,6 +37,7 @@ from iris.fileformats.netcdf.loader import _get_cf_var_data import iris.std_names import iris.util +import iris.warnings if TYPE_CHECKING: from numpy.ma import MaskedArray @@ -231,8 +233,8 @@ class _WarnComboIgnoringLoad( - iris.exceptions.IrisIgnoringWarning, - iris.exceptions.IrisLoadWarning, + iris.warnings.IrisIgnoringWarning, + iris.warnings.IrisLoadWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -240,8 +242,8 @@ class _WarnComboIgnoringLoad( class _WarnComboDefaultingLoad( - iris.exceptions.IrisDefaultingWarning, - iris.exceptions.IrisLoadWarning, + iris.warnings.IrisDefaultingWarning, + iris.warnings.IrisLoadWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -249,8 +251,8 @@ class _WarnComboDefaultingLoad( class _WarnComboDefaultingCfLoad( - iris.exceptions.IrisCfLoadWarning, - iris.exceptions.IrisDefaultingWarning, + iris.warnings.IrisCfLoadWarning, + iris.warnings.IrisDefaultingWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -258,8 +260,8 @@ class _WarnComboDefaultingCfLoad( class _WarnComboIgnoringCfLoad( - iris.exceptions.IrisIgnoringWarning, - iris.exceptions.IrisCfLoadWarning, + iris.warnings.IrisIgnoringWarning, + iris.warnings.IrisCfLoadWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -281,7 +283,7 @@ def _split_cell_methods(nc_cell_methods: str) -> List[re.Match]: Returns ------- nc_cell_methods_matches: list of re.Match objects - A list of re.Match objects associated with each parsed cell method + A list of re.Match objects associated with each parsed cell method. Notes ----- @@ -309,7 +311,7 @@ def _split_cell_methods(nc_cell_methods: str) -> List[re.Match]: ) warnings.warn( msg, - category=iris.exceptions.IrisCfLoadWarning, + category=iris.warnings.IrisCfLoadWarning, stacklevel=2, ) if bracket_depth > 0 and ind in name_start_inds: @@ -328,15 +330,15 @@ def _split_cell_methods(nc_cell_methods: str) -> List[re.Match]: nc_cell_method_match = _CM_PARSE.match(nc_cell_method_str.strip()) if not nc_cell_method_match: msg = f"Failed to fully parse cell method string: {nc_cell_methods}" - warnings.warn(msg, category=iris.exceptions.IrisCfLoadWarning, stacklevel=2) + warnings.warn(msg, category=iris.warnings.IrisCfLoadWarning, stacklevel=2) continue nc_cell_methods_matches.append(nc_cell_method_match) return nc_cell_methods_matches -class UnknownCellMethodWarning(iris.exceptions.IrisUnknownCellMethodWarning): - """Backwards compatible form of :class:`iris.exceptions.IrisUnknownCellMethodWarning`.""" +class UnknownCellMethodWarning(iris.warnings.IrisUnknownCellMethodWarning): + """Backwards compatible form of :class:`iris.warnings.IrisUnknownCellMethodWarning`.""" # TODO: remove at the next major release. pass @@ -559,7 +561,7 @@ def build_rotated_coordinate_system(engine, cf_grid_var): if north_pole_latitude is None or north_pole_longitude is None: warnings.warn( "Rotated pole position is not fully specified", - category=iris.exceptions.IrisCfLoadWarning, + category=iris.warnings.IrisCfLoadWarning, ) north_pole_grid_lon = getattr(cf_grid_var, CF_ATTR_GRID_NORTH_POLE_GRID_LON, 0.0) @@ -1077,7 +1079,7 @@ def _normalise_bounds_units( f"{bounds_units.origin!r}." ) warnings.warn( - wmsg, category=iris.exceptions.IrisCfLoadWarning, stacklevel=2 + wmsg, category=iris.warnings.IrisCfLoadWarning, stacklevel=2 ) bounds_data = None @@ -1194,7 +1196,7 @@ def build_dimension_coordinate( except iris.exceptions.CannotAddError as e_msg: warnings.warn( coord_skipped_msg.format(error=e_msg), - category=iris.exceptions.IrisCannotAddWarning, + category=iris.warnings.IrisCannotAddWarning, ) coord_skipped = True else: @@ -1208,7 +1210,7 @@ def build_dimension_coordinate( except iris.exceptions.CannotAddError as e_msg: warnings.warn( coord_skipped_msg.format(error=e_msg), - category=iris.exceptions.IrisCannotAddWarning, + category=iris.warnings.IrisCannotAddWarning, ) coord_skipped = True @@ -1284,7 +1286,7 @@ def build_auxiliary_coordinate( msg = "{name!r} coordinate not added to Cube: {error}" warnings.warn( msg.format(name=str(cf_coord_var.cf_name), error=e_msg), - category=iris.exceptions.IrisCannotAddWarning, + category=iris.warnings.IrisCannotAddWarning, ) else: # Make a list with names, stored on the engine, so we can find them all later. @@ -1336,7 +1338,7 @@ def build_cell_measures(engine, cf_cm_var): msg = "{name!r} cell measure not added to Cube: {error}" warnings.warn( msg.format(name=str(cf_cm_var.cf_name), error=e_msg), - category=iris.exceptions.IrisCannotAddWarning, + category=iris.warnings.IrisCannotAddWarning, ) else: # Make a list with names, stored on the engine, so we can find them all later. @@ -1384,7 +1386,7 @@ def build_ancil_var(engine, cf_av_var): msg = "{name!r} ancillary variable not added to Cube: {error}" warnings.warn( msg.format(name=str(cf_av_var.cf_name), error=e_msg), - category=iris.exceptions.IrisCannotAddWarning, + category=iris.warnings.IrisCannotAddWarning, ) else: # Make a list with names, stored on the engine, so we can find them all later. @@ -1586,7 +1588,7 @@ def has_supported_mercator_parameters(engine, cf_name): warnings.warn( "It does not make sense to provide both " '"scale_factor_at_projection_origin" and "standard_parallel".', - category=iris.exceptions.IrisCfInvalidCoordParamWarning, + category=iris.warnings.IrisCfInvalidCoordParamWarning, ) is_valid = False @@ -1616,7 +1618,7 @@ def has_supported_polar_stereographic_parameters(engine, cf_name): if latitude_of_projection_origin != 90 and latitude_of_projection_origin != -90: warnings.warn( '"latitude_of_projection_origin" must be +90 or -90.', - category=iris.exceptions.IrisCfInvalidCoordParamWarning, + category=iris.warnings.IrisCfInvalidCoordParamWarning, ) is_valid = False @@ -1624,7 +1626,7 @@ def has_supported_polar_stereographic_parameters(engine, cf_name): warnings.warn( "It does not make sense to provide both " '"scale_factor_at_projection_origin" and "standard_parallel".', - category=iris.exceptions.IrisCfInvalidCoordParamWarning, + category=iris.warnings.IrisCfInvalidCoordParamWarning, ) is_valid = False @@ -1632,7 +1634,7 @@ def has_supported_polar_stereographic_parameters(engine, cf_name): warnings.warn( 'One of "scale_factor_at_projection_origin" and ' '"standard_parallel" is required.', - category=iris.exceptions.IrisCfInvalidCoordParamWarning, + category=iris.warnings.IrisCfInvalidCoordParamWarning, ) is_valid = False diff --git a/lib/iris/fileformats/_structured_array_identification.py b/lib/iris/fileformats/_structured_array_identification.py index 8dada77458..0f386e9815 100644 --- a/lib/iris/fileformats/_structured_array_identification.py +++ b/lib/iris/fileformats/_structured_array_identification.py @@ -300,7 +300,7 @@ class GroupStructure: """ def __init__(self, length, component_structure, array_order="c"): - """group_component_to_array - a dictionary. See also TODO.""" + """Group_component_to_array - a dictionary. See also TODO.""" #: The size common to all of the original arrays and used to determine #: possible shape configurations. self.length = length diff --git a/lib/iris/fileformats/abf.py b/lib/iris/fileformats/abf.py index 6dd8dfd14f..1ac95a42eb 100644 --- a/lib/iris/fileformats/abf.py +++ b/lib/iris/fileformats/abf.py @@ -200,9 +200,9 @@ def load_cubes(filespecs, callback=None): Parameters ---------- filenames : - List of ABF filenames to load + List of ABF filenames to load. callback : optional - A function that can be passed to :func:`iris.io.run_callback` + A function that can be passed to :func:`iris.io.run_callback`. Notes ----- diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index 5a0230d5eb..0dc505d522 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -23,9 +23,9 @@ import numpy as np import numpy.ma as ma -import iris.exceptions from iris.fileformats.netcdf import _thread_safe_nc import iris.util +import iris.warnings # # CF parse pattern common to both formula terms and measure CF variables. @@ -278,7 +278,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF ancillary data variable %r, referenced by netCDF variable %r" warnings.warn( message % (name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: result[name] = CFAncillaryDataVariable( @@ -327,7 +327,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF auxiliary coordinate variable %r, referenced by netCDF variable %r" warnings.warn( message % (name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: # Restrict to non-string type i.e. not a CFLabelVariable. @@ -377,7 +377,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF boundary variable %r, referenced by netCDF variable %r" warnings.warn( message % (name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: result[name] = CFBoundaryVariable(name, variables[name]) @@ -453,7 +453,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF climatology variable %r, referenced by netCDF variable %r" warnings.warn( message % (name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: result[name] = CFClimatologyVariable(name, variables[name]) @@ -593,7 +593,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF formula term variable %r, referenced by netCDF variable %r" warnings.warn( message % (variable_name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: if variable_name not in result: @@ -660,7 +660,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF grid mapping variable %r, referenced by netCDF variable %r" warnings.warn( message % (name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: result[name] = CFGridMappingVariable(name, variables[name]) @@ -701,7 +701,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF label variable %r, referenced by netCDF variable %r" warnings.warn( message % (name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: # Register variable, but only allow string type. @@ -876,7 +876,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): message = "Missing CF-netCDF measure variable %r, referenced by netCDF variable %r" warnings.warn( message % (variable_name, nc_var_name), - category=iris.exceptions.IrisCfMissingVarWarning, + category=iris.warnings.IrisCfMissingVarWarning, ) else: result[variable_name] = CFMeasureVariable( @@ -1083,7 +1083,7 @@ def __init__(self, file_source, warn=False, monotonic=False): warnings.warn( "Optimise CF-netCDF loading by converting data from NetCDF3 " 'to NetCDF4 file format using the "nccopy" command.', - category=iris.exceptions.IrisLoadWarning, + category=iris.warnings.IrisLoadWarning, ) self._check_monotonic = monotonic @@ -1221,7 +1221,7 @@ def _build(cf_variable): ) warnings.warn( msg, - category=iris.exceptions.IrisCfNonSpanningVarWarning, + category=iris.warnings.IrisCfNonSpanningVarWarning, ) # Build CF data variable relationships. @@ -1270,7 +1270,7 @@ def _build(cf_variable): ) warnings.warn( msg, - category=iris.exceptions.IrisCfNonSpanningVarWarning, + category=iris.warnings.IrisCfNonSpanningVarWarning, ) # Add the CF group to the variable. diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index 53f85794c6..8405368ade 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -57,13 +57,14 @@ def save(cube, target): Parameters ---------- - cube: :class:`iris.cube.Cube`. + cube : :class:`iris.cube.Cube` target : A filename or open file handle. See Also -------- - :func:`iris.io.save`. + iris.io.save : + Save one or more Cubes to file (or other writeable). """ if isinstance(target, str): @@ -90,7 +91,7 @@ def save_png(source, target, launch=False): Parameters ---------- - source: :class:`iris.cube.Cube`, or dot filename. + source : :class:`iris.cube.Cube`, or dot filename target : A filename or open file handle. If passing a file handle, take care to open it for binary output. @@ -99,7 +100,8 @@ def save_png(source, target, launch=False): See Also -------- - :func:`iris.io.save`. + iris.io.save : + Save one or more Cubes to file (or other writeable). """ # From cube or dot file? diff --git a/lib/iris/fileformats/name_loaders.py b/lib/iris/fileformats/name_loaders.py index 3e337383cb..fe53308cb0 100644 --- a/lib/iris/fileformats/name_loaders.py +++ b/lib/iris/fileformats/name_loaders.py @@ -16,8 +16,9 @@ import iris.coord_systems from iris.coords import AuxCoord, CellMethod, DimCoord import iris.cube -from iris.exceptions import IrisLoadWarning, TranslationError +from iris.exceptions import TranslationError import iris.util +from iris.warnings import IrisLoadWarning EARTH_RADIUS = 6371229.0 NAMEIII_DATETIME_FORMAT = "%d/%m/%Y %H:%M %Z" diff --git a/lib/iris/fileformats/netcdf/__init__.py b/lib/iris/fileformats/netcdf/__init__.py index 61b6f74cc6..e92b0ed4f8 100644 --- a/lib/iris/fileformats/netcdf/__init__.py +++ b/lib/iris/fileformats/netcdf/__init__.py @@ -10,6 +10,7 @@ Also : `CF Conventions `_. """ + import iris.config # Note: *must* be done before importing from submodules, as they also use this ! diff --git a/lib/iris/fileformats/netcdf/_dask_locks.py b/lib/iris/fileformats/netcdf/_dask_locks.py index eb60afcf8a..64d094e060 100644 --- a/lib/iris/fileformats/netcdf/_dask_locks.py +++ b/lib/iris/fileformats/netcdf/_dask_locks.py @@ -49,6 +49,7 @@ 'distributed.Lock', which requires a distributed scheduler to function. """ + import threading import dask.array diff --git a/lib/iris/fileformats/netcdf/_thread_safe_nc.py b/lib/iris/fileformats/netcdf/_thread_safe_nc.py index 9aafbf312d..675a151868 100644 --- a/lib/iris/fileformats/netcdf/_thread_safe_nc.py +++ b/lib/iris/fileformats/netcdf/_thread_safe_nc.py @@ -7,6 +7,7 @@ Intention is that no other Iris module should import the netCDF4 module. """ + from abc import ABC from threading import Lock import typing @@ -50,7 +51,7 @@ def is_contained_type(cls, instance): @classmethod def from_existing(cls, instance): - """Pass an existing instance to __init__, where it is contained.""" + """Routine to pass an existing instance to __init__, where it is contained.""" assert cls.is_contained_type(instance) return cls(instance) @@ -122,7 +123,7 @@ def setncattr(self, *args, **kwargs) -> None: @property def dimensions(self) -> typing.List[str]: - """Calls netCDF4.Variable.dimensions within _GLOBAL_NETCDF4_LOCK. + """Call netCDF4.Variable.dimensions within _GLOBAL_NETCDF4_LOCK. Only defined explicitly in order to get some mocks to work. """ @@ -162,7 +163,7 @@ class GroupWrapper(_ThreadSafeWrapper): @property def dimensions(self) -> typing.Dict[str, DimensionWrapper]: - """Calls dimensions of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. + """Call dimensions of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. Calls dimensions of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK, returning DimensionWrappers. The original returned netCDF4.Dimensions @@ -191,7 +192,7 @@ def createDimension(self, *args, **kwargs) -> DimensionWrapper: @property def variables(self) -> typing.Dict[str, VariableWrapper]: - """Calls variables of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. + """Call variables of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. Calls variables of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK, returning VariableWrappers. The original returned netCDF4.Variables @@ -238,7 +239,7 @@ def get_variables_by_attributes( @property def groups(self): - """Calls groups of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. + """Call groups of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. Calls groups of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK, returning GroupWrappers. @@ -253,7 +254,7 @@ def groups(self): @property def parent(self): - """Calls parent of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. + """Call parent of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK. Calls parent of netCDF4.Group/Dataset within _GLOBAL_NETCDF4_LOCK, returning a GroupWrapper. @@ -261,6 +262,7 @@ def parent(self): The original returned netCDF4.Group is simply replaced with its respective GroupWrapper, ensuring that downstream calls are also performed within _GLOBAL_NETCDF4_LOCK. + """ with _GLOBAL_NETCDF4_LOCK: parent_ = self._contained_instance.parent diff --git a/lib/iris/fileformats/netcdf/loader.py b/lib/iris/fileformats/netcdf/loader.py index e25806db1c..8a48fddb37 100644 --- a/lib/iris/fileformats/netcdf/loader.py +++ b/lib/iris/fileformats/netcdf/loader.py @@ -10,6 +10,7 @@ Also : `CF Conventions `_. """ + from collections.abc import Iterable, Mapping from contextlib import contextmanager from copy import deepcopy @@ -34,12 +35,12 @@ import iris.config import iris.coord_systems import iris.coords -import iris.exceptions import iris.fileformats.cf from iris.fileformats.netcdf import _thread_safe_nc from iris.fileformats.netcdf.saver import _CF_ATTRS import iris.io import iris.util +import iris.warnings # Show actions activation statistics. DEBUG = False @@ -53,8 +54,8 @@ class _WarnComboIgnoringBoundsLoad( - iris.exceptions.IrisIgnoringBoundsWarning, - iris.exceptions.IrisLoadWarning, + iris.warnings.IrisIgnoringBoundsWarning, + iris.warnings.IrisLoadWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -415,7 +416,7 @@ def coord_from_term(term): return coord warnings.warn( "Unable to find coordinate for variable {!r}".format(name), - category=iris.exceptions.IrisFactoryCoordNotFoundWarning, + category=iris.warnings.IrisFactoryCoordNotFoundWarning, ) if formula_type == "atmosphere_sigma_coordinate": @@ -515,9 +516,10 @@ def _translate_constraints_to_var_callback(constraints): Returns ------- - function : (cf_var:CFDataVariable) - bool, or None. + bool or None + Notes + ----- For now, ONLY handles a single NameConstraint with no 'STASH' component. """ @@ -646,7 +648,7 @@ def load_cubes(file_sources, callback=None, constraints=None): except ValueError as e: warnings.warn( "{}".format(e), - category=iris.exceptions.IrisLoadWarning, + category=iris.warnings.IrisLoadWarning, ) # Perform any user registered callback function. @@ -705,7 +707,7 @@ def set( Parameters ---------- var_names : str or list of str, default=None - apply the `dimension_chunksizes` controls only to these variables, + Apply the `dimension_chunksizes` controls only to these variables, or when building :class:`~iris.cube.Cube` from these data variables. If ``None``, settings apply to all loaded variables. **dimension_chunksizes : dict of {str: int} @@ -794,7 +796,7 @@ def from_file(self) -> None: @contextmanager def as_dask(self) -> None: - """Relies on Dask :external+dask:doc:`array` to control chunk sizes. + """Rely on Dask :external+dask:doc:`array` to control chunk sizes. Notes ----- diff --git a/lib/iris/fileformats/netcdf/saver.py b/lib/iris/fileformats/netcdf/saver.py index 086732e597..11491de900 100644 --- a/lib/iris/fileformats/netcdf/saver.py +++ b/lib/iris/fileformats/netcdf/saver.py @@ -13,6 +13,7 @@ Also : `CF Conventions `_. """ + import collections from itertools import repeat, zip_longest import os @@ -49,6 +50,7 @@ from iris.fileformats.netcdf import _dask_locks, _thread_safe_nc import iris.io import iris.util +import iris.warnings # Get the logger : shared logger for all in 'iris.fileformats.netcdf'. from . import logger @@ -161,8 +163,8 @@ class _WarnComboMaskSave( - iris.exceptions.IrisMaskValueMatchWarning, - iris.exceptions.IrisSaveWarning, + iris.warnings.IrisMaskValueMatchWarning, + iris.warnings.IrisSaveWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -296,10 +298,10 @@ def _data_fillvalue_check(arraylib, data, check_value): arraylib : module Either numpy or dask.array : When dask, results are lazy computations. data : array-like - Array to check (numpy or dask) + Array to check (numpy or dask). check_value : number or None If not None, fill-value to check for existence in the array. - If None, do not do value-in-array check + If None, do not do value-in-array check. Returns ------- @@ -318,8 +320,8 @@ def _data_fillvalue_check(arraylib, data, check_value): return is_masked, contains_value -class SaverFillValueWarning(iris.exceptions.IrisSaverFillValueWarning): - """Backwards compatible form of :class:`iris.exceptions.IrisSaverFillValueWarning`.""" +class SaverFillValueWarning(iris.warnings.IrisSaverFillValueWarning): + """Backwards compatible form of :class:`iris.warnings.IrisSaverFillValueWarning`.""" # TODO: remove at the next major release. pass @@ -334,18 +336,18 @@ def _fillvalue_report(fill_info, is_masked, contains_fill_value, warn=False): Parameters ---------- fill_info : _FillvalueCheckInfo - A named-tuple containing the context of the fill-value check + A named-tuple containing the context of the fill-value check. is_masked : bool - whether the data array was masked + Whether the data array was masked. contains_fill_value : bool - whether the data array contained the fill-value + Whether the data array contained the fill-value. warn : bool, default=False - if True, also issue any resulting warning immediately. + If True, also issue any resulting warning immediately. Returns ------- None or :class:`Warning` - If not None, indicates a known or possible problem with filling + If not None, indicates a known or possible problem with filling. """ varname = fill_info.varname @@ -737,7 +739,7 @@ def write( cf_patch(profile, self._dataset, cf_var_cube) else: msg = "cf_profile is available but no {} defined.".format("cf_patch") - warnings.warn(msg, category=iris.exceptions.IrisCfSaveWarning) + warnings.warn(msg, category=iris.warnings.IrisCfSaveWarning) @staticmethod def check_attribute_compliance(container, data_dtype): @@ -843,21 +845,22 @@ def _add_mesh(self, cube_or_mesh): Add the cube's mesh, and all related variables to the dataset. Includes all the mesh-element coordinate and connectivity variables. - ..note:: + .. note:: Here, we do *not* add the relevant referencing attributes to the data-variable, because we want to create the data-variable later. Parameters ---------- - cube_or_mesh : :class:`iris.cube.Cube`or :class:`iris.experimental.ugrid.Mesh` + cube_or_mesh : :class:`iris.cube.Cube` or :class:`iris.experimental.ugrid.Mesh` The Cube or Mesh being saved to the netCDF file. Returns ------- - cf_mesh_name : str or None + str or None The name of the mesh variable created, or None if the cube does not have a mesh. + """ cf_mesh_name = None @@ -1020,7 +1023,7 @@ def _add_aux_coords(self, cube, cf_var_cube, dimension_names): cube : :class:`iris.cube.Cube` A :class:`iris.cube.Cube` to be saved to a netCDF file. cf_var_cube : :class:`netcdf.netcdf_variable` - cf variable cube representation. + A cf variable cube representation. dimension_names : list Names associated with the dimensions of the cube. """ @@ -1060,7 +1063,7 @@ def _add_cell_measures(self, cube, cf_var_cube, dimension_names): cube : :class:`iris.cube.Cube` A :class:`iris.cube.Cube` to be saved to a netCDF file. cf_var_cube : :class:`netcdf.netcdf_variable` - cf variable cube representation. + A cf variable cube representation. dimension_names : list Names associated with the dimensions of the cube. """ @@ -1079,7 +1082,7 @@ def _add_ancillary_variables(self, cube, cf_var_cube, dimension_names): cube : :class:`iris.cube.Cube` A :class:`iris.cube.Cube` to be saved to a netCDF file. cf_var_cube : :class:`netcdf.netcdf_variable` - cf variable cube representation. + A cf variable cube representation. dimension_names : list Names associated with the dimensions of the cube. """ @@ -1121,7 +1124,7 @@ def _add_aux_factories(self, cube, cf_var_cube, dimension_names): ---------- cube : :class:`iris.cube.Cube` A :class:`iris.cube.Cube` to be saved to a netCDF file. - cf_var_cube: :class:`netcdf.netcdf_variable` + cf_var_cube : :class:`netcdf.netcdf_variable` CF variable cube representation. dimension_names : list Names associated with the dimensions of the cube. @@ -1133,7 +1136,7 @@ def _add_aux_factories(self, cube, cf_var_cube, dimension_names): msg = "Unable to determine formula terms for AuxFactory: {!r}".format( factory ) - warnings.warn(msg, category=iris.exceptions.IrisSaveWarning) + warnings.warn(msg, category=iris.warnings.IrisSaveWarning) else: # Override `standard_name`, `long_name`, and `axis` of the # primary coord that signals the presence of a dimensionless @@ -1211,7 +1214,7 @@ def _get_dim_names(self, cube_or_mesh): mesh_dimensions : list of str A list of the mesh dimensions of the attached mesh, if any. cube_dimensions : list of str - A lists of dimension names for each dimension of the cube + A lists of dimension names for each dimension of the cube. Notes ----- @@ -1417,12 +1420,12 @@ def cf_valid_var_name(var_name): Parameters ---------- var_name : str - The var_name to normalise + The var_name to normalise. Returns ------- str - var_name suitable for passing through for variable creation. + The var_name suitable for passing through for variable creation. """ # Replace invalid characters with an underscore ("_"). @@ -1498,9 +1501,9 @@ def _create_cf_bounds(self, coord, cf_var, cf_name): coord : :class:`iris.coords.Coord` A coordinate of a cube. cf_var : - CF-netCDF variable + CF-netCDF variable. cf_name : str - name of the CF-NetCDF variable. + Name of the CF-NetCDF variable. Returns ------- @@ -1749,7 +1752,7 @@ def _create_generic_cf_array_var( Create the associated CF-netCDF variable in the netCDF dataset for the given dimensional_metadata. - ..note:: + .. note:: If the metadata element is a coord, it may also contain bounds. In which case, an additional var is created and linked to it. @@ -1951,7 +1954,7 @@ def _create_cf_grid_mapping(self, cube, cf_var_cube): A :class:`iris.cube.Cube`, :class:`iris.cube.CubeList` or list of cubes to be saved to a netCDF file. cf_var_cube : :class:`netcdf.netcdf_variable` - cf variable cube representation. + A cf variable cube representation. Returns ------- @@ -2084,7 +2087,7 @@ def add_ellipsoid(ellipsoid): elif isinstance(cs, iris.coord_systems.OSGB): warnings.warn( "OSGB coordinate system not yet handled", - category=iris.exceptions.IrisSaveWarning, + category=iris.warnings.IrisSaveWarning, ) # lambert azimuthal equal area @@ -2172,7 +2175,7 @@ def add_ellipsoid(ellipsoid): "Unable to represent the horizontal " "coordinate system. The coordinate system " "type %r is not yet implemented." % type(cs), - category=iris.exceptions.IrisSaveWarning, + category=iris.warnings.IrisSaveWarning, ) self._coord_systems.append(cs) @@ -2201,11 +2204,11 @@ def _create_cf_data_variable( dimension_names : list String names for each dimension of the cube. local_keys : iterable of str, optional - See :func:`iris.fileformats.netcdf.Saver.write` + See :func:`iris.fileformats.netcdf.Saver.write`. packing : type or str or dict or list, optional - See :func:`iris.fileformats.netcdf.Saver.write` + See :func:`iris.fileformats.netcdf.Saver.write`. fill_value : optional - See :func:`iris.fileformats.netcdf.Saver.write` + See :func:`iris.fileformats.netcdf.Saver.write`. Notes ----- @@ -2342,7 +2345,7 @@ def set_packing_ncattrs(cfvar): "attribute, but {attr_name!r} should only be a CF " "global attribute.".format(attr_name=attr_name) ) - warnings.warn(msg, category=iris.exceptions.IrisCfSaveWarning) + warnings.warn(msg, category=iris.warnings.IrisCfSaveWarning) _setncattr(cf_var, attr_name, value) @@ -2548,7 +2551,7 @@ def complete(self, issue_warnings=True) -> List[Warning]: Returns ------- - warnings : list of Warning + list of Warning Any warnings that were raised while writing delayed data. """ @@ -2565,7 +2568,7 @@ def complete(self, issue_warnings=True) -> List[Warning]: if issue_warnings: # Issue any delayed warnings from the compute. for delayed_warning in result_warnings: - warnings.warn(delayed_warning, category=iris.exceptions.IrisSaveWarning) + warnings.warn(delayed_warning, category=iris.warnings.IrisSaveWarning) return result_warnings @@ -2617,7 +2620,7 @@ def save( Name of the netCDF file to save the cube(s). **Or** an open, writeable :class:`netCDF4.Dataset`, or compatible object. - .. Note:: + .. note:: When saving to a dataset, ``compute`` **must** be ``False`` : See the ``compute`` parameter. @@ -2734,7 +2737,7 @@ def save( Returns ------- - result : None or dask.delayed.Delayed + None or dask.delayed.Delayed If `compute=True`, returns `None`. Otherwise returns a :class:`dask.delayed.Delayed`, which implements delayed writing to fill in the variables data. @@ -2815,7 +2818,7 @@ def attr_values_equal(val1, val2): f"Saving the cube global attributes {sorted(invalid_globals)} as local " "(i.e. data-variable) attributes, where possible, since they are not " "the same on all input cubes.", - category=iris.exceptions.IrisSaveWarning, + category=iris.warnings.IrisSaveWarning, ) cubes = cubes.copy() # avoiding modifying the actual input arg. for i_cube in range(len(cubes)): @@ -2831,7 +2834,7 @@ def attr_values_equal(val1, val2): f"Global cube attributes {sorted(blocked_attrs)} " f'of cube "{cube.name()}" were not saved, overlaid ' "by existing local attributes with the same names.", - category=iris.exceptions.IrisSaveWarning, + category=iris.warnings.IrisSaveWarning, ) demote_attrs -= blocked_attrs if demote_attrs: @@ -2973,7 +2976,7 @@ def is_valid_packspec(p): msg = "cf_profile is available but no {} defined.".format( "cf_patch_conventions" ) - warnings.warn(msg, category=iris.exceptions.IrisCfSaveWarning) + warnings.warn(msg, category=iris.warnings.IrisCfSaveWarning) # Add conventions attribute. if iris.FUTURE.save_split_attrs: diff --git a/lib/iris/fileformats/nimrod.py b/lib/iris/fileformats/nimrod.py index 55927df3ef..d318c94882 100644 --- a/lib/iris/fileformats/nimrod.py +++ b/lib/iris/fileformats/nimrod.py @@ -295,15 +295,13 @@ def load_cubes(filenames, callback=None): Parameters ---------- filenames : - List of NIMROD filenames to load + List of NIMROD filenames to load. callback : optional - A function which can be passed on to :func:`iris.io.run_callback` + A function which can be passed on to :func:`iris.io.run_callback`. Notes ----- - .. note:: - - The resultant cubes may not be in the same order as in the files. + The resultant cubes may not be in the same order as in the files. """ if isinstance(filenames, str): diff --git a/lib/iris/fileformats/nimrod_load_rules.py b/lib/iris/fileformats/nimrod_load_rules.py index 5ca9ef4be3..2c0b4334db 100644 --- a/lib/iris/fileformats/nimrod_load_rules.py +++ b/lib/iris/fileformats/nimrod_load_rules.py @@ -17,9 +17,9 @@ from iris.coords import DimCoord from iris.exceptions import ( CoordinateNotFoundError, - IrisNimrodTranslationWarning, TranslationError, ) +from iris.warnings import IrisNimrodTranslationWarning __all__ = ["run"] @@ -32,7 +32,7 @@ class TranslationWarning(IrisNimrodTranslationWarning): - """Backwards compatible form of :class:`iris.exceptions.IrisNimrodTranslationWarning`.""" + """Backwards compatible form of :class:`iris.warnings.IrisNimrodTranslationWarning`.""" # TODO: remove at the next major release. pass @@ -654,7 +654,7 @@ def add_attr(item): def known_threshold_coord(field): - """Supplies known threshold coord meta-data for known use cases. + """Supply known threshold coord meta-data for known use cases. threshold_value_alt exists because some meta-data are mis-assigned in the Nimrod data. @@ -895,7 +895,7 @@ def run(field, handle_metadata_errors=True): field : :class:`~iris.fileformats.nimrod.NimrodField` handle_metadata_errors : bool, default=True Set to False to omit handling of known meta-data deficiencies - in Nimrod-format data + in Nimrod-format data. Returns ------- diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 2780c52625..e40b71eff5 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -32,6 +32,7 @@ import iris.fileformats.pp_load_rules from iris.fileformats.pp_save_rules import verify import iris.fileformats.rules +import iris.warnings try: import mo_pack @@ -216,8 +217,8 @@ class _WarnComboLoadingMask( - iris.exceptions.IrisLoadWarning, - iris.exceptions.IrisMaskValueMatchWarning, + iris.warnings.IrisLoadWarning, + iris.warnings.IrisMaskValueMatchWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -225,8 +226,8 @@ class _WarnComboLoadingMask( class _WarnComboLoadingDefaulting( - iris.exceptions.IrisDefaultingWarning, - iris.exceptions.IrisLoadWarning, + iris.warnings.IrisDefaultingWarning, + iris.warnings.IrisLoadWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -234,8 +235,8 @@ class _WarnComboLoadingDefaulting( class _WarnComboIgnoringLoad( - iris.exceptions.IrisIgnoringWarning, - iris.exceptions.IrisLoadWarning, + iris.warnings.IrisIgnoringWarning, + iris.warnings.IrisLoadWarning, ): """One-off combination of warning classes - enhances user filtering.""" @@ -381,8 +382,10 @@ def __init__(self, value, name_mapping_dict=None): ---------- name_mapping_dict : dict A special mapping to provide name based access to specific - integer positions: + integer positions. + Examples + -------- >>> a = SplittableInt(1234, {'hundreds': 2}) >>> print(a.hundreds) 2 @@ -1456,7 +1459,7 @@ class PPField2(PPField): @property def t1(self): - """cftime.datetime object. + """A cftime.datetime object. cftime.datetime object consisting of the lbyr, lbmon, lbdat, lbhr, and lbmin attributes. @@ -1489,7 +1492,7 @@ def t1(self, dt): @property def t2(self): - """cftime.datetime object. + """A cftime.datetime object. cftime.datetime object consisting of the lbyrd, lbmond, lbdatd, lbhrd, and lbmind attributes. @@ -1531,7 +1534,7 @@ class PPField3(PPField): @property def t1(self): - """cftime.datetime object. + """A cftime.datetime object. cftime.datetime object consisting of the lbyr, lbmon, lbdat, lbhr, lbmin, and lbsec attributes. @@ -1565,7 +1568,7 @@ def t1(self, dt): @property def t2(self): - """cftime.datetime object. + """A cftime.datetime object. cftime.datetime object consisting of the lbyrd, lbmond, lbdatd, lbhrd, lbmind, and lbsecd attributes. @@ -1619,7 +1622,7 @@ def load(filename, read_data=False, little_ended=False): Parameters ---------- filename : str - string of the filename to load. + String of the filename to load. read_data : bool, default=False Flag whether or not the data should be read, if False an empty data manager will be provided which can subsequently load the data @@ -1698,7 +1701,7 @@ def _interpret_fields(fields): "Landmask compressed fields existed without a " "landmask to decompress with. The data will have " "a shape of (0, 0) and will not read.", - category=iris.exceptions.IrisLoadWarning, + category=iris.warnings.IrisLoadWarning, ) mask_shape = (0, 0) else: @@ -2004,11 +2007,11 @@ def load_cubes(filenames, callback=None, constraints=None): Parameters ---------- filenames : - list of pp filenames to load - constraints : optional - A list of Iris constraints + List of pp filenames to load. callback : optional - A function which can be passed on to :func:`iris.io.run_callback` + A function which can be passed on to :func:`iris.io.run_callback`. + constraints : optional + A list of Iris constraints. Notes ----- @@ -2028,11 +2031,11 @@ def load_cubes_little_endian(filenames, callback=None, constraints=None): Parameters ---------- filenames : - list of pp filenames to load - constraints : optional - a list of Iris constraints + List of pp filenames to load. callback : optional - a function which can be passed on to :func:`iris.io.run_callback` + A function which can be passed on to :func:`iris.io.run_callback`. + constraints : optional + A list of Iris constraints. Notes ----- @@ -2160,7 +2163,7 @@ def save(cube, target, append=False, field_coords=None): handle. Default is False. field_coords : optional - list of 2 coords or coord names which are to be used + List of 2 coords or coord names which are to be used for reducing the given cube into 2d slices, which will ultimately determine the x and y coordinates of the resulting fields. @@ -2187,7 +2190,7 @@ def save_pairs_from_cube(cube, field_coords=None, target=None): Parameters ---------- cube : - A :class:`iris.cube.Cube` + A :class:`iris.cube.Cube`. field_coords : optional List of 2 coords or coord names which are to be used for reducing the given cube into 2d slices, which will ultimately @@ -2338,7 +2341,8 @@ def save_fields(fields, target, append: bool = False): See Also -------- - :func:`iris.io.save`. + iris.io.save : + Save one or more Cubes to file (or other writeable). """ # Open issues diff --git a/lib/iris/fileformats/pp_load_rules.py b/lib/iris/fileformats/pp_load_rules.py index 8343afab40..71540fe74a 100644 --- a/lib/iris/fileformats/pp_load_rules.py +++ b/lib/iris/fileformats/pp_load_rules.py @@ -308,7 +308,7 @@ def _reshape_vector_args(values_and_dims): Returns ------- - reshaped_arrays : iterable of arrays + iterable object of arrays The inputs, transposed and reshaped onto common target dimensions. """ @@ -357,7 +357,7 @@ def _collapse_degenerate_points_and_bounds(points, bounds=None, rtol=1.0e-7): bounds : :class:`numpy.ndarray`, optional Array of bounds values. This array should have an additional vertex dimension (typically of length 2) when compared to the points array - i.e. bounds.shape = points.shape + (nvertex,) + i.e. bounds.shape = points.shape + (nvertex,). rtol : optional, default=1.0e-7 Returns @@ -451,18 +451,18 @@ def _new_coord_and_dims( * dimensions with all points and bounds values the same are removed. * the result coordinate may be an AuxCoord if a DimCoord cannot be made - (e.g. if values are non-monotonic). + (e.g. if values are non-monotonic). Parameters ---------- is_vector_operation : bool If True, perform 'vector' style operation. - points : array-like - Coordinate point values. name : str Standard name of coordinate. units : str or cf_unit.Unit Units of coordinate. + points : array-like + Coordinate point values. lower_and_upper_bounds : pair of array-like or None, optional Corresponding bounds values (lower, upper), if any. @@ -932,7 +932,7 @@ def convert(f): def _all_other_rules(f): - """Deals with all the other rules. + """Deal with all the other rules. Deals with all the other rules that have not been factored into any of the other convert_scalar_coordinate functions above. diff --git a/lib/iris/fileformats/pp_save_rules.py b/lib/iris/fileformats/pp_save_rules.py index 20ed0bd618..b8e95d2160 100644 --- a/lib/iris/fileformats/pp_save_rules.py +++ b/lib/iris/fileformats/pp_save_rules.py @@ -11,7 +11,6 @@ import iris from iris.aux_factory import HybridHeightFactory, HybridPressureFactory -from iris.exceptions import IrisPpClimModifiedWarning from iris.fileformats._ff_cross_references import STASH_TRANS from iris.fileformats._pp_lbproc_pairs import LBPROC_MAP from iris.fileformats.rules import ( @@ -23,10 +22,11 @@ ) from iris.fileformats.um_cf_map import CF_TO_LBFC from iris.util import is_regular, regular_step +from iris.warnings import IrisPpClimModifiedWarning def _basic_coord_system_rules(cube, pp): - """Rules for setting the coord system of the PP field. + """Rule for setting the coord system of the PP field. Parameters ---------- @@ -80,7 +80,7 @@ def _um_version_rules(cube, pp): def _stash_rules(cube, pp): - """Attributes rules for setting the STASH attribute of the PP field. + """Attribute rules for setting the STASH attribute of the PP field. Parameters ---------- @@ -103,7 +103,7 @@ def _stash_rules(cube, pp): def _general_time_rules(cube, pp): - """Rules for setting time metadata of the PP field. + """Rule for setting time metadata of the PP field. Parameters ---------- @@ -377,7 +377,7 @@ def _general_time_rules(cube, pp): def _calendar_rules(cube, pp): - """Rules for setting the calendar of the PP field. + """Rule for setting the calendar of the PP field. Parameters ---------- @@ -403,7 +403,7 @@ def _calendar_rules(cube, pp): def _grid_and_pole_rules(cube, pp): - """Rules for setting the horizontal grid and pole location of the PP field. + """Rule for setting the horizontal grid and pole location of the PP field. Parameters ---------- @@ -485,7 +485,7 @@ def _grid_and_pole_rules(cube, pp): def _non_std_cross_section_rules(cube, pp): - """Rules for applying non-standard cross-sections to the PP field. + """Rule for applying non-standard cross-sections to the PP field. Parameters ---------- @@ -616,7 +616,7 @@ def _non_std_cross_section_rules(cube, pp): def _lbproc_rules(cube, pp): - """Rules for setting the processing code of the PP field. + """Rule for setting the processing code of the PP field. Note: `pp.lbproc` must be set to 0 before these rules are run. @@ -664,7 +664,7 @@ def _lbproc_rules(cube, pp): def _vertical_rules(cube, pp): - """Rules for setting vertical levels for the PP field. + """Rule for setting vertical levels for the PP field. Parameters ---------- @@ -849,7 +849,7 @@ def _vertical_rules(cube, pp): def _all_other_rules(cube, pp): - """Fields currently managed by these rules. + """Field currently managed by these rules. * lbfc (field code) * lbrsvd[3] (ensemble member number) diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index aa3d4696bc..be04f0bb5d 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -13,6 +13,7 @@ import iris.cube import iris.exceptions import iris.fileformats.um_cf_map +import iris.warnings Factory = collections.namedtuple("Factory", ["factory_class", "args"]) ReferenceTarget = collections.namedtuple("ReferenceTarget", ("name", "transform")) @@ -42,7 +43,7 @@ def as_cube(self): if len(src_cubes) > 1: warnings.warn( "Multiple reference cubes for {}".format(self.name), - category=iris.exceptions.IrisUserWarning, + category=iris.warnings.IrisUserWarning, ) src_cube = src_cubes[-1] @@ -313,7 +314,7 @@ def _make_cube(field, converter): cube.units = metadata.units except ValueError: msg = "Ignoring PP invalid units {!r}".format(metadata.units) - warnings.warn(msg, category=iris.exceptions.IrisIgnoringWarning) + warnings.warn(msg, category=iris.warnings.IrisIgnoringWarning) cube.attributes["invalid_units"] = metadata.units cube.units = cf_units._UNKNOWN_UNIT_STRING @@ -336,7 +337,7 @@ def _resolve_factory_references( factory_name = factory.factory_class.__name__ warnings.warn( msg.format(factory=factory_name), - category=iris.exceptions.IrisUserWarning, + category=iris.warnings.IrisUserWarning, ) else: aux_factory = factory.factory_class(*args) diff --git a/lib/iris/fileformats/um/_ff_replacement.py b/lib/iris/fileformats/um/_ff_replacement.py index 52afe343c3..e36260a335 100644 --- a/lib/iris/fileformats/um/_ff_replacement.py +++ b/lib/iris/fileformats/um/_ff_replacement.py @@ -56,9 +56,9 @@ def load_cubes(filenames, callback, constraints=None, _loader_kwargs=None): Parameters ---------- filenames : - list of filenames to load + List of filenames to load. callback : optional - A function which can be passed on to :func:`iris.io.run_callback` + A function which can be passed on to :func:`iris.io.run_callback`. constraints : optional _loader_kwargs : optional @@ -86,7 +86,7 @@ def load_cubes_32bit_ieee(filenames, callback, constraints=None): See Also -------- :func:`load_cubes` - For keyword details + For keyword details. """ return load_cubes( diff --git a/lib/iris/fileformats/um/_optimal_array_structuring.py b/lib/iris/fileformats/um/_optimal_array_structuring.py index 7d006ebeff..f4e0328a42 100644 --- a/lib/iris/fileformats/um/_optimal_array_structuring.py +++ b/lib/iris/fileformats/um/_optimal_array_structuring.py @@ -4,7 +4,6 @@ # See LICENSE in the root of the repository for full licensing details. """A module to provide an optimal array structure calculation.""" - from iris.fileformats._structured_array_identification import GroupStructure diff --git a/lib/iris/io/__init__.py b/lib/iris/io/__init__.py index d5896f25a4..50f0f3c4e6 100644 --- a/lib/iris/io/__init__.py +++ b/lib/iris/io/__init__.py @@ -153,11 +153,11 @@ def expand_filespecs(file_specs, files_expected=True): Returns ------- list of str - if files_expected is ``True``: + If files_expected is ``True``: A well-ordered list of matching absolute file paths. If any of the file-specs match no existing files, an exception is raised. - if files_expected is ``False``: + If files_expected is ``False``: A list of expanded file paths. """ # Remove any hostname component - currently unused @@ -334,7 +334,8 @@ def add_saver(file_extension, new_saver): See Also -------- - :func:`iris.io.save` + iris.io.save : + Save one or more Cubes to file (or other writeable). """ # Make sure it's a func with 2+ args diff --git a/lib/iris/io/format_picker.py b/lib/iris/io/format_picker.py index d5e54d231a..b1b93707c9 100644 --- a/lib/iris/io/format_picker.py +++ b/lib/iris/io/format_picker.py @@ -175,21 +175,22 @@ def __init__( Parameters ---------- format_name : str - string name of fileformat being described + String name of fileformat being described. file_element : FileElement instance of the element which identifies this - FormatSpecification + FormatSpecification. file_element_value : The value that the file_element should take if a file matches this - FormatSpecification + FormatSpecification. handler : optional - function which will be called when the specification has been + Function which will be called when the specification has been identified and is required to handler a format. If None, then the file can still be identified but no handling can be done. - priority: int + priority : int Integer giving a priority for considering this specification where higher priority means sooner consideration. - constraint_aware_handler: default=False + constraint_aware_handler : default=False + """ if not isinstance(file_element, FileElement): raise ValueError( diff --git a/lib/iris/iterate.py b/lib/iris/iterate.py index be2a436a5e..0cf7a035be 100644 --- a/lib/iris/iterate.py +++ b/lib/iris/iterate.py @@ -10,7 +10,7 @@ import numpy as np -from iris.exceptions import IrisUserWarning +from iris.warnings import IrisUserWarning __all__ = ["izip"] diff --git a/lib/iris/palette.py b/lib/iris/palette.py index e180b649a8..522a89fa1b 100644 --- a/lib/iris/palette.py +++ b/lib/iris/palette.py @@ -55,7 +55,7 @@ def is_brewer(cmap): def _default_cmap_norm(args, kwargs): - """Injects default cmap and norm behaviour into the keyword arguments. + """Inject default cmap and norm behaviour into the keyword arguments. This function injects default cmap and norm behaviour into the keyword arguments, based on the cube referenced within the positional arguments. @@ -123,7 +123,7 @@ def cmap_norm(cube): ------- tuple Tuple of :class:`matplotlib.colors.LinearSegmentedColormap` and - :class:`iris.palette.SymmetricNormalize` + :class:`iris.palette.SymmetricNormalize`. Notes ----- diff --git a/lib/iris/pandas.py b/lib/iris/pandas.py index d60b46011e..434e415f2d 100644 --- a/lib/iris/pandas.py +++ b/lib/iris/pandas.py @@ -7,6 +7,7 @@ See also: https://pandas.pydata.org/ """ + import datetime from itertools import chain, combinations import warnings @@ -27,7 +28,7 @@ from iris._deprecation import warn_deprecated from iris.coords import AncillaryVariable, AuxCoord, CellMeasure, DimCoord from iris.cube import Cube, CubeList -from iris.exceptions import IrisIgnoringWarning +from iris.warnings import IrisIgnoringWarning def _get_dimensional_metadata(name, values, calendar=None, dm_class=None): @@ -124,16 +125,10 @@ def as_cube( ): """Convert a Pandas Series/DataFrame into a 1D/2D Iris Cube. - .. deprecated:: 3.3.0 - - This function is scheduled for removal in a future release, being - replaced by :func:`iris.pandas.as_cubes`, which offers richer - dimensional intelligence. - Parameters ---------- pandas_array : :class:`pandas.Series` or :class:`pandas.DataFrame` - The Pandas object to convert + The Pandas object to convert. copy : bool, default=True Whether to copy `pandas_array`, or to create array views where possible. Provided in case of memory limit concerns. @@ -145,13 +140,21 @@ def as_cube( ----- This function will copy your data by default. - Example usage:: + Examples + -------- + :: as_cube(series, calendars={0: cf_units.CALENDAR_360_DAY}) as_cube(data_frame, calendars={1: cf_units.CALENDAR_STANDARD}) Since this function converts to/from a Pandas object, laziness will not be preserved. + .. deprecated:: 3.3.0 + + This function is scheduled for removal in a future release, being + replaced by :func:`iris.pandas.as_cubes`, which offers richer + dimensional intelligence. + """ message = ( "iris.pandas.as_cube has been deprecated, and will be removed in a " @@ -202,7 +205,7 @@ def as_cubes( Parameters ---------- pandas_structure : :class:`pandas.Series` or :class:`pandas.DataFrame` - The Pandas object to convert + The Pandas object to convert. copy : bool, default=True Whether the Cube :attr:`~iris.cube.Cube.data` is a copy of the `pandas_structure` column, or a view of the same array. Arrays other than @@ -564,14 +567,9 @@ def _make_cell_measures_list(cube): def as_series(cube, copy=True): """Convert a 1D cube to a Pandas Series. - .. deprecated:: 3.4.0 - This function is scheduled for removal in a future release, being - replaced by :func:`iris.pandas.as_data_frame`, which offers improved - multi dimension handling. - Parameters ---------- - cube: :class:`Cube` + cube : :class:`Cube` The cube to convert to a Pandas Series. copy : bool, default=True Whether to make a copy of the data. @@ -585,6 +583,12 @@ def as_series(cube, copy=True): Since this function converts to/from a Pandas object, laziness will not be preserved. + .. deprecated:: 3.4.0 + + This function is scheduled for removal in a future release, being + replaced by :func:`iris.pandas.as_data_frame`, which offers improved + multi dimension handling. + """ message = ( "iris.pandas.as_series has been deprecated, and will be removed in a " @@ -644,7 +648,7 @@ def as_data_frame( ------- :class:`~pandas.DataFrame` A :class:`~pandas.DataFrame` with :class:`~iris.cube.Cube` dimensions - forming a :class:`~pandas.MultiIndex` + forming a :class:`~pandas.MultiIndex`. Warnings -------- @@ -664,8 +668,6 @@ def as_data_frame( :class:`~pandas.DataFrame` column (the legacy behaviour preserves 2 dimensions via rows and columns). - | - #. Where the :class:`~iris.cube.Cube` contains masked values, these become :data:`numpy.nan` in the returned :class:`~pandas.DataFrame`. @@ -680,6 +682,8 @@ def as_data_frame( :class:`~iris.cube.Cube` data `dtype` is preserved. + Since this function converts to/from a Pandas object, laziness will not be preserved. + Examples -------- >>> import iris @@ -794,10 +798,6 @@ def as_data_frame( 419903 298.995148 Name: surface_temperature, Length: 419904, dtype: float32 - Notes - ----- - Since this function converts to/from a Pandas object, laziness will not be preserved. - """ def merge_metadata(meta_var_list): diff --git a/lib/iris/plot.py b/lib/iris/plot.py index c727607449..a0c5f55274 100644 --- a/lib/iris/plot.py +++ b/lib/iris/plot.py @@ -30,11 +30,12 @@ import iris.coord_systems import iris.coords import iris.cube -from iris.exceptions import IrisError, IrisUnsupportedPlottingWarning +from iris.exceptions import IrisError # Importing iris.palette to register the brewer palettes. import iris.palette from iris.util import _meshgrid +from iris.warnings import IrisUnsupportedPlottingWarning # Cynthia Brewer citation text. BREWER_CITE = "Colours based on ColorBrewer.org" @@ -255,7 +256,7 @@ def ticker_func(tick_location, _): def _invert_yaxis(v_coord, axes=None): - """Inverts the y-axis of the current plot based on conditions. + """Invert the y-axis of the current plot based on conditions. * If the y-axis is already inverted we don't want to re-invert it. * If v_coord is None then it will not have any attributes. @@ -265,7 +266,7 @@ def _invert_yaxis(v_coord, axes=None): Parameters ---------- v_coord : - The coord to be plotted on the y-axis + The coord to be plotted on the y-axis. axes : optional """ @@ -293,9 +294,9 @@ def _check_bounds_contiguity_and_mask(coord, data, atol=None, rtol=None): Parameters ---------- coord : iris.coord.Coord - Coordinate the bounds of which will be checked for contiguity + Coordinate the bounds of which will be checked for contiguity. data : array - Data of the the cube we are plotting + Data of the the cube we are plotting. atol : optional Absolute tolerance when checking the contiguity. Defaults to None. If an absolute tolerance is not set, 1D coords are not checked (so @@ -705,7 +706,7 @@ def _get_geodesic_params(globe): def _shift_plot_sections(u_object, u, v): - """Shifts subsections of u by multiples of 360 degrees. + """Shift subsections of u by multiples of 360 degrees. Shifts subsections of u by multiples of 360 degrees within ranges defined by the points where the line should cross over the 0/360 degree @@ -1051,7 +1052,7 @@ def _map_common(draw_method_name, arg_func, mode, cube, plot_defn, *args, **kwar def contour(cube, *args, **kwargs): - """Draws contour lines based on the given Cube. + """Draw contour lines based on the given Cube. Parameters ---------- @@ -1079,7 +1080,7 @@ def contour(cube, *args, **kwargs): def contourf(cube, *args, **kwargs): - """Draws filled contours based on the given Cube. + """Draw filled contours based on the given Cube. Parameters ---------- @@ -1297,7 +1298,7 @@ def horiz_plot(v_coord, orography, style_args): def outline(cube, coords=None, color="k", linewidth=None, axes=None): - """Draws cell outlines based on the given Cube. + """Draw cell outlines based on the given Cube. Parameters ---------- @@ -1338,7 +1339,7 @@ def outline(cube, coords=None, color="k", linewidth=None, axes=None): def pcolor(cube, *args, **kwargs): - """Draws a pseudocolor plot based on the given 2-dimensional Cube. + """Draw a pseudocolor plot based on the given 2-dimensional Cube. The cube must have either two 1-dimensional coordinates or two 2-dimensional coordinates with contiguous bounds to plot the cube against. @@ -1374,7 +1375,7 @@ def pcolor(cube, *args, **kwargs): def pcolormesh(cube, *args, **kwargs): - """Draws a pseudocolor plot based on the given 2-dimensional Cube. + """Draw a pseudocolor plot based on the given 2-dimensional Cube. The cube must have either two 1-dimensional coordinates or two 2-dimensional coordinates with contiguous bounds to plot against each @@ -1408,7 +1409,7 @@ def pcolormesh(cube, *args, **kwargs): def points(cube, *args, **kwargs): - """Draws sample point positions based on the given Cube. + """Draw sample point positions based on the given Cube. Parameters ---------- @@ -1478,7 +1479,7 @@ def _vector_component_args(x_points, y_points, u_data, *args, **kwargs): return ((x_points, y_points, u_data, v_data), kwargs) -def barbs(u_cube, v_cube, *args, **kwargs): +def barbs(u_cube, v_cube, *args, **kwargs): # numpydoc ignore=PR08 """Draw a barb plot from two vector component cubes. Draws a barb plot from two vector component cubes. Triangles, full-lines @@ -1530,8 +1531,8 @@ def barbs(u_cube, v_cube, *args, **kwargs): ) -def quiver(u_cube, v_cube, *args, **kwargs): - """Draws an arrow plot from two vector component cubes. +def quiver(u_cube, v_cube, *args, **kwargs): # numpydoc ignore=PR08 + """Draw an arrow plot from two vector component cubes. Parameters ---------- @@ -1581,7 +1582,7 @@ def quiver(u_cube, v_cube, *args, **kwargs): def plot(*args, **kwargs): - """Draws a line plot based on the given cube(s) or coordinate(s). + """Draw a line plot based on the given cube(s) or coordinate(s). Parameters ---------- @@ -1634,7 +1635,7 @@ def plot(*args, **kwargs): def scatter(x, y, *args, **kwargs): - """Draws a scatter plot based on the given cube(s) or coordinate(s). + """Draw a scatter plot based on the given cube(s) or coordinate(s). Parameters ---------- @@ -1739,7 +1740,7 @@ def hist(x, *args, **kwargs): def symbols(x, y, symbols, size, axes=None, units="inches"): - """Draws fixed-size symbols. + """Draw fixed-size symbols. See :mod:`iris.symbols` for available symbols. @@ -1829,7 +1830,7 @@ def citation(text, figure=None, axes=None): def animate(cube_iterator, plot_func, fig=None, **kwargs): - """Animates the given cube iterator. + """Animate the given cube iterator. Parameters ---------- @@ -1845,15 +1846,15 @@ def animate(cube_iterator, plot_func, fig=None, **kwargs): fig : :class:`matplotlib.figure.Figure` instance, optional By default, the current figure will be used or a new figure instance created if no figure is available. See :func:`matplotlib.pyplot.gcf`. - coords: list of :class:`~iris.coords.Coord` objects or coordinate names, optional + coords : list of :class:`~iris.coords.Coord` objects or coordinate names, optional Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot. - interval: int, float or long, optional + interval : int, float or long, optional Defines the time interval in milliseconds between successive frames. A default interval of 100ms is set. - vmin, vmax: int, float or long, optional + vmin, vmax : int, float or long, optional Color scaling values, see :class:`matplotlib.colors.Normalize` for further details. Default values are determined by the min-max across the data set over the entire sequence. diff --git a/lib/iris/quickplot.py b/lib/iris/quickplot.py index 14380019f3..b7d6e53f84 100644 --- a/lib/iris/quickplot.py +++ b/lib/iris/quickplot.py @@ -135,7 +135,7 @@ def _label_1d_plot(*args, **kwargs): def contour(cube, *args, **kwargs): - """Draws contour lines on a labelled plot based on the given Cube. + """Draw contour lines on a labelled plot based on the given Cube. With the basic call signature, contour "level" values are chosen automatically:: @@ -166,7 +166,7 @@ def contour(cube, *args, **kwargs): def contourf(cube, *args, **kwargs): - """Draws filled contours on a labelled plot based on the given Cube. + """Draw filled contours on a labelled plot based on the given Cube. With the basic call signature, contour "level" values are chosen automatically:: @@ -196,7 +196,7 @@ def contourf(cube, *args, **kwargs): def outline(cube, coords=None, color="k", linewidth=None, axes=None): - """Draws cell outlines on a labelled plot based on the given Cube. + """Draw cell outlines on a labelled plot based on the given Cube. Parameters ---------- @@ -227,7 +227,7 @@ def outline(cube, coords=None, color="k", linewidth=None, axes=None): def pcolor(cube, *args, **kwargs): - """Draws a labelled pseudocolor plot based on the given Cube. + """Draw a labelled pseudocolor plot based on the given Cube. See :func:`iris.plot.pcolor` for details of valid keyword arguments. @@ -244,7 +244,7 @@ def pcolor(cube, *args, **kwargs): def pcolormesh(cube, *args, **kwargs): - """Draws a labelled pseudocolour plot based on the given Cube. + """Draw a labelled pseudocolour plot based on the given Cube. See :func:`iris.plot.pcolormesh` for details of valid keyword arguments. @@ -262,7 +262,7 @@ def pcolormesh(cube, *args, **kwargs): def points(cube, *args, **kwargs): - """Draws sample point positions on a labelled plot based on the given Cube. + """Draw sample point positions on a labelled plot based on the given Cube. See :func:`iris.plot.points` for details of valid keyword arguments. @@ -280,7 +280,7 @@ def points(cube, *args, **kwargs): def plot(*args, **kwargs): - """Draws a labelled line plot based on the given cube(s) or coordinate(s). + """Draw a labelled line plot based on the given cube(s) or coordinate(s). See :func:`iris.plot.plot` for details of valid arguments and keyword arguments. @@ -298,7 +298,7 @@ def plot(*args, **kwargs): def scatter(x, y, *args, **kwargs): - """Draws a labelled scatter plot based on the given cubes or coordinates. + """Draw a labelled scatter plot based on the given cubes or coordinates. See :func:`iris.plot.scatter` for details of valid arguments and keyword arguments. @@ -316,7 +316,7 @@ def scatter(x, y, *args, **kwargs): def fill_between(x, y1, y2, *args, **kwargs): - """Draws a labelled fill_between plot based on the given cubes or coordinates. + """Draw a labelled fill_between plot based on the given cubes or coordinates. See :func:`iris.plot.fill_between` for details of valid arguments and keyword arguments. diff --git a/lib/iris/tests/graphics/idiff.py b/lib/iris/tests/graphics/idiff.py index 2e2ef75776..64d690e55d 100755 --- a/lib/iris/tests/graphics/idiff.py +++ b/lib/iris/tests/graphics/idiff.py @@ -26,7 +26,7 @@ from matplotlib.testing.exceptions import ImageComparisonFailure # noqa import matplotlib.widgets as mwidget # noqa -from iris.exceptions import IrisIgnoringWarning # noqa +from iris.warnings import IrisIgnoringWarning # noqa import iris.tests # noqa import iris.tests.graphics as graphics # noqa diff --git a/lib/iris/tests/integration/experimental/test_ugrid_load.py b/lib/iris/tests/integration/experimental/test_ugrid_load.py index 63406f1ba0..5735d6b2c1 100644 --- a/lib/iris/tests/integration/experimental/test_ugrid_load.py +++ b/lib/iris/tests/integration/experimental/test_ugrid_load.py @@ -8,6 +8,7 @@ standard behaviour. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip @@ -17,13 +18,13 @@ import pytest from iris import Constraint, load -from iris.exceptions import IrisCfWarning from iris.experimental.ugrid.load import PARSE_UGRID_ON_LOAD, load_mesh, load_meshes from iris.experimental.ugrid.mesh import Mesh from iris.tests.stock.netcdf import ( _file_from_cdl_template as create_file_from_cdl_template, ) from iris.tests.unit.tests.stock.test_netcdf import XIOSFileMixin +from iris.warnings import IrisCfWarning def ugrid_load(uris, constraints=None, callback=None): diff --git a/lib/iris/tests/integration/experimental/test_ugrid_save.py b/lib/iris/tests/integration/experimental/test_ugrid_save.py index 8350a2004f..85f6024b93 100644 --- a/lib/iris/tests/integration/experimental/test_ugrid_save.py +++ b/lib/iris/tests/integration/experimental/test_ugrid_save.py @@ -3,6 +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. """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/netcdf/test__dask_locks.py b/lib/iris/tests/integration/netcdf/test__dask_locks.py index 6e1026b29f..1aee902195 100644 --- a/lib/iris/tests/integration/netcdf/test__dask_locks.py +++ b/lib/iris/tests/integration/netcdf/test__dask_locks.py @@ -11,6 +11,7 @@ and (b) mock-ist testing of the implementation code in isolation would not add anything of much value. """ + import dask import dask.config import distributed diff --git a/lib/iris/tests/integration/netcdf/test_aux_factories.py b/lib/iris/tests/integration/netcdf/test_aux_factories.py index a0c2ec5992..4b4976bd18 100644 --- a/lib/iris/tests/integration/netcdf/test_aux_factories.py +++ b/lib/iris/tests/integration/netcdf/test_aux_factories.py @@ -75,9 +75,10 @@ def test_save_load_loop(self): # Tests an issue where the variable names in the formula # terms changed to the standard_names instead of the variable names # when loading a previously saved cube. - with self.temp_filename(suffix=".nc") as filename, self.temp_filename( - suffix=".nc" - ) as other_filename: + with ( + self.temp_filename(suffix=".nc") as filename, + self.temp_filename(suffix=".nc") as other_filename, + ): iris.save(self.cube, filename) cube = iris.load_cube(filename, "air_potential_temperature") iris.save(cube, other_filename) @@ -117,8 +118,9 @@ def test_shared_primary(self): ) factory.rename("another altitude") cube.add_aux_factory(factory) - with self.temp_filename(suffix=".nc") as filename, self.assertRaisesRegex( - ValueError, "multiple aux factories" + with ( + self.temp_filename(suffix=".nc") as filename, + self.assertRaisesRegex(ValueError, "multiple aux factories"), ): iris.save(cube, filename) @@ -141,8 +143,9 @@ def test_hybrid_height_cubes_on_dimension_coordinate(self): sa = hh2.coord("surface_altitude") sa.points = sa.points * 10 emsg = "Unable to create dimensonless vertical coordinate." - with self.temp_filename(".nc") as fname, self.assertRaisesRegex( - ValueError, emsg + with ( + self.temp_filename(".nc") as fname, + self.assertRaisesRegex(ValueError, emsg), ): iris.save([hh1, hh2], fname) diff --git a/lib/iris/tests/integration/netcdf/test_delayed_save.py b/lib/iris/tests/integration/netcdf/test_delayed_save.py index 62bfac7b45..9322bb9f54 100644 --- a/lib/iris/tests/integration/netcdf/test_delayed_save.py +++ b/lib/iris/tests/integration/netcdf/test_delayed_save.py @@ -3,6 +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. """Integration tests for delayed saving.""" + import re import warnings @@ -15,10 +16,10 @@ import pytest import iris -from iris.exceptions import IrisSaverFillValueWarning from iris.fileformats.netcdf._thread_safe_nc import default_fillvals import iris.tests from iris.tests.stock import realistic_4d +from iris.warnings import IrisSaverFillValueWarning class Test__lazy_stream_data: diff --git a/lib/iris/tests/integration/netcdf/test_general.py b/lib/iris/tests/integration/netcdf/test_general.py index 751c160805..c505a21af5 100644 --- a/lib/iris/tests/integration/netcdf/test_general.py +++ b/lib/iris/tests/integration/netcdf/test_general.py @@ -3,6 +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. """Integration tests for loading and saving netcdf files.""" + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip @@ -29,6 +30,7 @@ # Get the netCDF4 module, but in a sneaky way that avoids triggering the "do not import # netCDF4" check in "iris.tests.test_coding_standards.test_netcdf4_import()". import iris.fileformats.netcdf._thread_safe_nc as threadsafe_nc +import iris.warnings nc = threadsafe_nc.netCDF4 @@ -138,7 +140,7 @@ def test_unknown_method(self): warning_messages = [ warn for warn in warning_messages - if isinstance(warn, iris.exceptions.IrisUnknownCellMethodWarning) + if isinstance(warn, iris.warnings.IrisUnknownCellMethodWarning) ] self.assertEqual(len(warning_messages), 1) message = warning_messages[0].args[0] @@ -515,7 +517,7 @@ def test_datum_once(self): warnings.simplefilter("default") for fpath in fpaths: iris.load(fpath) - warnings.warn("Dummy warning", category=iris.exceptions.IrisUserWarning) + warnings.warn("Dummy warning", category=iris.warnings.IrisUserWarning) assert len(record) == 2 diff --git a/lib/iris/tests/integration/netcdf/test_self_referencing.py b/lib/iris/tests/integration/netcdf/test_self_referencing.py index 7f52f722ae..b2b9b6d4e1 100644 --- a/lib/iris/tests/integration/netcdf/test_self_referencing.py +++ b/lib/iris/tests/integration/netcdf/test_self_referencing.py @@ -15,8 +15,8 @@ import numpy as np import iris -from iris.exceptions import IrisCfMissingVarWarning from iris.fileformats.netcdf import _thread_safe_nc +from iris.warnings import IrisCfMissingVarWarning @tests.skip_data diff --git a/lib/iris/tests/integration/netcdf/test_thread_safety.py b/lib/iris/tests/integration/netcdf/test_thread_safety.py index b2319364c2..53b40dbe85 100644 --- a/lib/iris/tests/integration/netcdf/test_thread_safety.py +++ b/lib/iris/tests/integration/netcdf/test_thread_safety.py @@ -17,6 +17,7 @@ a thread safety problem, as this seems to be good testing practice. """ + from pathlib import Path import dask diff --git a/lib/iris/tests/integration/test_netcdf__loadsaveattrs.py b/lib/iris/tests/integration/test_netcdf__loadsaveattrs.py index 226babc9fb..991f0431a1 100644 --- a/lib/iris/tests/integration/test_netcdf__loadsaveattrs.py +++ b/lib/iris/tests/integration/test_netcdf__loadsaveattrs.py @@ -17,6 +17,7 @@ might be recorded either globally or locally. """ + import inspect import json import os diff --git a/lib/iris/tests/integration/test_pp.py b/lib/iris/tests/integration/test_pp.py index e8dd367187..1e71da623a 100644 --- a/lib/iris/tests/integration/test_pp.py +++ b/lib/iris/tests/integration/test_pp.py @@ -17,12 +17,13 @@ from iris.aux_factory import HybridHeightFactory, HybridPressureFactory from iris.coords import AuxCoord, CellMethod, DimCoord from iris.cube import Cube -from iris.exceptions import IgnoreCubeException, IrisUserWarning +from iris.exceptions import IgnoreCubeException import iris.fileformats.pp from iris.fileformats.pp import load_pairs_from_fields import iris.fileformats.pp_load_rules from iris.fileformats.pp_save_rules import verify import iris.util +from iris.warnings import IrisUserWarning class TestVertical(tests.IrisTest): @@ -279,9 +280,10 @@ def test_hybrid_pressure_with_duplicate_references(self): return_value=iter([data_field, pressure_field, pressure_field]) ) msg = "Multiple reference cubes for surface_air_pressure" - with mock.patch("iris.fileformats.pp.load", new=load) as load, mock.patch( - "warnings.warn" - ) as warn: + with ( + mock.patch("iris.fileformats.pp.load", new=load) as load, + mock.patch("warnings.warn") as warn, + ): _, _, _ = iris.fileformats.pp.load_cubes("DUMMY") warn.assert_called_with(msg, category=IrisUserWarning) @@ -395,9 +397,10 @@ def test_hybrid_height_round_trip_no_reference(self): # Convert field to a cube. load = mock.Mock(return_value=iter([data_field])) - with mock.patch("iris.fileformats.pp.load", new=load) as load, mock.patch( - "warnings.warn" - ) as warn: + with ( + mock.patch("iris.fileformats.pp.load", new=load) as load, + mock.patch("warnings.warn") as warn, + ): (data_cube,) = iris.fileformats.pp.load_cubes("DUMMY") msg = ( diff --git a/lib/iris/tests/stock/__init__.py b/lib/iris/tests/stock/__init__.py index 8c1154af72..ea513b967f 100644 --- a/lib/iris/tests/stock/__init__.py +++ b/lib/iris/tests/stock/__init__.py @@ -3,6 +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. """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/stock/mesh.py b/lib/iris/tests/stock/mesh.py index 3520436f66..4d0e8ae658 100644 --- a/lib/iris/tests/stock/mesh.py +++ b/lib/iris/tests/stock/mesh.py @@ -4,7 +4,6 @@ # See LICENSE in the root of the repository for full licensing details. """Helper functions making objects for unstructured mesh testing.""" - import numpy as np from iris.coords import AuxCoord, DimCoord diff --git a/lib/iris/tests/test_coding_standards.py b/lib/iris/tests/test_coding_standards.py index 9db9433938..2f14ea703e 100644 --- a/lib/iris/tests/test_coding_standards.py +++ b/lib/iris/tests/test_coding_standards.py @@ -130,7 +130,7 @@ def test_categorised_warnings(): r"""To ensure that all UserWarnings raised by Iris are categorised, for ease of use. No obvious category? Use the parent: - :class:`iris.exceptions.IrisUserWarning`. + :class:`iris.warnings.IrisUserWarning`. Warning matches multiple categories? Create a one-off combo class. For example: diff --git a/lib/iris/tests/test_concatenate.py b/lib/iris/tests/test_concatenate.py index d4be638087..de324e6dd3 100644 --- a/lib/iris/tests/test_concatenate.py +++ b/lib/iris/tests/test_concatenate.py @@ -16,8 +16,8 @@ from iris.aux_factory import HybridHeightFactory from iris.coords import AncillaryVariable, AuxCoord, CellMeasure, DimCoord import iris.cube -from iris.exceptions import IrisUserWarning import iris.tests.stock as stock +from iris.warnings import IrisUserWarning def _make_cube( diff --git a/lib/iris/tests/test_coord_api.py b/lib/iris/tests/test_coord_api.py index 70cbd15899..50ae3b2696 100644 --- a/lib/iris/tests/test_coord_api.py +++ b/lib/iris/tests/test_coord_api.py @@ -16,7 +16,6 @@ import iris.aux_factory import iris.coord_systems import iris.coords -import iris.exceptions import iris.tests.stock diff --git a/lib/iris/tests/test_coordsystem.py b/lib/iris/tests/test_coordsystem.py index 69aeeaa1b1..f7ee34d0fc 100644 --- a/lib/iris/tests/test_coordsystem.py +++ b/lib/iris/tests/test_coordsystem.py @@ -17,8 +17,8 @@ ) import iris.coords import iris.cube -from iris.exceptions import IrisUserWarning import iris.tests.stock +from iris.warnings import IrisUserWarning def osgb(): diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index da7cabe765..1bc8f2e70e 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -14,8 +14,8 @@ import iris from iris.aux_factory import HybridHeightFactory, HybridPressureFactory -from iris.exceptions import IrisIgnoringBoundsWarning import iris.tests.stock +from iris.warnings import IrisIgnoringBoundsWarning @tests.skip_plot diff --git a/lib/iris/tests/test_iterate.py b/lib/iris/tests/test_iterate.py index 662707c327..749e8650db 100644 --- a/lib/iris/tests/test_iterate.py +++ b/lib/iris/tests/test_iterate.py @@ -18,9 +18,9 @@ import iris import iris.analysis -from iris.exceptions import IrisUserWarning import iris.iterate import iris.tests.stock +from iris.warnings import IrisUserWarning @tests.skip_data diff --git a/lib/iris/tests/test_netcdf.py b/lib/iris/tests/test_netcdf.py index 049ff55369..3cdac260b3 100644 --- a/lib/iris/tests/test_netcdf.py +++ b/lib/iris/tests/test_netcdf.py @@ -22,7 +22,6 @@ from iris._lazy_data import is_lazy_data import iris.analysis.trajectory import iris.coord_systems as icoord_systems -from iris.exceptions import IrisCfSaveWarning from iris.fileformats._nc_load_rules import helpers as ncload_helpers import iris.fileformats.netcdf from iris.fileformats.netcdf import _thread_safe_nc @@ -31,6 +30,7 @@ import iris.tests.stock as stock from iris.tests.stock.netcdf import ncgen_from_cdl import iris.util +from iris.warnings import IrisCfSaveWarning @tests.skip_data diff --git a/lib/iris/tests/unit/analysis/cartography/test_project.py b/lib/iris/tests/unit/analysis/cartography/test_project.py index 35c22af363..65796b5611 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_project.py +++ b/lib/iris/tests/unit/analysis/cartography/test_project.py @@ -15,9 +15,9 @@ import iris.coord_systems import iris.coords import iris.cube -from iris.exceptions import IrisDefaultingWarning import iris.tests import iris.tests.stock +from iris.warnings import IrisDefaultingWarning ROBINSON = ccrs.Robinson() diff --git a/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py b/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py index 5d7d39dfc4..d98f47975d 100644 --- a/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py +++ b/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py @@ -16,8 +16,8 @@ from iris.analysis.geometry import geometry_area_weights from iris.coords import DimCoord from iris.cube import Cube -from iris.exceptions import IrisGeometryExceedWarning import iris.tests.stock as stock +from iris.warnings import IrisGeometryExceedWarning class Test(tests.IrisTest): diff --git a/lib/iris/tests/unit/conftest.py b/lib/iris/tests/unit/conftest.py index a4ddb89294..524ca53ce8 100644 --- a/lib/iris/tests/unit/conftest.py +++ b/lib/iris/tests/unit/conftest.py @@ -3,6 +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. """Unit tests fixture infra-structure.""" + import pytest import iris diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index c6f740c492..c0accfe071 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -19,8 +19,9 @@ import iris from iris.coords import AuxCoord, Coord, DimCoord from iris.cube import Cube -from iris.exceptions import IrisVagueMetadataWarning, UnitConversionError +from iris.exceptions import UnitConversionError from iris.tests.unit.coords import CoordTestMixin +from iris.warnings import IrisVagueMetadataWarning Pair = collections.namedtuple("Pair", "points bounds") diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index 3de44eefa0..ec94e346b2 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -33,12 +33,11 @@ AncillaryVariableNotFoundError, CellMeasureNotFoundError, CoordinateNotFoundError, - IrisUserWarning, - IrisVagueMetadataWarning, UnitConversionError, ) import iris.tests.stock as stock from iris.tests.stock.mesh import sample_mesh, sample_mesh_cube, sample_meshcoord +from iris.warnings import IrisUserWarning, IrisVagueMetadataWarning class Test___init___data(tests.IrisTest): diff --git a/lib/iris/tests/unit/cube/test_Cube__aggregated_by.py b/lib/iris/tests/unit/cube/test_Cube__aggregated_by.py index 67d66373ff..64c99ebd4b 100644 --- a/lib/iris/tests/unit/cube/test_Cube__aggregated_by.py +++ b/lib/iris/tests/unit/cube/test_Cube__aggregated_by.py @@ -20,7 +20,6 @@ import iris.coords from iris.coords import AncillaryVariable, AuxCoord, CellMeasure, DimCoord from iris.cube import Cube -import iris.exceptions from iris.tests.stock import realistic_4d diff --git a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridAuxiliaryCoordinateVariable.py b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridAuxiliaryCoordinateVariable.py index 5f613840a3..f283dd22db 100644 --- a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridAuxiliaryCoordinateVariable.py +++ b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridAuxiliaryCoordinateVariable.py @@ -8,6 +8,7 @@ standard behaviour. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip @@ -18,11 +19,11 @@ import numpy as np import pytest -import iris.exceptions from iris.experimental.ugrid.cf import CFUGridAuxiliaryCoordinateVariable from iris.tests.unit.experimental.ugrid.cf.test_CFUGridReader import ( netcdf_ugrid_variable, ) +import iris.warnings def named_variable(name): @@ -201,7 +202,7 @@ def test_warn(self): def operation(warn: bool): warnings.warn( "emit at least 1 warning", - category=iris.exceptions.IrisUserWarning, + category=iris.warnings.IrisUserWarning, ) result = CFUGridAuxiliaryCoordinateVariable.identify(vars_all, warn=warn) self.assertDictEqual({}, result) @@ -210,7 +211,7 @@ def operation(warn: bool): warn_regex = ( rf"Missing CF-netCDF auxiliary coordinate variable {subject_name}.*" ) - with pytest.warns(iris.exceptions.IrisCfMissingVarWarning, match=warn_regex): + with pytest.warns(iris.warnings.IrisCfMissingVarWarning, match=warn_regex): operation(warn=True) with pytest.warns() as record: operation(warn=False) @@ -220,7 +221,7 @@ def operation(warn: bool): # String variable warning. warn_regex = r".*is a CF-netCDF label variable.*" vars_all[subject_name] = netcdf_ugrid_variable(subject_name, "", np.bytes_) - with pytest.warns(iris.exceptions.IrisCfLabelVarWarning, match=warn_regex): + with pytest.warns(iris.warnings.IrisCfLabelVarWarning, match=warn_regex): operation(warn=True) with pytest.warns() as record: operation(warn=False) diff --git a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridConnectivityVariable.py b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridConnectivityVariable.py index dcddfa08b8..d412b8838a 100644 --- a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridConnectivityVariable.py +++ b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridConnectivityVariable.py @@ -8,6 +8,7 @@ standard behaviour. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip @@ -18,12 +19,12 @@ import numpy as np import pytest -import iris.exceptions from iris.experimental.ugrid.cf import CFUGridConnectivityVariable from iris.experimental.ugrid.mesh import Connectivity from iris.tests.unit.experimental.ugrid.cf.test_CFUGridReader import ( netcdf_ugrid_variable, ) +import iris.warnings def named_variable(name): @@ -186,14 +187,14 @@ def test_warn(self): def operation(warn: bool): warnings.warn( "emit at least 1 warning", - category=iris.exceptions.IrisUserWarning, + category=iris.warnings.IrisUserWarning, ) result = CFUGridConnectivityVariable.identify(vars_all, warn=warn) self.assertDictEqual({}, result) # Missing warning. warn_regex = rf"Missing CF-UGRID connectivity variable {subject_name}.*" - with pytest.warns(iris.exceptions.IrisCfMissingVarWarning, match=warn_regex): + with pytest.warns(iris.warnings.IrisCfMissingVarWarning, match=warn_regex): operation(warn=True) with pytest.warns() as record: operation(warn=False) @@ -203,7 +204,7 @@ def operation(warn: bool): # String variable warning. warn_regex = r".*is a CF-netCDF label variable.*" vars_all[subject_name] = netcdf_ugrid_variable(subject_name, "", np.bytes_) - with pytest.warns(iris.exceptions.IrisCfLabelVarWarning, match=warn_regex): + with pytest.warns(iris.warnings.IrisCfLabelVarWarning, match=warn_regex): operation(warn=True) with pytest.warns() as record: operation(warn=False) diff --git a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridGroup.py b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridGroup.py index 9577955f97..6db067fe25 100644 --- a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridGroup.py +++ b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridGroup.py @@ -8,6 +8,7 @@ standard behaviour. """ + # 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/cf/test_CFUGridMeshVariable.py b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridMeshVariable.py index ccefe01b3c..32c96cacbc 100644 --- a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridMeshVariable.py +++ b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridMeshVariable.py @@ -8,6 +8,7 @@ standard behaviour. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests # isort:skip @@ -18,11 +19,11 @@ import numpy as np import pytest -import iris.exceptions from iris.experimental.ugrid.cf import CFUGridMeshVariable from iris.tests.unit.experimental.ugrid.cf.test_CFUGridReader import ( netcdf_ugrid_variable, ) +import iris.warnings def named_variable(name): @@ -233,14 +234,14 @@ def test_warn(self): def operation(warn: bool): warnings.warn( "emit at least 1 warning", - category=iris.exceptions.IrisUserWarning, + category=iris.warnings.IrisUserWarning, ) result = CFUGridMeshVariable.identify(vars_all, warn=warn) self.assertDictEqual({}, result) # Missing warning. warn_regex = rf"Missing CF-UGRID mesh variable {subject_name}.*" - with pytest.warns(iris.exceptions.IrisCfMissingVarWarning, match=warn_regex): + with pytest.warns(iris.warnings.IrisCfMissingVarWarning, match=warn_regex): operation(warn=True) with pytest.warns() as record: operation(warn=False) @@ -250,7 +251,7 @@ def operation(warn: bool): # String variable warning. warn_regex = r".*is a CF-netCDF label variable.*" vars_all[subject_name] = netcdf_ugrid_variable(subject_name, "", np.bytes_) - with pytest.warns(iris.exceptions.IrisCfLabelVarWarning, match=warn_regex): + with pytest.warns(iris.warnings.IrisCfLabelVarWarning, match=warn_regex): operation(warn=True) with pytest.warns() as record: operation(warn=False) diff --git a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridReader.py b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridReader.py index cb2ae41d72..14278d3dff 100644 --- a/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridReader.py +++ b/lib/iris/tests/unit/experimental/ugrid/cf/test_CFUGridReader.py @@ -8,6 +8,7 @@ standard behaviour. """ + # 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_ParseUgridOnLoad.py b/lib/iris/tests/unit/experimental/ugrid/load/test_ParseUgridOnLoad.py index 7ccdeee08b..8f85699037 100644 --- a/lib/iris/tests/unit/experimental/ugrid/load/test_ParseUgridOnLoad.py +++ b/lib/iris/tests/unit/experimental/ugrid/load/test_ParseUgridOnLoad.py @@ -7,6 +7,7 @@ todo: remove this module when experimental.ugrid is folded into standard behaviour. """ + # 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_mesh.py b/lib/iris/tests/unit/experimental/ugrid/load/test_load_mesh.py index 382a36fa71..6e78057746 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 @@ -3,6 +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. """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 8932989252..cef142b424 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 @@ -3,6 +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. """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 2282bc07b9..78fa39060e 100644 --- a/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py +++ b/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py @@ -3,6 +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. """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 31c5dbfcc0..aa45e0be70 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 @@ -3,6 +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. """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 fa62a9f7e2..91637ad20b 100644 --- a/lib/iris/tests/unit/experimental/ugrid/metadata/test_ConnectivityMetadata.py +++ b/lib/iris/tests/unit/experimental/ugrid/metadata/test_ConnectivityMetadata.py @@ -3,6 +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. """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 fc9242a8f9..0434149674 100644 --- a/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshCoordMetadata.py +++ b/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshCoordMetadata.py @@ -3,6 +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. """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 080d94c188..abbb4c0304 100644 --- a/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshMetadata.py +++ b/lib/iris/tests/unit/experimental/ugrid/metadata/test_MeshMetadata.py @@ -3,6 +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. """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 f01dc345fa..1c0fafdfc9 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 @@ -3,6 +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. """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 667c679bfb..80338ea71e 100644 --- a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py +++ b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py @@ -301,10 +301,13 @@ def test_promote_reference(self): def test_formula_terms_ignore(self): self.orography.dimensions = ["lat", "wibble"] - with mock.patch( - "iris.fileformats.netcdf._thread_safe_nc.DatasetWrapper", - return_value=self.dataset, - ), mock.patch("warnings.warn") as warn: + with ( + mock.patch( + "iris.fileformats.netcdf._thread_safe_nc.DatasetWrapper", + return_value=self.dataset, + ), + mock.patch("warnings.warn") as warn, + ): cf_group = CFReader("dummy").cf_group group = cf_group.promoted self.assertEqual(list(group.keys()), ["orography"]) @@ -313,10 +316,13 @@ def test_formula_terms_ignore(self): def test_auxiliary_ignore(self): self.x.dimensions = ["lat", "wibble"] - with mock.patch( - "iris.fileformats.netcdf._thread_safe_nc.DatasetWrapper", - return_value=self.dataset, - ), mock.patch("warnings.warn") as warn: + with ( + mock.patch( + "iris.fileformats.netcdf._thread_safe_nc.DatasetWrapper", + return_value=self.dataset, + ), + mock.patch("warnings.warn") as warn, + ): cf_group = CFReader("dummy").cf_group promoted = ["x", "orography"] group = cf_group.promoted @@ -329,10 +335,13 @@ def test_promoted_auxiliary_ignore(self): self.wibble = netcdf_variable("wibble", "lat wibble", np.float64) self.variables["wibble"] = self.wibble self.orography.coordinates = "wibble" - with mock.patch( - "iris.fileformats.netcdf._thread_safe_nc.DatasetWrapper", - return_value=self.dataset, - ), mock.patch("warnings.warn") as warn: + with ( + mock.patch( + "iris.fileformats.netcdf._thread_safe_nc.DatasetWrapper", + return_value=self.dataset, + ), + mock.patch("warnings.warn") as warn, + ): cf_group = CFReader("dummy").cf_group.promoted promoted = ["wibble", "orography"] self.assertEqual(set(cf_group.keys()), set(promoted)) diff --git a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py index 2c19bdc12e..c21fc39821 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py @@ -14,10 +14,11 @@ import numpy as np -from iris.exceptions import IrisLoadWarning, NotYetImplementedError +from iris.exceptions import NotYetImplementedError import iris.fileformats._ff as ff from iris.fileformats._ff import FF2PP import iris.fileformats.pp as pp +from iris.warnings import IrisLoadWarning # PP-field: LBPACK N1 values. _UNPACKED = 0 @@ -84,13 +85,13 @@ def mock_for_extract_field(self, fields, x=None, y=None): ff2pp._ff_header.grid = mock.Mock(return_value=grid) open_func = "builtins.open" - with mock.patch( - "iris.fileformats._ff._parse_binary_stream", return_value=[0] - ), mock.patch(open_func), mock.patch( - "struct.unpack_from", return_value=[4] - ), mock.patch( - "iris.fileformats.pp.make_pp_field", side_effect=fields - ), mock.patch("iris.fileformats._ff.FF2PP._payload", return_value=(0, 0)): + with ( + mock.patch("iris.fileformats._ff._parse_binary_stream", return_value=[0]), + mock.patch(open_func), + mock.patch("struct.unpack_from", return_value=[4]), + mock.patch("iris.fileformats.pp.make_pp_field", side_effect=fields), + mock.patch("iris.fileformats._ff.FF2PP._payload", return_value=(0, 0)), + ): yield ff2pp def _mock_lbc(self, **kwargs): 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 98dc5000bc..ff80acf95b 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 @@ -11,8 +11,8 @@ from unittest import mock import iris.coords -from iris.exceptions import IrisLoadWarning from iris.fileformats.name_loaders import _build_cell_methods +from iris.warnings import IrisLoadWarning class Tests(tests.IrisTest): 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 ac20e95682..9d1c1d742a 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 @@ -3,17 +3,18 @@ # 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`.""" + from pathlib import Path import shutil import tempfile import warnings -from iris.exceptions import IrisLoadWarning import iris.fileformats._nc_load_rules.engine from iris.fileformats.cf import CFReader import iris.fileformats.netcdf from iris.fileformats.netcdf.loader import _load_cube from iris.tests.stock.netcdf import ncgen_from_cdl +from iris.warnings import IrisLoadWarning """ Notes on testing method. diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__grid_mappings.py b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__grid_mappings.py index 72e9448255..8c2e30a902 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__grid_mappings.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__grid_mappings.py @@ -8,6 +8,7 @@ Here, *specifically* testcases relating to grid-mappings and dim-coords. """ + import iris.tests as tests # isort: skip import iris.coord_systems as ics diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__hybrid_formulae.py b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__hybrid_formulae.py index 5af6d6fa1d..65b0ecd94e 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__hybrid_formulae.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__hybrid_formulae.py @@ -8,6 +8,7 @@ Test rules activation relating to hybrid vertical coordinates. """ + import iris.tests as tests # isort: skip import iris.fileformats._nc_load_rules.helpers as hh diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__latlon_dimcoords.py b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__latlon_dimcoords.py index e6a2c203b7..499088a802 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__latlon_dimcoords.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__latlon_dimcoords.py @@ -9,6 +9,7 @@ rotated and non-rotated. """ + import iris.tests as tests # isort: skip from iris.coord_systems import GeogCS, RotatedGeogCS diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__miscellaneous.py b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__miscellaneous.py index a7d5a10e73..15d8afe880 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__miscellaneous.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__miscellaneous.py @@ -12,6 +12,7 @@ * ancillary variables """ + import iris.tests as tests # isort: skip from iris.coords import AncillaryVariable, AuxCoord, CellMeasure diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__time_coords.py b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__time_coords.py index b3c2fe9b0b..c19dffd6e2 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__time_coords.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__time_coords.py @@ -8,6 +8,7 @@ Tests for rules activation relating to 'time' and 'time_period' coords. """ + import iris.tests as tests # isort: skip from iris.coords import AuxCoord, DimCoord 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 7aaca67326..71280e5f60 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 @@ -3,6 +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. """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__normalise_bounds_units.py b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test__normalise_bounds_units.py index f6233847e4..337279426e 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test__normalise_bounds_units.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test__normalise_bounds_units.py @@ -12,11 +12,11 @@ import numpy as np import pytest -from iris.exceptions import IrisCfLoadWarning from iris.fileformats._nc_load_rules.helpers import ( _normalise_bounds_units, _WarnComboIgnoringCfLoad, ) +from iris.warnings import IrisCfLoadWarning BOUNDS = mock.sentinel.bounds CF_NAME = "dummy_bnds" diff --git a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_auxiliary_coordinate.py b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_auxiliary_coordinate.py index 73533a9c33..b43317901f 100644 --- a/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_auxiliary_coordinate.py +++ b/lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_auxiliary_coordinate.py @@ -6,6 +6,7 @@ build_auxilliary_coordinate`. """ + # 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/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 3e12e33762..50b171655e 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 @@ -3,6 +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. """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 500ecd51d8..0f8fd0152f 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 @@ -11,8 +11,8 @@ from unittest import mock from iris.coords import CellMethod -from iris.exceptions import IrisCfLoadWarning from iris.fileformats._nc_load_rules.helpers import parse_cell_methods +from iris.warnings import IrisCfLoadWarning class Test(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/netcdf/loader/test__chunk_control.py b/lib/iris/tests/unit/fileformats/netcdf/loader/test__chunk_control.py index bc7911578a..bb6bfd4dcc 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/loader/test__chunk_control.py +++ b/lib/iris/tests/unit/fileformats/netcdf/loader/test__chunk_control.py @@ -133,8 +133,9 @@ def test_invalid_var_name(tmp_filepath, save_cubelist_with_sigma): def test_control_multiple(tmp_filepath, save_cubelist_with_sigma): cube_varname, sigma_varname = save_cubelist_with_sigma - with CHUNK_CONTROL.set(cube_varname, model_level_number=2), CHUNK_CONTROL.set( - sigma_varname, model_level_number=3 + with ( + CHUNK_CONTROL.set(cube_varname, model_level_number=2), + CHUNK_CONTROL.set(sigma_varname, model_level_number=3), ): cubes = CubeList(loader.load_cubes(tmp_filepath)) cube = cubes.extract_cube(cube_varname) diff --git a/lib/iris/tests/unit/fileformats/netcdf/loader/test__get_cf_var_data.py b/lib/iris/tests/unit/fileformats/netcdf/loader/test__get_cf_var_data.py index 9aa696bccd..92cb93496e 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/loader/test__get_cf_var_data.py +++ b/lib/iris/tests/unit/fileformats/netcdf/loader/test__get_cf_var_data.py @@ -3,6 +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. """Unit tests for the `iris.fileformats.netcdf._get_cf_var_data` 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/fileformats/netcdf/loader/test__load_aux_factory.py b/lib/iris/tests/unit/fileformats/netcdf/loader/test__load_aux_factory.py index eacdee2782..5aafeaf0fc 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/loader/test__load_aux_factory.py +++ b/lib/iris/tests/unit/fileformats/netcdf/loader/test__load_aux_factory.py @@ -15,8 +15,8 @@ from iris.coords import DimCoord from iris.cube import Cube -from iris.exceptions import IrisFactoryCoordNotFoundWarning from iris.fileformats.netcdf.loader import _load_aux_factory +from iris.warnings import IrisFactoryCoordNotFoundWarning class TestAtmosphereHybridSigmaPressureCoordinate(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver.py index 28ef972c8c..744051f02d 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver.py @@ -32,9 +32,9 @@ ) from iris.coords import AuxCoord, DimCoord from iris.cube import Cube -from iris.exceptions import IrisMaskValueMatchWarning from iris.fileformats.netcdf import Saver, _thread_safe_nc import iris.tests.stock as stock +from iris.warnings import IrisMaskValueMatchWarning class Test_write(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__lazy_stream_data.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__lazy_stream_data.py index 69eabac5f5..f252d53a47 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__lazy_stream_data.py +++ b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__lazy_stream_data.py @@ -9,6 +9,7 @@ integration tests. """ + from unittest import mock import warnings @@ -16,9 +17,9 @@ import numpy as np import pytest -from iris.exceptions import IrisMaskValueMatchWarning import iris.fileformats.netcdf._thread_safe_nc as threadsafe_nc from iris.fileformats.netcdf.saver import Saver, _FillvalueCheckInfo +from iris.warnings import IrisMaskValueMatchWarning class Test__lazy_stream_data: diff --git a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py index 241ff5a5cc..14da76ded8 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py +++ b/lib/iris/tests/unit/fileformats/netcdf/saver/test_Saver__ugrid.py @@ -8,6 +8,7 @@ :mod:`iris.tests.unit.fileformats.netcdf.test_Saver__lazy.` """ + # 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/netcdf/saver/test__fillvalue_report.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test__fillvalue_report.py index c0046e547a..32059bb058 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 @@ -3,14 +3,15 @@ # 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`.""" + import warnings import numpy as np import pytest -from iris.exceptions import IrisSaverFillValueWarning from iris.fileformats.netcdf._thread_safe_nc import default_fillvals from iris.fileformats.netcdf.saver import _fillvalue_report, _FillvalueCheckInfo +from iris.warnings import IrisSaverFillValueWarning class Test__fillvaluereport: diff --git a/lib/iris/tests/unit/fileformats/netcdf/saver/test_save.py b/lib/iris/tests/unit/fileformats/netcdf/saver/test_save.py index 1f0a39f050..ae85dc1aab 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/saver/test_save.py +++ b/lib/iris/tests/unit/fileformats/netcdf/saver/test_save.py @@ -3,6 +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. """Unit tests for the :func:`iris.fileformats.netcdf.save` 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/fileformats/pp/test_PPField.py b/lib/iris/tests/unit/fileformats/pp/test_PPField.py index de7c2b1ba5..f3aed0bea2 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_PPField.py +++ b/lib/iris/tests/unit/fileformats/pp/test_PPField.py @@ -12,9 +12,9 @@ import numpy as np -from iris.exceptions import IrisDefaultingWarning, IrisMaskValueMatchWarning import iris.fileformats.pp as pp from iris.fileformats.pp import PPField, SplittableInt +from iris.warnings import IrisDefaultingWarning, IrisMaskValueMatchWarning # The PPField class is abstract, so to test we define a minimal, # concrete subclass with the `t1` and `t2` properties. diff --git a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py index 80b90fc8d2..f1018d8df4 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py +++ b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py @@ -34,11 +34,14 @@ def make_pp_field_override(*args): return result open_func = "builtins.open" - with mock.patch("numpy.fromfile", return_value=[0]), mock.patch( - open_func - ), mock.patch("struct.unpack_from", return_value=[4]), mock.patch( - "iris.fileformats.pp.make_pp_field", - side_effect=make_pp_field_override, + with ( + mock.patch("numpy.fromfile", return_value=[0]), + mock.patch(open_func), + mock.patch("struct.unpack_from", return_value=[4]), + mock.patch( + "iris.fileformats.pp.make_pp_field", + side_effect=make_pp_field_override, + ), ): yield diff --git a/lib/iris/tests/unit/plot/test_hist.py b/lib/iris/tests/unit/plot/test_hist.py index feef8f1062..9c1740587c 100644 --- a/lib/iris/tests/unit/plot/test_hist.py +++ b/lib/iris/tests/unit/plot/test_hist.py @@ -3,6 +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. """Unit tests for the `iris.plot.hist` 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/representation/cube_printout/test_CubePrintout.py b/lib/iris/tests/unit/representation/cube_printout/test_CubePrintout.py index d7b617d848..e3ee535346 100644 --- a/lib/iris/tests/unit/representation/cube_printout/test_CubePrintout.py +++ b/lib/iris/tests/unit/representation/cube_printout/test_CubePrintout.py @@ -3,6 +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. """Unit tests for :class:`iris._representation.cube_printout.CubePrintout`.""" + import iris.tests as tests # isort:skip import numpy as np @@ -124,9 +125,9 @@ def test_columns_long_coordname(self): def test_columns_long_attribute(self): cube = Cube([0], long_name="short", units=1) - cube.attributes[ - "very_very_very_very_very_long_name" - ] = "longish string extends beyond dim columns" + cube.attributes["very_very_very_very_very_long_name"] = ( + "longish string extends beyond dim columns" + ) rep = cube_replines(cube) expected = [ "short / (1) (-- : 1)", diff --git a/lib/iris/tests/unit/representation/cube_printout/test_Table.py b/lib/iris/tests/unit/representation/cube_printout/test_Table.py index 0e00da7c42..6c765516b1 100644 --- a/lib/iris/tests/unit/representation/cube_printout/test_Table.py +++ b/lib/iris/tests/unit/representation/cube_printout/test_Table.py @@ -3,6 +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. """Unit tests for :class:`iris._representation.cube_printout.Table`.""" + from iris._representation.cube_printout import Table import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_broadcast_to_shape.py b/lib/iris/tests/unit/util/test_broadcast_to_shape.py index 6e32d6389d..503d0669de 100644 --- a/lib/iris/tests/unit/util/test_broadcast_to_shape.py +++ b/lib/iris/tests/unit/util/test_broadcast_to_shape.py @@ -21,14 +21,17 @@ class Test_broadcast_to_shape(tests.IrisTest): def test_same_shape(self): # broadcast to current shape should result in no change - a = np.random.random([2, 3]) + rng = np.random.default_rng() + a = rng.random((2, 3)) + b = broadcast_to_shape(a, a.shape, (0, 1)) self.assertArrayEqual(b, a) def test_added_dimensions(self): # adding two dimensions, on at the front and one in the middle of # the existing dimensions - a = np.random.random([2, 3]) + rng = np.random.default_rng() + a = rng.random((2, 3)) b = broadcast_to_shape(a, (5, 2, 4, 3), (1, 3)) for i in range(5): for j in range(4): @@ -37,7 +40,8 @@ def test_added_dimensions(self): def test_added_dimensions_transpose(self): # adding dimensions and having the dimensions of the input # transposed - a = np.random.random([2, 3]) + rng = np.random.default_rng() + a = rng.random((2, 3)) b = broadcast_to_shape(a, (5, 3, 4, 2), (3, 1)) for i in range(5): for j in range(4): @@ -47,7 +51,8 @@ def test_added_dimensions_transpose(self): def test_lazy_added_dimensions_transpose(self, mocked_compute): # adding dimensions and having the dimensions of the input # transposed - a = da.random.random([2, 3]) + rng = da.random.default_rng() + a = rng.random((2, 3)) b = broadcast_to_shape(a, (5, 3, 4, 2), (3, 1)) mocked_compute.assert_not_called() for i in range(5): @@ -56,7 +61,8 @@ def test_lazy_added_dimensions_transpose(self, mocked_compute): def test_masked(self): # masked arrays are also accepted - a = np.random.random([2, 3]) + rng = np.random.default_rng() + a = rng.random((2, 3)) m = ma.array(a, mask=[[0, 1, 0], [0, 1, 1]]) b = broadcast_to_shape(m, (5, 3, 4, 2), (3, 1)) for i in range(5): @@ -66,7 +72,8 @@ def test_masked(self): @mock.patch.object(dask.base, "compute", wraps=dask.base.compute) def test_lazy_masked(self, mocked_compute): # masked arrays are also accepted - a = np.random.random([2, 3]) + rng = np.random.default_rng() + a = rng.random((2, 3)) m = da.ma.masked_array(a, mask=[[0, 1, 0], [0, 1, 1]]) b = broadcast_to_shape(m, (5, 3, 4, 2), (3, 1)) mocked_compute.assert_not_called() @@ -76,7 +83,8 @@ def test_lazy_masked(self, mocked_compute): def test_masked_degenerate(self): # masked arrays can have degenerate masks too - a = np.random.random([2, 3]) + rng = np.random.default_rng() + a = rng.random((2, 3)) m = ma.array(a) b = broadcast_to_shape(m, (5, 3, 4, 2), (3, 1)) for i in range(5): diff --git a/lib/iris/tests/unit/util/test_mask_cube_from_shapefile.py b/lib/iris/tests/unit/util/test_mask_cube_from_shapefile.py index bde8007ee2..7a03ea91aa 100644 --- a/lib/iris/tests/unit/util/test_mask_cube_from_shapefile.py +++ b/lib/iris/tests/unit/util/test_mask_cube_from_shapefile.py @@ -11,9 +11,9 @@ from iris.coord_systems import RotatedGeogCS from iris.coords import DimCoord import iris.cube -from iris.exceptions import IrisUserWarning import iris.tests as tests from iris.util import mask_cube_from_shapefile +from iris.warnings import IrisUserWarning class TestBasicCubeMasking(tests.IrisTest): diff --git a/lib/iris/tests/unit/util/test_rolling_window.py b/lib/iris/tests/unit/util/test_rolling_window.py index 8a017e4e08..d70b398ed5 100644 --- a/lib/iris/tests/unit/util/test_rolling_window.py +++ b/lib/iris/tests/unit/util/test_rolling_window.py @@ -8,6 +8,7 @@ # importing anything else import iris.tests as tests # isort:skip +import dask.array as da import numpy as np import numpy.ma as ma @@ -35,6 +36,12 @@ def test_2d(self): result = rolling_window(a, window=3, axis=1) self.assertArrayEqual(result, expected_result) + def test_3d_lazy(self): + a = da.arange(2 * 3 * 4).reshape((2, 3, 4)) + expected_result = np.arange(2 * 3 * 4).reshape((1, 2, 3, 4)) + result = rolling_window(a, window=2, axis=0).compute() + self.assertArrayEqual(result, expected_result) + def test_1d_masked(self): # 1-d masked array input a = ma.array([0, 1, 2, 3, 4], mask=[0, 0, 1, 0, 0], dtype=np.int32) diff --git a/lib/iris/util.py b/lib/iris/util.py index 020b67783a..045e46d072 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -4,6 +4,8 @@ # See LICENSE in the root of the repository for full licensing details. """Miscellaneous utility functions.""" +from __future__ import annotations + from abc import ABCMeta, abstractmethod from collections.abc import Hashable, Iterable import functools @@ -191,7 +193,8 @@ def describe_diff(cube_a, cube_b, output_file=None): See Also -------- - :meth:`iris.cube.Cube.is_compatible()` + iris.cube.Cube.is_compatible : + Check if a Cube is compatible with another. """ if output_file is None: @@ -281,19 +284,24 @@ def guess_coord_axis(coord): return axis -def rolling_window(a, window=1, step=1, axis=-1): +def rolling_window( + a: np.ndarray | da.Array, + window: int = 1, + step: int = 1, + axis: int = -1, +) -> np.ndarray | da.Array: """Make an ndarray with a rolling window of the last dimension. Parameters ---------- a : array_like - Array to add rolling window to + Array to add rolling window to. window : int, default=1 - Size of rolling window + Size of rolling window. step : int, default=1 - Size of step between rolling windows + Size of step between rolling windows. axis : int, default=-1 - Axis to take the rolling window over + Axis to take the rolling window over. Returns ------- @@ -322,8 +330,6 @@ def rolling_window(a, window=1, step=1, axis=-1): See more at :doc:`/userguide/real_and_lazy_data`. """ - # NOTE: The implementation of this function originates from - # https://github.com/numpy/numpy/pull/31#issuecomment-1304851 04/08/2011 if window < 1: raise ValueError("`window` must be at least 1.") if window > a.shape[axis]: @@ -331,25 +337,26 @@ def rolling_window(a, window=1, step=1, axis=-1): if step < 1: raise ValueError("`step` must be at least 1.") axis = axis % a.ndim - num_windows = (a.shape[axis] - window + step) // step - shape = a.shape[:axis] + (num_windows, window) + a.shape[axis + 1 :] - strides = ( - a.strides[:axis] - + (step * a.strides[axis], a.strides[axis]) - + a.strides[axis + 1 :] + array_module = da if isinstance(a, da.Array) else np + steps = tuple( + slice(None, None, step) if i == axis else slice(None) for i in range(a.ndim) ) - rw = np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides) - if ma.isMaskedArray(a): - mask = ma.getmaskarray(a) - strides = ( - mask.strides[:axis] - + (step * mask.strides[axis], mask.strides[axis]) - + mask.strides[axis + 1 :] - ) - rw = ma.array( - rw, - mask=np.lib.stride_tricks.as_strided(mask, shape=shape, strides=strides), + + def _rolling_window(array): + return array_module.moveaxis( + array_module.lib.stride_tricks.sliding_window_view( + array, + window_shape=window, + axis=axis, + )[steps], + -1, + axis + 1, ) + + rw = _rolling_window(a) + if isinstance(da.utils.meta_from_array(a), np.ma.MaskedArray): + mask = _rolling_window(array_module.ma.getmaskarray(a)) + rw = array_module.ma.masked_array(rw, mask) return rw @@ -359,7 +366,7 @@ def array_equal(array1, array2, withnans=False): Parameters ---------- array1, array2 : arraylike - args to be compared, normalised if necessary with :func:`np.asarray`. + Args to be compared, normalised if necessary with :func:`np.asarray`. withnans : bool, default=False When unset (default), the result is False if either input contains NaN points. This is the normal floating-point arithmetic result. @@ -400,6 +407,11 @@ def approx_equal(a, b, max_absolute_error=1e-10, max_relative_error=1e-10): Returns whether two numbers are almost equal, allowing for the finite precision of floating point numbers. + Notes + ----- + This function does maintain laziness when called; it doesn't realise data. + See more at :doc:`/userguide/real_and_lazy_data`. + .. deprecated:: 3.2.0 Instead use :func:`math.isclose`. For example, rather than calling @@ -408,11 +420,6 @@ def approx_equal(a, b, max_absolute_error=1e-10, max_relative_error=1e-10): if the actual error equals the maximum, whereas :func:`util.approx_equal` will return False. - Notes - ----- - This function does maintain laziness when called; it doesn't realise data. - See more at :doc:`/userguide/real_and_lazy_data`. - """ wmsg = ( "iris.util.approx_equal has been deprecated and will be removed, " @@ -438,9 +445,9 @@ def between(lh, rh, lh_inclusive=True, rh_inclusive=True): Parameters ---------- lh : - The left hand element of the inequality + The left hand element of the inequality. rh : - The right hand element of the inequality + The right hand element of the inequality. lh_inclusive : bool, default=True Affects the left hand comparison operator to use in the inequality. True for ``<=`` false for ``<``. Defaults to True. @@ -581,7 +588,7 @@ def monotonic(array, strict=False, return_direction=False): Parameters ---------- strict : bool, default=False - Flag to enable strict monotonic checking + Flag to enable strict monotonic checking. return_direction : bool, default=False Flag to change return behaviour to return (monotonic_status, direction). Direction will be 1 for positive @@ -590,11 +597,9 @@ def monotonic(array, strict=False, return_direction=False): Returns ------- - monotonic_status : bool - Whether the array was monotonic. - - If the return_direction flag was given then the returned value - will be: ``(monotonic_status, direction)`` + bool + Whether the array was monotonic. If the return_direction flag was given + then the returned value will be: ``(monotonic_status, direction)``. Notes ----- @@ -783,9 +788,9 @@ def _slice_data_with_keys(data, keys): Parameters ---------- data : array-like - array to index. + Array to index. keys : list - list of indexes, as received from a __getitem__ call. + List of indexes, as received from a __getitem__ call. Returns ------- @@ -801,7 +806,7 @@ def _slice_data_with_keys(data, keys): both 'real' (numpy) arrays and other array-likes index in the same way, instead of numpy arrays doing 'fancy indexing'. - .. Note:: + .. note:: Avoids copying the data, where possible. @@ -1022,7 +1027,7 @@ def clip_string(the_str, clip_length=70, rider="..."): Parameters ---------- the_str : str - The string to be clipped + The string to be clipped. clip_length : int, default=70 The length in characters that the input string should be clipped to. Defaults to a preconfigured value if not specified. @@ -1101,7 +1106,7 @@ def new_axis(src_cube, scalar_coord=None, expand_extras=()): # maybe not lazy ---------- src_cube : :class:`iris.cube.Cube` Source cube on which to generate a new axis. - scalar_coord : :class:`iris.coord.Coord` or 'string', optional + scalar_coord : :class:`iris.coord.Coord` or str, optional Scalar coordinate to promote to a dimension coordinate. expand_extras : iterable, optional Auxiliary coordinates, ancillary variables and cell measures which will @@ -1531,7 +1536,7 @@ def promote_aux_coord_to_dim_coord(cube, name_or_coord): Parameters ---------- cube : - An instance of :class:`iris.cube.Cube` + An instance of :class:`iris.cube.Cube`. name_or_coord : * \(a) An instance of :class:`iris.coords.AuxCoord` * \(b) the :attr:`standard_name`, :attr:`long_name`, or @@ -1643,7 +1648,7 @@ def promote_aux_coord_to_dim_coord(cube, name_or_coord): def demote_dim_coord_to_aux_coord(cube, name_or_coord): - r"""Demotes a dimension coordinate on the cube to an auxiliary coordinate. + r"""Demote a dimension coordinate on the cube to an auxiliary coordinate. The DimCoord is demoted to an auxiliary coordinate on the cube. The dimension of the cube that was associated with the DimCoord becomes @@ -1653,7 +1658,7 @@ def demote_dim_coord_to_aux_coord(cube, name_or_coord): Parameters ---------- cube : - An instance of :class:`iris.cube.Cube` + An instance of :class:`iris.cube.Cube`. name_or_coord : * \(a) An instance of :class:`iris.coords.DimCoord` * \(b) the :attr:`standard_name`, :attr:`long_name`, or @@ -1768,8 +1773,8 @@ def find_discontiguities(cube, rel_tol=1e-5, abs_tol=1e-8): Returns ------- - result : `numpy.ndarray` of bool - true/false map of which cells in the cube XY grid have + numpy.ndarray + Boolean True/false map of which cells in the cube XY grid have discontiguities in the coordinate points array. This can be used as the input array for @@ -1895,7 +1900,7 @@ def _mask_array(array, points_to_mask, in_place=False): @_lenient_client(services=SERVICES) def mask_cube(cube, points_to_mask, in_place=False, dim=None): - """Masks any cells in the cube's data array. + """Mask any cells in the cube's data array. Masks any cells in the cube's data array which correspond to cells marked ``True`` (or non zero) in ``points_to_mask``. ``points_to_mask`` may be @@ -2098,12 +2103,12 @@ def mask_cube_from_shapefile(cube, shape, minimum_weight=0.0, in_place=False): Parameters ---------- + cube : :class:`~iris.cube.Cube` object + The `Cube` object to masked. Must be singular, rather than a `CubeList`. shape : Shapely.Geometry object A single `shape` of the area to remain unmasked on the `cube`. If it a line object of some kind then minimum_weight will be ignored, - because you cannot compare the area of a 1D line and 2D Cell - cube : :class:`~iris.cube.Cube` object - The `Cube` object to masked. Must be singular, rather than a `CubeList` + because you cannot compare the area of a 1D line and 2D Cell. minimum_weight : float , default=0.0 A number between 0-1 describing what % of a cube cell area must the shape overlap to include it. @@ -2114,12 +2119,12 @@ def mask_cube_from_shapefile(cube, shape, minimum_weight=0.0, in_place=False): Returns ------- iris.Cube - A masked version of the input cube, if in_place is False - + A masked version of the input cube, if in_place is False. See Also -------- :func:`~iris.util.mask_cube` + Mask any cells in the cube’s data array. Notes ----- @@ -2141,7 +2146,6 @@ def mask_cube_from_shapefile(cube, shape, minimum_weight=0.0, in_place=False): >>> shape = shapely.geometry.box(-100,30, -80,40) # box between 30N-40N 100W-80W >>> masked_cube = mask_cube_from_shapefile(cube, shape) - ... """ shapefile_mask = create_shapefile_mask(shape, cube, minimum_weight) masked_cube = mask_cube(cube, shapefile_mask, in_place=in_place) diff --git a/lib/iris/warnings.py b/lib/iris/warnings.py new file mode 100644 index 0000000000..1a885f60a3 --- /dev/null +++ b/lib/iris/warnings.py @@ -0,0 +1,180 @@ +# 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. +"""Warnings specific to the :mod:`iris` package. + +PLEASE NAMESPACE ALL WARNING CLASSES (i.e. prefix with Iris...). +""" + + +class IrisUserWarning(UserWarning): + r"""Base class for :class:`UserWarning` generated by Iris.""" + + pass + + +class IrisLoadWarning(IrisUserWarning): + """Any warning relating to loading.""" + + pass + + +class IrisSaveWarning(IrisUserWarning): + """Any warning relating to saving.""" + + pass + + +class IrisCfWarning(IrisUserWarning): + """Any warning relating to :term:`CF Conventions` .""" + + pass + + +class IrisIgnoringWarning(IrisUserWarning): + """Any warning that involves an Iris operation not using some information. + + E.g. :class:`~iris.aux_factory.AuxCoordFactory` generation disregarding + bounds. + """ + + pass + + +class IrisDefaultingWarning(IrisUserWarning): + """Any warning that involves Iris changing invalid/missing information. + + E.g. creating a :class:`~iris.coords.AuxCoord` from an invalid + :class:`~iris.coords.DimCoord` definition. + """ + + pass + + +class IrisVagueMetadataWarning(IrisUserWarning): + """Warnings where object metadata may not be fully descriptive.""" + + pass + + +class IrisUnsupportedPlottingWarning(IrisUserWarning): + """Warnings where support for a plotting module/function is not guaranteed.""" + + pass + + +class IrisImpossibleUpdateWarning(IrisUserWarning): + """Warnings where it is not possible to update an object. + + Mainly generated during regridding where the necessary information for + updating an :class:`~iris.aux_factory.AuxCoordFactory` is no longer + present. + """ + + pass + + +class IrisGeometryExceedWarning(IrisUserWarning): + """:mod:`iris.analysis.geometry` warnings about geometry exceeding dimensions.""" + + pass + + +class IrisMaskValueMatchWarning(IrisUserWarning): + """Warnings where the value representing masked data is actually present in data.""" + + pass + + +class IrisCfLoadWarning(IrisCfWarning, IrisLoadWarning): + """Any warning relating to both loading and :term:`CF Conventions` .""" + + pass + + +class IrisCfSaveWarning(IrisCfWarning, IrisSaveWarning): + """Any warning relating to both saving and :term:`CF Conventions` .""" + + pass + + +class IrisCfInvalidCoordParamWarning(IrisCfLoadWarning): + """Warnings where incorrect information for CF coord construction is in a file.""" + + pass + + +class IrisCfMissingVarWarning(IrisCfLoadWarning): + """Warnings where a CF variable references another variable that is not in the file.""" + + pass + + +class IrisCfLabelVarWarning(IrisCfLoadWarning, IrisIgnoringWarning): + """Warnings where a CF string/label variable is being used inappropriately.""" + + pass + + +class IrisCfNonSpanningVarWarning(IrisCfLoadWarning, IrisIgnoringWarning): + """Warnings where a CF variable is ignored because it does not span the required dimension.""" + + pass + + +class IrisIgnoringBoundsWarning(IrisIgnoringWarning): + """Warnings where bounds information has not been used by an Iris operation.""" + + pass + + +class IrisCannotAddWarning(IrisIgnoringWarning): + """Warnings where a member object cannot be added to a :class:`~iris.cube.Cube` .""" + + pass + + +class IrisGuessBoundsWarning(IrisDefaultingWarning): + """Warnings where Iris has filled absent bounds information with a best estimate.""" + + pass + + +class IrisPpClimModifiedWarning(IrisSaveWarning, IrisDefaultingWarning): + """Warnings where a climatology has been modified while saving :term:`Post Processing (PP) Format` .""" + + pass + + +class IrisFactoryCoordNotFoundWarning(IrisLoadWarning): + """Warnings where a referenced factory coord can not be found when loading a variable in :term:`NetCDF Format`.""" + + pass + + +class IrisNimrodTranslationWarning(IrisLoadWarning): + """For unsupported vertical coord types in :mod:`iris.file_formats.nimrod_load_rules`. + + (Pre-dates the full categorisation of Iris UserWarnings). + """ + + pass + + +class IrisUnknownCellMethodWarning(IrisCfLoadWarning): + """If a loaded :class:`~iris.coords.CellMethod` is not one the method names known to Iris. + + (Pre-dates the full categorisation of Iris UserWarnings). + """ + + pass + + +class IrisSaverFillValueWarning(IrisMaskValueMatchWarning, IrisSaveWarning): + """For fill value complications during Iris file saving :term:`NetCDF Format`. + + (Pre-dates the full categorisation of Iris UserWarnings). + """ + + pass diff --git a/noxfile.py b/noxfile.py index a30b6ce784..81c8b02fef 100644 --- a/noxfile.py +++ b/noxfile.py @@ -79,7 +79,7 @@ def cache_venv(session: nox.sessions.Session) -> None: Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ @@ -96,7 +96,7 @@ def cache_cartopy(session: nox.sessions.Session) -> None: Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ @@ -117,7 +117,7 @@ def prepare_venv(session: nox.sessions.Session) -> None: Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. Notes @@ -174,7 +174,7 @@ def tests(session: nox.sessions.Session): Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ @@ -198,7 +198,7 @@ def doctest(session: nox.sessions.Session): Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ @@ -225,7 +225,7 @@ def gallery(session: nox.sessions.Session): Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ @@ -246,7 +246,7 @@ def linkcheck(session: nox.sessions.Session): Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ @@ -272,7 +272,7 @@ def wheel(session: nox.sessions.Session): Parameters ---------- - session: object + session : object A `nox.sessions.Session` object. """ diff --git a/pyproject.toml b/pyproject.toml index 4325de0e0e..f55a77cfdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,3 +162,50 @@ ignore = [ "lib/iris/_version.py", "lib/iris/std_names.py", ] + +[tool.numpydoc_validation] +checks = [ + "all", # Enable all numpydoc validation rules, apart from the following: + + # -> Docstring text (summary) should start in the line immediately + # after the opening quotes (not in the same line, or leaving a + # blank line in between) + "GL01", # Permit summary line on same line as docstring opening quotes. + + # -> Closing quotes should be placed in the line after the last text + # in the docstring (do not close the quotes in the same line as + # the text, or leave a blank line between the last text and the + # quotes) + "GL02", # Permit a blank line before docstring closing quotes. + + # -> Double line break found; please use only one blank line to + # separate sections or paragraphs, and do not leave blank lines + # at the end of docstrings + "GL03", # Ignoring. + + # -> See Also section not found + "SA01", # Not all docstrings require a "See Also" section. + + # -> No extended summary found + "ES01", # Not all docstrings require an "Extended Summary" section. + + # -> No examples section found + "EX01", # Not all docstrings require an "Examples" section. + + # -> No Yields section found + "YD01", # Not all docstrings require a "Yields" section. + + # Temporary checks to ignore, will be reviewed at a later date. + "GL08", # The object does not have a docstrings not have a docstring + "PR01", # Parameters ... not documented + "PR02", # Unknown parameters {....} + "PR04", # Parameter "...." has no type + "PR07", # Parameter "...." has no description + "RT01", # No Returns section found + "RT03", # Return value has no description +] +exclude = [ + '\.__eq__$', + '\.__ne__$', + '\.__repr__$', +] diff --git a/requirements/locks/py310-linux-64.lock b/requirements/locks/py310-linux-64.lock index 83ce00da0d..abb44fd1d5 100644 --- a/requirements/locks/py310-linux-64.lock +++ b/requirements/locks/py310-linux-64.lock @@ -43,7 +43,7 @@ https://conda.anaconda.org/conda-forge/linux-64/libaec-1.1.3-h59595ed_0.conda#5e https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.1.0-hd590300_1.conda#aec6c91c7371c26392a06708a73c70e5 https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 -https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.5.0-hcb278e6_1.conda#6305a3dd2752c76335295da4e581f2fd +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-ha4646dd_5.conda#7a6bd7a12a4bd359e2afe6c0fa1acace https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e @@ -86,7 +86,7 @@ https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007 https://conda.anaconda.org/conda-forge/linux-64/xxhash-0.8.2-hd590300_0.conda#f08fb5c89edfc4aadee1c81d4cfb1fa1 https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h7f98852_2.tar.bz2#4cb3ad778ec2d5a7acbdf254eb1c42ae -https://conda.anaconda.org/conda-forge/linux-64/expat-2.5.0-hcb278e6_1.conda#8b9b5aca60558d02ddaa09d599e55920 +https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 https://conda.anaconda.org/conda-forge/linux-64/hdf4-4.2.15-h2a13503_7.conda#bd77f8da987968ec3927990495dc22e4 https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.1.0-hd590300_1.conda#f07002e225d7a60a694d42a7bf5ff53f https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.1.0-hd590300_1.conda#5fc11c6020d421960607d821310fcd4d diff --git a/requirements/locks/py311-linux-64.lock b/requirements/locks/py311-linux-64.lock index 23211439f4..9afe89cf7b 100644 --- a/requirements/locks/py311-linux-64.lock +++ b/requirements/locks/py311-linux-64.lock @@ -43,7 +43,7 @@ https://conda.anaconda.org/conda-forge/linux-64/libaec-1.1.3-h59595ed_0.conda#5e https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.1.0-hd590300_1.conda#aec6c91c7371c26392a06708a73c70e5 https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 -https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.5.0-hcb278e6_1.conda#6305a3dd2752c76335295da4e581f2fd +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-ha4646dd_5.conda#7a6bd7a12a4bd359e2afe6c0fa1acace https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e @@ -86,7 +86,7 @@ https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007 https://conda.anaconda.org/conda-forge/linux-64/xxhash-0.8.2-hd590300_0.conda#f08fb5c89edfc4aadee1c81d4cfb1fa1 https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h7f98852_2.tar.bz2#4cb3ad778ec2d5a7acbdf254eb1c42ae -https://conda.anaconda.org/conda-forge/linux-64/expat-2.5.0-hcb278e6_1.conda#8b9b5aca60558d02ddaa09d599e55920 +https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 https://conda.anaconda.org/conda-forge/linux-64/hdf4-4.2.15-h2a13503_7.conda#bd77f8da987968ec3927990495dc22e4 https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.1.0-hd590300_1.conda#f07002e225d7a60a694d42a7bf5ff53f https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.1.0-hd590300_1.conda#5fc11c6020d421960607d821310fcd4d diff --git a/requirements/locks/py39-linux-64.lock b/requirements/locks/py39-linux-64.lock index b9fbc9b311..8f96b8dda1 100644 --- a/requirements/locks/py39-linux-64.lock +++ b/requirements/locks/py39-linux-64.lock @@ -43,7 +43,7 @@ https://conda.anaconda.org/conda-forge/linux-64/libaec-1.1.3-h59595ed_0.conda#5e https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.1.0-hd590300_1.conda#aec6c91c7371c26392a06708a73c70e5 https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 -https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.5.0-hcb278e6_1.conda#6305a3dd2752c76335295da4e581f2fd +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-ha4646dd_5.conda#7a6bd7a12a4bd359e2afe6c0fa1acace https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e @@ -86,7 +86,7 @@ https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007 https://conda.anaconda.org/conda-forge/linux-64/xxhash-0.8.2-hd590300_0.conda#f08fb5c89edfc4aadee1c81d4cfb1fa1 https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h7f98852_2.tar.bz2#4cb3ad778ec2d5a7acbdf254eb1c42ae -https://conda.anaconda.org/conda-forge/linux-64/expat-2.5.0-hcb278e6_1.conda#8b9b5aca60558d02ddaa09d599e55920 +https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 https://conda.anaconda.org/conda-forge/linux-64/hdf4-4.2.15-h2a13503_7.conda#bd77f8da987968ec3927990495dc22e4 https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.1.0-hd590300_1.conda#f07002e225d7a60a694d42a7bf5ff53f https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.1.0-hd590300_1.conda#5fc11c6020d421960607d821310fcd4d