diff --git a/environment.yml b/environment.yml index 54edeb8566..37b889c453 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ channels: dependencies: # Python packages that cannot be installed from PyPI: - gdal - - esmvalcore>=2.0.0b5,<2.1 + - esmvalcore>=2.0.0b6,<2.1 # Non-Python dependencies - graphviz - cdo>=1.9.7 diff --git a/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_all.yml b/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_all.yml index 1bad271579..6b184f3c66 100644 --- a/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_all.yml +++ b/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_all.yml @@ -67,7 +67,7 @@ diagnostics: rsutcs: # TOA SW up clear sky preprocessor: pp_rad additional_datasets: - - {dataset: CERES-EBAF, project: obs4mips, level: L3B, version: Ed2-7, start_year: 2001, end_year: 2012, tier: 1} + - {dataset: CERES-EBAF, project: obs4mips, mip: Amon, level: L3B, version: Ed2-7, start_year: 2001, end_year: 2012, tier: 1} scripts: autoassess_Radiation_rms_Amon_all: script: autoassess/autoassess_radiation_rms.py @@ -86,7 +86,7 @@ diagnostics: rldscs: # Surf LW down clear sky preprocessor: pp_rad additional_datasets: - - {dataset: JRA-55, project: ana4mips, type: reanalysis, start_year: 2001, end_year: 2005, tier: 1} + - {dataset: JRA-55, project: ana4mips, mip: Amon, type: reanalysis, start_year: 2001, end_year: 2005, tier: 1} scripts: autoassess_Radiation_rms_Amon_all: script: autoassess/autoassess_radiation_rms.py @@ -103,7 +103,7 @@ diagnostics: prw: # Column Water vapour preprocessor: pp_rad additional_datasets: - - {dataset: SSMI-MERIS, project: obs4mips, level: L3, version: v1-00, start_year: 2003, end_year: 2008, tier: 1} + - {dataset: SSMI-MERIS, project: obs4mips, mip: Amon, level: L3, version: v1-00, start_year: 2003, end_year: 2008, tier: 1} scripts: autoassess_Radiation_rms_Amon_all: script: autoassess/autoassess_radiation_rms.py @@ -120,7 +120,7 @@ diagnostics: pr: # Precipitation preprocessor: pp_rad additional_datasets: - - {dataset: GPCP-SG, project: obs4mips, level: L3, version: v2.2, start_year: 2001, end_year: 2009, tier: 1} + - {dataset: GPCP-SG, project: obs4mips, mip: Amon, level: L3, version: v2.2, start_year: 2001, end_year: 2009, tier: 1} scripts: autoassess_Radiation_rms_Amon_all: script: autoassess/autoassess_radiation_rms.py diff --git a/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_obs.yml b/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_obs.yml index dc0b2ae655..d53d6b352f 100644 --- a/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_obs.yml +++ b/esmvaltool/recipes/recipe_autoassess_radiation_rms_Amon_obs.yml @@ -68,8 +68,8 @@ diagnostics: rsutcs: # TOA SW up clear sky preprocessor: pp_rad additional_datasets: - - {dataset: CERES-EBAF, project: obs4mips, level: L3B, version: Ed2-7, start_year: 2001, end_year: 2012, tier: 1} - - {dataset: CERES-SYN1deg, project: OBS, type: sat, version: Ed3A, start_year: 2001, end_year: 2015, tier: 3} + - {dataset: CERES-EBAF, project: obs4mips, mip: Amon, level: L3B, version: Ed2-7, start_year: 2001, end_year: 2012, tier: 1} + - {dataset: CERES-SYN1deg, project: OBS, mip: Amon, type: sat, version: Ed3A, start_year: 2001, end_year: 2015, tier: 3} scripts: autoassess_Radiation_rms_Amon_obs: script: autoassess/autoassess_radiation_rms.py @@ -88,8 +88,8 @@ diagnostics: rldscs: # Surf LW down clear sky preprocessor: pp_rad additional_datasets: - - {dataset: JRA-55, project: ana4mips, type: reanalysis, start_year: 2001, end_year: 2005, tier: 1} - - {dataset: CERES-SYN1deg, project: OBS, type: sat, version: Ed3A, start_year: 2001, end_year: 2015, tier: 3} + - {dataset: JRA-55, project: ana4mips, mip: Amon, type: reanalysis, start_year: 2001, end_year: 2005, tier: 1} + - {dataset: CERES-SYN1deg, project: OBS, mip: Amon, type: sat, version: Ed3A, start_year: 2001, end_year: 2015, tier: 3} scripts: autoassess_Radiation_rms_Amon_obs: script: autoassess/autoassess_radiation_rms.py @@ -106,8 +106,8 @@ diagnostics: prw: # Column Water vapour preprocessor: pp_rad additional_datasets: - - {dataset: SSMI-MERIS, project: obs4mips, level: L3, version: v1-00, start_year: 2003, end_year: 2008, tier: 1} - - {dataset: SSMI, project: obs4mips, level: L3, version: RSSv07r00, start_year: 1988, end_year: 2006, tier: 1} + - {dataset: SSMI-MERIS, project: obs4mips, mip: Amon, level: L3, version: v1-00, start_year: 2003, end_year: 2008, tier: 1} + - {dataset: SSMI, project: obs4mips, mip: Amon, level: L3, version: RSSv07r00, start_year: 1988, end_year: 2006, tier: 1} scripts: autoassess_Radiation_rms_Amon_obs: script: autoassess/autoassess_radiation_rms.py @@ -124,8 +124,8 @@ diagnostics: pr: # Precipitation preprocessor: pp_rad additional_datasets: - - {dataset: GPCP-SG, project: obs4mips, level: L3, version: v2.2, start_year: 2001, end_year: 2009, tier: 1} - - {dataset: TRMM-L3, project: obs4mips, level: v7, version: 7A, start_year: 1998, end_year: 2013, tier: 1} + - {dataset: GPCP-SG, project: obs4mips, mip: Amon, level: L3, version: v2.2, start_year: 2001, end_year: 2009, tier: 1} + - {dataset: TRMM-L3, project: obs4mips, mip: Amon, level: v7, version: 7A, start_year: 1998, end_year: 2013, tier: 1} scripts: autoassess_Radiation_rms_Amon_obs: script: autoassess/autoassess_radiation_rms.py diff --git a/esmvaltool/recipes/recipe_autoassess_radiation_rms_cfMon_all.yml b/esmvaltool/recipes/recipe_autoassess_radiation_rms_cfMon_all.yml index 1ce0e71a67..784b040b2e 100644 --- a/esmvaltool/recipes/recipe_autoassess_radiation_rms_cfMon_all.yml +++ b/esmvaltool/recipes/recipe_autoassess_radiation_rms_cfMon_all.yml @@ -55,7 +55,7 @@ diagnostics: derive: true force_derivation: false additional_datasets: - - {dataset: ISCCP, project: obs4mips, level: L3, version: V1.0, start_year: 1985, end_year: 1988, tier: 1} + - {dataset: ISCCP, project: obs4mips, mip: Amon, level: L3, version: V1.0, start_year: 1985, end_year: 1988, tier: 1} scripts: autoassess_Radiation_rms_cfMon_all: script: autoassess/autoassess_radiation_rms.py diff --git a/esmvaltool/recipes/recipe_validation.yml b/esmvaltool/recipes/recipe_validation.yml index 634ade9c49..cb8965cb73 100644 --- a/esmvaltool/recipes/recipe_validation.yml +++ b/esmvaltool/recipes/recipe_validation.yml @@ -45,7 +45,7 @@ diagnostics: rsut: # TOA SW up all sky preprocessor: pp_rad additional_datasets: - - {dataset: CERES-EBAF, project: obs4mips, level: L3B, version: Ed2-7, start_year: 2001, end_year: 2012, tier: 1} + - {dataset: CERES-EBAF, project: obs4mips, mip: Amon, level: L3B, version: Ed2-7, start_year: 2001, end_year: 2012, tier: 1} scripts: lat_lon: script: validation.py diff --git a/esmvaltool/recipes/recipe_validation_CMIP6.yml b/esmvaltool/recipes/recipe_validation_CMIP6.yml index 54c8bf11bc..d4dc9193e6 100644 --- a/esmvaltool/recipes/recipe_validation_CMIP6.yml +++ b/esmvaltool/recipes/recipe_validation_CMIP6.yml @@ -35,7 +35,7 @@ diagnostics: tas: preprocessor: pp_rad additional_datasets: - - {dataset: ERA-Interim, project: OBS6, type: reanaly, version: 1, start_year: 1980, end_year: 2000, tier: 3} + - {dataset: ERA-Interim, project: OBS6, mip: Amon, type: reanaly, version: 1, start_year: 1980, end_year: 2000, tier: 3} scripts: lat_lon: script: validation.py diff --git a/meta.yaml b/meta.yaml index 406accba4f..d1f84a7b70 100644 --- a/meta.yaml +++ b/meta.yaml @@ -50,7 +50,7 @@ requirements: - ecmwf-api-client # in esmvalgroup channel - eofs - esmpy - - esmvalcore>=2.0.0b5,<2.1 # in esmvalgroup channel + - esmvalcore>=2.0.0b6,<2.1 # in esmvalgroup channel - jinja2 - matplotlib - nc-time-axis diff --git a/setup.py b/setup.py index c9a80c4a79..bf5560f6ad 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ 'cython', 'ecmwf-api-client', 'eofs', - 'esmvalcore>=2.0.0b5,<2.1', + 'esmvalcore>=2.0.0b6,<2.1', 'fiona', 'jinja2', 'matplotlib<3', diff --git a/tests/integration/test_recipes_loading.py b/tests/integration/test_recipes_loading.py index c8313df076..e33e587e1b 100644 --- a/tests/integration/test_recipes_loading.py +++ b/tests/integration/test_recipes_loading.py @@ -7,12 +7,12 @@ import numpy as np import pytest +import esmvalcore +import esmvaltool from esmvalcore import _data_finder, _recipe_checks from esmvalcore._config import read_config_user_file from esmvalcore._recipe import read_recipe_file -import esmvaltool - from .test_diagnostic_run import write_config_user_file @@ -137,8 +137,21 @@ def extract_shape(settings): monkeypatch.setattr(_recipe_checks, 'extract_shape', extract_shape) +@pytest.fixture +def patched_get_reference_levels(monkeypatch): + """Replace `_regrid.get_reference_levels`. + + Return a random set of reference levels + """ + def get_reference_levels(*_, **_a): + return [1, 2] + + monkeypatch.setattr(esmvalcore._recipe, 'get_reference_levels', + get_reference_levels) + + @pytest.mark.parametrize('recipe_file', _get_recipes()) def test_diagnostic_run(recipe_file, config_user, patched_datafinder, - patched_extract_shape): + patched_extract_shape, patched_get_reference_levels): """Check that recipe files are valid ESMValTool recipes.""" read_recipe_file(recipe_file, config_user) diff --git a/tests/unit/test_naming.py b/tests/unit/test_naming.py index 41971a60a8..cd0f0dab27 100644 --- a/tests/unit/test_naming.py +++ b/tests/unit/test_naming.py @@ -3,10 +3,17 @@ import os import unittest +IGNORE = { + '.git', + '.github', + '.eggs', + '__pycache__', + 'test-reports', +} + class TestNaming(unittest.TestCase): """Test naming of files and folders""" - def setUp(self): """Prepare tests""" folder = os.path.join(__file__, '..', '..', '..') @@ -25,6 +32,9 @@ def test_windows_reserved_names(self): } for dirpath, dirnames, filenames in os.walk(self.esmvaltool_folder): + for dirname in dirnames: + if dirname in IGNORE: + dirnames.remove(dirname) error_msg = 'Reserved windows name found at {}.' \ ' Please rename it ' \ '(Windows reserved names are: {})' \ @@ -33,8 +43,8 @@ def test_windows_reserved_names(self): self.assertTrue(reserved_names.isdisjoint(filenames), error_msg) without_extensions = (os.path.splitext(filename)[0] for filename in filenames) - self.assertTrue( - reserved_names.isdisjoint(without_extensions), error_msg) + self.assertTrue(reserved_names.isdisjoint(without_extensions), + error_msg) def test_avoid_casing_collisions(self): """ @@ -43,6 +53,9 @@ def test_avoid_casing_collisions(self): This includes folders differing from files """ for dirpath, dirnames, filenames in os.walk(self.esmvaltool_folder): + for dirname in dirnames: + if dirname in IGNORE: + dirnames.remove(dirname) self.assertEqual( len(filenames) + len(dirnames), len({name.lower() @@ -60,8 +73,9 @@ def test_no_namelist(self): exclude_paths = ['esmvaltool/diag_scripts/cvdp/cvdp'] for dirpath, dirnames, filenames in os.walk(self.esmvaltool_folder): - if '.git' in dirpath.split(os.sep): - continue + for dirname in dirnames: + if dirname in IGNORE: + dirnames.remove(dirname) if any([item in dirpath for item in exclude_paths]): continue self.assertFalse(