Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 17, 2024
1 parent 5a1cda0 commit 7196f16
Show file tree
Hide file tree
Showing 196 changed files with 391 additions and 794 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ indent_size = 2

[*.{md,Rmd}]
trim_trailing_whitespace = false

1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
esmvalcore/cmor @jvegasbsc
.github/workflows @valeriupredoi

2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ authors:
affiliation: "DLR, Germany"
family-names: Cammarano
given-names: Diego
-
-
affiliation: "ACCESS-NRI, Australia"
family-names: Yousong
given-names: Zeng
Expand Down
2 changes: 0 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,3 @@ In addition to using the Software, we encourage the community to join the Softwa
To join the ESMValTool Development Team, please contact Dr. Birgit Hassler ([email protected]) and Dr. Axel Lauer ([email protected]).

==========================================


22 changes: 11 additions & 11 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -743,15 +743,15 @@ Perform the steps listed below with two persons, to reduce the risk of error.
`PyPI <https://pypi.org/project/ESMValCore/>`__, and
`readthedocs <https://readthedocs.org/dashboard/esmvalcore/users/>`__.

The release of ESMValCore is tied to the release of ESMValTool.
The release of ESMValCore is tied to the release of ESMValTool.
The detailed steps can be found in the ESMValTool
:ref:`documentation <esmvaltool:release_steps>`.
To start the procedure, ESMValCore gets released as a
To start the procedure, ESMValCore gets released as a
release candidate to test the recipes in ESMValTool. If bugs are found
during the testing phase of the release candidate, make as many release
candidates for ESMValCore as needed in order to fix them.
during the testing phase of the release candidate, make as many release
candidates for ESMValCore as needed in order to fix them.

To make a new release of the package, be it a release candidate or the final release,
To make a new release of the package, be it a release candidate or the final release,
follow these steps:

1. Check that all tests and builds work
Expand Down Expand Up @@ -795,13 +795,13 @@ Use the script
to create create a draft of the release notes.
This script uses the titles and labels of merged pull requests since the
previous release.
Open a discussion to allow members of the development team to nominate pull
requests as highlights. Add the most voted pull requests as highlights at the
beginning of changelog. After the highlights section, list any backward
incompatible changes that the release may include. The
Open a discussion to allow members of the development team to nominate pull
requests as highlights. Add the most voted pull requests as highlights at the
beginning of changelog. After the highlights section, list any backward
incompatible changes that the release may include. The
:ref:`backward compatibility policy<esmvaltool:backward-compatibility-policy>`.
lists the information that should be provided by the developer of any backward
incompatible change. Make sure to also list any deprecations that the release
lists the information that should be provided by the developer of any backward
incompatible change. Make sure to also list any deprecations that the release
may include, as well as a brief description on how to upgrade a deprecated feature.
Review the results, and if anything needs changing, change it on GitHub and
re-run the script until the changelog looks acceptable.
Expand Down
2 changes: 1 addition & 1 deletion doc/quickstart/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Pre-installed versions on HPC clusters / other servers


If you would like to use pre-installed versions on HPC clusters (currently CEDA-JASMIN and DKRZ-Levante),
and other servers (currently Met Office Linux estate), please have a look at
and other servers (currently Met Office Linux estate), please have a look at
:ref:`these instructions <esmvaltool:install_on_hpc>`.


Expand Down
2 changes: 1 addition & 1 deletion doc/quickstart/run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This feature is available for projects that are hosted on the ESGF, i.e.
CMIP3, CMIP5, CMIP6, CORDEX, and obs4MIPs.

To control the strictness of the CMOR checker and the checks during concatenation
on auxiliary coordinates, supplementary variables, and derived coordinates,
on auxiliary coordinates, supplementary variables, and derived coordinates,
use the flag ``--check_level``:

.. code:: bash
Expand Down
2 changes: 1 addition & 1 deletion doc/recipe/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ The recipe format

Overview <overview>
Preprocessor <preprocessor>

9 changes: 4 additions & 5 deletions esmvalcore/_citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@


def _write_citation_files(filename, provenance):
"""
Write citation information provided by the recorded provenance.
"""Write citation information provided by the recorded provenance.
Recipe and cmip6 data references are saved into one bibtex file.
cmip6 data references are provided by CMIP6 data citation service.
Expand Down Expand Up @@ -135,9 +134,9 @@ def _save_citation_info_txt(product_name, info_urls, other_info):
def _extract_tags(tags):
"""Extract tags.
Tags are recorded as a list of strings converted to a string in provenance.
For example, a single entry in the list `tags` could be the string
"['acknow_project', 'acknow_author']".
Tags are recorded as a list of strings converted to a string in
provenance. For example, a single entry in the list `tags` could be
the string "['acknow_project', 'acknow_author']".
"""
pattern = re.compile(r'[\w-]+')
return set(pattern.findall(str(tags)))
Expand Down
7 changes: 4 additions & 3 deletions esmvalcore/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ def get_config_developer(cls, overwrite=False, path=None):
class Recipes():
"""List, show and retrieve installed recipes.
This group contains utilities to explore and manage the recipes available
in your installation of ESMValTool.
This group contains utilities to explore and manage the recipes
available in your installation of ESMValTool.
Documentation for recipes included with ESMValTool is available at
https://docs.esmvaltool.org/en/latest/recipes/index.html.
Expand Down Expand Up @@ -294,7 +294,8 @@ class ESMValTool():
multiple models, either against predecessor versions or against
observations.
Documentation is available at https://docs.esmvaltool.org.
Documentation is available at
https://docs.esmvaltool.org.
To report issues or ask for improvements, please visit
https://github.com/ESMValGroup/ESMValTool.
Expand Down
14 changes: 8 additions & 6 deletions esmvalcore/_recipe/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,14 @@ def _update_multiproduct(input_products, order, preproc_dir, step):
"""Return new products that are aggregated over multiple datasets.
These new products will replace the original products at runtime.
Therefore, they need to have all the settings for the remaining steps.
The functions in _multimodel.py take output_products as function arguments.
These are the output_products created here. But since those functions are
called from the input products, the products that are created here need to
be added to their ancestors products' settings ().
Therefore, they need to have all the settings for the remaining
steps.
The functions in _multimodel.py take output_products as function
arguments. These are the output_products created here. But since
those functions are called from the input products, the products
that are created here need to be added to their ancestors products'
settings ().
"""
products = {p for p in input_products if step in p.settings}
if not products:
Expand Down
7 changes: 3 additions & 4 deletions esmvalcore/cmor/_fixes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
Automatic fixes for input data
"""Automatic fixes for input data.
Module to apply automatic fixes at different levels to input data for known
errors.
Module to apply automatic fixes at different levels to input data for
known errors.
"""
2 changes: 0 additions & 2 deletions esmvalcore/cmor/_fixes/cesm/cesm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
(esmvalcore/_config/extra_facets/cesm-mappings.yml) and/or add classes to this
file for variables that need more complex fixes (see
esmvalcore/cmor/_fixes/emac/emac.py for examples).
"""

import logging
Expand Down Expand Up @@ -64,7 +63,6 @@ def _fix_time(self, cube):
Example of monthly time coordinate after this fix (Jan. & Feb. 2000):
Points: ``[2000-01-15, 2000-02-14]``
Bounds: ``[[2000-01-01, 2000-02-01], [2000-02-01, 2000-03-01]]``
"""
# Only modify time points if data contains a time dimension, is monthly
# data, and does not describe point measurements.
Expand Down
4 changes: 1 addition & 3 deletions esmvalcore/cmor/_fixes/cmip5/access1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class AllVars(Fix):
"""Common fixes to all vars."""

def fix_metadata(self, cubes):
"""
Fix metadata.
"""Fix metadata.
Fixes wrong calendar 'gregorian' instead of 'proleptic_gregorian'.
Expand All @@ -23,7 +22,6 @@ def fix_metadata(self, cubes):
Returns
-------
iris.cube.CubeList
"""
for cube in cubes:
try:
Expand Down
2 changes: 0 additions & 2 deletions esmvalcore/cmor/_fixes/cmip5/access1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from ..fix import Fix
from .access1_0 import Cl as BaseCl


Cl = BaseCl


Expand All @@ -25,7 +24,6 @@ def fix_metadata(self, cubes):
Returns
-------
iris.cube.CubeList
"""
for cube in cubes:
try:
Expand Down
36 changes: 9 additions & 27 deletions esmvalcore/cmor/_fixes/cmip5/bnu_esm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class Cl(ClFixHybridPressureCoord):
"""Fixes for cl."""

def fix_data(self, cube):
"""
Fix data.
"""Fix data.
Fixes discrepancy between declared units and real units
Expand All @@ -23,7 +22,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
metadata = cube.metadata
cube *= 100
Expand All @@ -35,8 +33,7 @@ class FgCo2(Fix):
"""Fixes for fgco2."""

def fix_metadata(self, cubes):
"""
Fix metadata.
"""Fix metadata.
Fixes cube units.
Expand All @@ -48,14 +45,12 @@ def fix_metadata(self, cubes):
Returns
-------
iris.cube.CubeList
"""
self.get_cube_from_list(cubes).units = Unit('kg m-2 s-1')
return cubes

def fix_data(self, cube):
"""
Fix data.
"""Fix data.
Fixes cube units.
Expand All @@ -67,7 +62,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
metadata = cube.metadata
cube *= 12.0 / 44.0
Expand All @@ -79,8 +73,7 @@ class Ch4(Fix):
"""Fixes for ch4."""

def fix_metadata(self, cubes):
"""
Fix metadata.
"""Fix metadata.
Fixes cube units.
Expand All @@ -92,14 +85,12 @@ def fix_metadata(self, cubes):
Returns
-------
iris.cube.CubeList
"""
self.get_cube_from_list(cubes).units = Unit('1e-9')
return cubes

def fix_data(self, cube):
"""
Fix metadata.
"""Fix metadata.
Fixes cube units.
Expand All @@ -112,7 +103,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
metadata = cube.metadata
cube *= 29.0 / 16.0 * 1.e9
Expand All @@ -124,8 +114,7 @@ class Co2(Fix):
"""Fixes for co2."""

def fix_metadata(self, cubes):
"""
Fix metadata.
"""Fix metadata.
Fixes cube units.
Expand All @@ -137,14 +126,12 @@ def fix_metadata(self, cubes):
Returns
-------
iris.cube.CubeList
"""
self.get_cube_from_list(cubes).units = Unit('1e-6')
return cubes

def fix_data(self, cube):
"""
Fix data.
"""Fix data.
Fixes cube units.
Expand All @@ -156,7 +143,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
metadata = cube.metadata
cube *= 29.0 / 44.0 * 1.e6
Expand All @@ -168,8 +154,7 @@ class SpCo2(Fix):
"""Fixes for spco2."""

def fix_data(self, cube):
"""
Fix data.
"""Fix data.
Fixes cube units.
Expand All @@ -181,7 +166,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
metadata = cube.metadata
cube *= 1.e6
Expand All @@ -193,8 +177,7 @@ class Od550Aer(Fix):
"""Fixes for od550aer."""

def fix_data(self, cube):
"""
Fix data.
"""Fix data.
Masks invalid values.
Expand All @@ -206,7 +189,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
data = da.ma.masked_equal(cube.core_data(), 1.e36)
return cube.copy(data)
Expand Down
5 changes: 1 addition & 4 deletions esmvalcore/cmor/_fixes/cmip5/canesm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
from ..common import ClFixHybridPressureCoord
from ..fix import Fix


Cl = ClFixHybridPressureCoord


class FgCo2(Fix):
"""Fixes for fgco2."""

def fix_data(self, cube):
"""
Fix data.
"""Fix data.
Fixes discrepancy between declared units and real units
Expand All @@ -23,7 +21,6 @@ def fix_data(self, cube):
Returns
-------
iris.cube.Cube
"""
metadata = cube.metadata
cube *= 12.0 / 44.0
Expand Down
Loading

0 comments on commit 7196f16

Please sign in to comment.