Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3b54a3e
update CITATION.cff file with 2.7.0 release info (#1757)
valeriupredoi Oct 14, 2022
877d890
updating changelog and CITATION in main to reflect files from 2.7.0 r…
valeriupredoi Oct 14, 2022
408962c
fix anaconda badge in README (#1759)
valeriupredoi Oct 19, 2022
3149d07
[Condalock] Update Linux condalock file (#1768)
github-actions[bot] Oct 21, 2022
5caef97
Merge branch 'release_270stable' into main
valeriupredoi Oct 28, 2022
354ee55
[Condalock] Update Linux condalock file (#1777)
github-actions[bot] Oct 31, 2022
dbb1a4a
Fix version number (merge pull request #1775)
bouweandela Oct 31, 2022
82946b8
[Condalock] Update Linux condalock file (#1778)
github-actions[bot] Nov 1, 2022
3666bfa
Add derivation of sea ice extent (#1695)
sloosvel Nov 3, 2022
b880462
Fix mistake in the documentation of `esmvalcore.esgf.find_files` (#1784)
bouweandela Nov 10, 2022
4527173
set implicit optional to true in mypy config to avert side effects an…
valeriupredoi Nov 11, 2022
0b02960
Add `esmvalcore.config` module (#1769)
bouweandela Nov 14, 2022
ef33a2d
Remove duplicate implicit_optional = True line in setup.cfg (#1791)
valeriupredoi Nov 14, 2022
4d48ece
Fix type hints for Python 3.8 (#1795)
bouweandela Nov 15, 2022
113bbc3
Fix failing test due to missing sample data (#1797)
bouweandela Nov 15, 2022
89fbe93
Add all deps to the conda-forge environment and suppress installing a…
valeriupredoi Nov 16, 2022
7b91ec8
Support linking to "stable" ESMValTool version on readthedocs (#1608)
bouweandela Nov 17, 2022
4d96890
Remove outdated cmor_table facet from data finder tests (#1798)
bouweandela Nov 18, 2022
f1707f8
Pin netCDF4<1.6.1 (#1805)
bouweandela Nov 18, 2022
a6f8c08
Unpin cf-units (#1770)
bouweandela Nov 18, 2022
9a2a318
[Condalock] Update Linux condalock file (#1812)
github-actions[bot] Nov 21, 2022
96419a7
Unpin NetCF4 (#1814)
valeriupredoi Nov 21, 2022
94302a4
Create a session directory with suffix "-1", "-2", etc if it already …
bouweandela Nov 22, 2022
f9b45a8
Import from `esmvalcore.config` in the `esmvalcore.experimental` modu…
bouweandela Nov 22, 2022
ebfbf7d
Unpin flake8 (#1820)
valeriupredoi Nov 22, 2022
bb58405
Modernize tests for `esmvalcore.preprocessor.save` (#1799)
bouweandela Nov 22, 2022
5644203
Added scalar coords of input cubes to output of esmpy_regrid (#1811)
schlunma Nov 23, 2022
c2a807d
Add iris-esmf-regrid as a dependency (#1809)
sloosvel Nov 23, 2022
63267b6
Add siconc fixes for EC-Earth3-Veg and EC-Earth3-Veg-LR models (#1771)
egalytska Nov 24, 2022
680aad1
No more sequential tests since SegFaults were not noticed anymore (#1…
valeriupredoi Nov 25, 2022
44505c5
Fix severe bug in `mask_fillvalues` (#1823)
schlunma Nov 25, 2022
54385ac
Remove deprecated features scheduled for removal in v2.8.0 or earlier…
schlunma Nov 25, 2022
d33e5ad
Allow `multi_model_statistics` on cubes with arbitrary dimensions (#…
schlunma Nov 29, 2022
320a275
Improve error handling if an esgf index node is offline (#1834)
bouweandela Nov 29, 2022
f840d97
Update pre-commit configuration (#1821)
bouweandela Dec 1, 2022
5107f12
Fix LWP of ICON on-the-fly CMORizer (#1839)
schlunma Dec 1, 2022
e09eda2
Removed unnecessary test that fails with iris 3.4.0 (#1846)
schlunma Dec 2, 2022
5180b4f
[Condalock] Update Linux condalock file (#1842)
github-actions[bot] Dec 2, 2022
73c6fd0
unpincfunits and netcdf4
valeriupredoi Dec 2, 2022
7cac2c8
unpin cfunits and netcdf4 and pin mypy
valeriupredoi Dec 2, 2022
83e01e1
apply change from PR 1846
valeriupredoi Dec 2, 2022
d1a2ac1
run a GA session
valeriupredoi Dec 2, 2022
038ebc5
cherrypick PR 1770
valeriupredoi Dec 2, 2022
ffa6c0e
cherrypick PR 1770
valeriupredoi Dec 2, 2022
6363d2d
align cherrypick to PR 1770
valeriupredoi Dec 2, 2022
fa40967
align cherrypick to PR 1770
valeriupredoi Dec 2, 2022
fa197f0
align cherrypick to PR 1770
valeriupredoi Dec 2, 2022
40d06e1
cherry pick esgf test fix from PR 1834
valeriupredoi Dec 2, 2022
fafc959
add changelog
valeriupredoi Dec 2, 2022
7b43280
turn off GA actions
valeriupredoi Dec 2, 2022
3e50ac7
Update CEDA ESGF index node hostname (#1838)
valeriupredoi Dec 5, 2022
ff87997
Fixed issue in irregular regridding regarding scalar coordinates (#1845)
schlunma Dec 5, 2022
b0120d8
Update product attributes and `metadata.yml` with cube metadata befor…
schlunma Dec 5, 2022
3b0f1f6
align environment to main as much as it permits
valeriupredoi Dec 5, 2022
1a444a2
align setup.py to main as much as it permits
valeriupredoi Dec 5, 2022
24efd7c
Merge branch 'main' into release_271bugfix
valeriupredoi Dec 5, 2022
9dbe65c
Revert "Merge branch 'main' into release_271bugfix"
valeriupredoi Dec 8, 2022
024f959
Revert "align setup.py to main as much as it permits"
valeriupredoi Dec 8, 2022
b96ed18
Revert "align environment to main as much as it permits"
valeriupredoi Dec 8, 2022
8c0411b
new versioning way from PR 1854
valeriupredoi Dec 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@ Changelog
=========


.. _changelog-v2-7-1:


v2.7.1
------
Highlights
~~~~~~~~~~

This is a bugfix release where we unpin `cf-units` to allow for latest `iris=3.4.0` to be installed.

Installation
~~~~~~~~~~~~

- Unpin cf-units (`#1770 <https://github.com/ESMValGroup/ESMValCore/pull/1770>`__) `Bouwe Andela <https://github.com/bouweandela>`__

Bug fixes
~~~~~~~~~

- Improve error handling if an esgf index node is offline (`#1834 <https://github.com/ESMValGroup/ESMValCore/pull/1834>`__) `Bouwe Andela <https://github.com/bouweandela>`__



.. _changelog-v2-7-0:


Expand Down
7 changes: 3 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
name: esmvaltool
channels:
- conda-forge
- nodefaults

dependencies:
- cartopy
- cf-units>=3.0.0,<3.1.0 # github.com/ESMValGroup/ESMValCore/issues/1655
- cf-units
- cftime
- compilers
# 1.8.18/py39, they seem weary to build manylinux wheels
# and pypi ver built with older gdal
- fiona
- esmpy!=8.1.0 # see github.com/ESMValGroup/ESMValCore/issues/1208
- geopy
- iris>=3.2.1
- nested-lookup
- netcdf4!=1.6.1 # github.com/ESMValGroup/ESMValCore/issues/1723
- netcdf4
- pandas
- pillow
- pip!=21.3
Expand Down
2 changes: 1 addition & 1 deletion esmvalcore/cmor/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ def _simplify_calendar(calendar):
calendar_aliases = {
'all_leap': '366_day',
'noleap': '365_day',
'standard': 'gregorian',
'gregorian': 'standard',
}
return calendar_aliases.get(calendar, calendar)

Expand Down
7 changes: 6 additions & 1 deletion esmvalcore/esgf/_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ def _search_index_nodes(facets):
)
FIRST_ONLINE_INDEX_NODE = url
return results
except requests.exceptions.Timeout as error:
except (
requests.exceptions.ConnectionError,
requests.exceptions.HTTPError,
requests.exceptions.Timeout,
) as error:
logger.debug("Unable to connect to %s due to %s", url, error)
errors.append(error)

raise FileNotFoundError("Failed to search ESGF, unable to connect:\n" +
Expand Down
2 changes: 1 addition & 1 deletion esmvalcore/preprocessor/_multimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _unify_time_coordinates(cubes):
are no mismatches in the time arrays.

If cubes have different time units, it will reset the calendar to a
default gregorian calendar with unit "days since 1850-01-01".
the "standard" calendar with unit "days since 1850-01-01".

Might not work for (sub)daily data, because different calendars may have
different number of days in the year.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ requires = ["setuptools >= 40.6.0", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "release-branch-semver"

[tool.pylint.main]
jobs = 0
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
# Use with pip install . to install from source
'install': [
'cartopy',
# see https://github.com/SciTools/cf-units/issues/218
'cf-units>=3.0.0,<3.1.0,!=3.0.1.post0', # ESMValCore/issues/1655
'cf-units',
'dask[array]',
'esgf-pyclient>=0.3.1',
'esmpy!=8.1.0', # see github.com/ESMValGroup/ESMValCore/issues/1208
Expand All @@ -42,7 +41,7 @@
'jinja2',
'nc-time-axis', # needed by iris.plot
'nested-lookup',
'netCDF4!=1.6.1', # github.com/ESMValGroup/ESMValCore/issues/1723
'netCDF4',
'numpy',
'pandas',
'pillow',
Expand All @@ -59,7 +58,8 @@
],
# Test dependencies
'test': [
'flake8<5.0', # github.com/ESMValGroup/ESMValCore/issues/1696
'flake8',
'mypy<0.990',
'pytest>=3.9,!=6.0.0rc1,!=6.0.0',
'pytest-cov>=2.10.1',
'pytest-env',
Expand Down
69 changes: 39 additions & 30 deletions tests/integration/cmor/_fixes/cmip5/test_access1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,54 @@
from esmvalcore.iris_helpers import date2num


class TestAllVars(unittest.TestCase):
"""Test all vars fixes."""
@pytest.fixture
def cube():
"""Cube for testing."""
test_cube = Cube([1.0, 2.0], var_name='co2', units='J')
reference_dates = [
datetime(300, 1, 16, 12), # e.g. piControl
datetime(1850, 1, 16, 12) # e.g. historical
]
esgf_time_units = Unit(
'days since 0001-01-01',
calendar='proleptic_gregorian',
)
time_points = date2num(reference_dates, esgf_time_units)
test_cube.add_dim_coord(
DimCoord(time_points, 'time', 'time', 'time', esgf_time_units),
data_dim=0,
)
return test_cube


def setUp(self):
"""Prepare tests."""
self.cube = Cube([1.0, 2.0], var_name='co2', units='J')
reference_dates = [
datetime(300, 1, 16, 12), # e.g. piControl
datetime(1850, 1, 16, 12) # e.g. historical
]
esgf_time_units = Unit('days since 0001-01-01',
calendar='proleptic_gregorian')
time_points = date2num(reference_dates, esgf_time_units)
self.cube.add_dim_coord(
DimCoord(time_points, 'time', 'time', 'time', esgf_time_units),
data_dim=0)
self.fix = AllVars(None)
class TestAllVars:
"""Test all vars fixes."""

def test_get(self):
@staticmethod
def test_get():
"""Test getting of fix."""
self.assertListEqual(
Fix.get_fixes('CMIP5', 'ACCESS1-0', 'Amon', 'tas'),
[AllVars(None)])
assert (Fix.get_fixes('CMIP5', 'ACCESS1-0', 'Amon', 'tas')
== [AllVars(None)])

def test_fix_metadata(self):
@staticmethod
def test_fix_metadata(cube):
"""Test fix for bad calendar."""
cube = self.fix.fix_metadata([self.cube])[0]
fix = AllVars(None)
cube = fix.fix_metadata([cube])[0]
time = cube.coord('time')
dates = num2date(time.points, time.units.name, time.units.calendar)
self.assertEqual(time.units.calendar, 'gregorian')
u = Unit('days since 300-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[0], u.num2date(15))
u = Unit('days since 1850-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[1], u.num2date(15))
assert time.units.calendar in ('standard', 'gregorian')
u = Unit('days since 300-01-01 12:00:00', calendar='standard')
assert dates[0] == u.num2date(15)
u = Unit('days since 1850-01-01 12:00:00', calendar='standard')
assert dates[1] == u.num2date(15)

def test_fix_metadata_if_not_time(self):
@staticmethod
def test_fix_metadata_if_not_time(cube):
"""Test calendar fix do not fail if no time coord present."""
self.cube.remove_coord('time')
self.fix.fix_metadata([self.cube])
cube.remove_coord('time')
fix = AllVars(None)
fix.fix_metadata([cube])


def test_get_cl_fix():
Expand Down
71 changes: 40 additions & 31 deletions tests/integration/cmor/_fixes/cmip5/test_access1_3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test fixes for ACCESS1-3."""
import unittest
from datetime import datetime

import pytest
from cf_units import Unit, num2date
from iris.coords import DimCoord
from iris.cube import Cube
Expand All @@ -12,45 +12,54 @@
from esmvalcore.iris_helpers import date2num


class TestAllVars(unittest.TestCase):
"""Test fixes for all vars."""
@pytest.fixture
def cube():
"""Cube for testing."""
test_cube = Cube([1.0, 2.0], var_name='co2', units='J')
reference_dates = [
datetime(300, 1, 16, 12), # e.g. piControl
datetime(1850, 1, 16, 12) # e.g. historical
]
esgf_time_units = Unit(
'days since 0001-01-01',
calendar='proleptic_gregorian',
)
time_points = date2num(reference_dates, esgf_time_units)
test_cube.add_dim_coord(
DimCoord(time_points, 'time', 'time', 'time', esgf_time_units),
data_dim=0,
)
return test_cube


def setUp(self):
"""Prepare tests."""
self.cube = Cube([1.0, 2.0], var_name='co2', units='J')
reference_dates = [
datetime(300, 1, 16, 12), # e.g. piControl
datetime(1850, 1, 16, 12) # e.g. historical
]
esgf_time_units = Unit('days since 0001-01-01',
calendar='proleptic_gregorian')
time_points = date2num(reference_dates, esgf_time_units)
self.cube.add_dim_coord(
DimCoord(time_points, 'time', 'time', 'time', esgf_time_units),
data_dim=0)
self.fix = AllVars(None)
class TestAllVars:
"""Test fixes for all vars."""

def test_get(self):
@staticmethod
def test_get():
"""Test getting of fix."""
self.assertListEqual(
Fix.get_fixes('CMIP5', 'ACCESS1-3', 'Amon', 'tas'),
[AllVars(None)])
assert (Fix.get_fixes('CMIP5', 'ACCESS1-3', 'Amon', 'tas')
== [AllVars(None)])

def test_fix_metadata(self):
@staticmethod
def test_fix_metadata(cube):
"""Test fix for bad calendar."""
cube = self.fix.fix_metadata([self.cube])[0]
fix = AllVars(None)
cube = fix.fix_metadata([cube])[0]
time = cube.coord('time')
dates = num2date(time.points, time.units.name, time.units.calendar)
self.assertEqual(time.units.calendar, 'gregorian')
u = Unit('days since 300-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[0], u.num2date(15))
u = Unit('days since 1850-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[1], u.num2date(15))
assert time.units.calendar in ('standard', 'gregorian')
u = Unit('days since 300-01-01 12:00:00', calendar='standard')
assert dates[0] == u.num2date(15)
u = Unit('days since 1850-01-01 12:00:00', calendar='standard')
assert dates[1] == u.num2date(15)

def test_fix_metadata_if_not_time(self):
@staticmethod
def test_fix_metadata_if_not_time(cube):
"""Test calendar fix do not fail if no time coord present."""
self.cube.remove_coord('time')
self.fix.fix_metadata([self.cube])
cube.remove_coord('time')
fix = AllVars(None)
fix.fix_metadata([cube])


def test_get_cl_fix():
Expand Down
76 changes: 41 additions & 35 deletions tests/integration/cmor/_fixes/cmip5/test_fgoals_g2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test FGOALS-g2 fixes."""
import unittest

import pytest
from cf_units import Unit
from iris.coords import DimCoord
from iris.cube import Cube
Expand All @@ -9,47 +8,54 @@
from esmvalcore.cmor.fix import Fix


class TestAll(unittest.TestCase):
@pytest.fixture
def cube():
"""Cube for testing."""
test_cube = Cube([[1.0, 2.0]], var_name='co2', units='J')
test_cube.add_dim_coord(
DimCoord(
[0.0, 1.0],
standard_name='time',
units=Unit('days since 0001-01', calendar='gregorian')),
1)
test_cube.add_dim_coord(
DimCoord(
[180],
standard_name='longitude',
units=Unit('degrees')),
0)
return test_cube


class TestAll:
"""Test fixes for all vars."""

def setUp(self):
"""Prepare tests."""
self.cube = Cube([[1.0, 2.0]], var_name='co2', units='J')
self.cube.add_dim_coord(
DimCoord(
[0.0, 1.0],
standard_name='time',
units=Unit('days since 0001-01', calendar='gregorian')),
1)
self.cube.add_dim_coord(
DimCoord(
[180],
standard_name='longitude',
units=Unit('degrees')),
0)
self.fix = AllVars(None)

def test_get(self):
@staticmethod
def test_get():
"""Test fix get."""
self.assertListEqual(
Fix.get_fixes('CMIP5', 'FGOALS-G2', 'Amon', 'tas'),
[AllVars(None)])
assert (Fix.get_fixes('CMIP5', 'FGOALS-G2', 'Amon', 'tas')
== [AllVars(None)])

def test_fix_metadata(self):
@staticmethod
def test_fix_metadata(cube):
"""Test calendar fix."""
cube = self.fix.fix_metadata([self.cube])[0]
fix = AllVars(None)
cube = fix.fix_metadata([cube])[0]

time = cube.coord('time')
self.assertEqual(time.units.origin,
'day since 1-01-01 00:00:00.000000')
self.assertEqual(time.units.calendar, 'gregorian')
assert time.units.origin == 'day since 1-01-01 00:00:00.000000'
assert time.units.calendar in ('standard', 'gregorian')

def test_fix_metadata_dont_fail_if_not_longitude(self):
@staticmethod
def test_fix_metadata_dont_fail_if_not_longitude(cube):
"""Test calendar fix."""
self.cube.remove_coord('longitude')
self.fix.fix_metadata([self.cube])
cube.remove_coord('longitude')
fix = AllVars(None)
fix.fix_metadata([cube])

def test_fix_metadata_dont_fail_if_not_time(self):
@staticmethod
def test_fix_metadata_dont_fail_if_not_time(cube):
"""Test calendar fix."""
self.cube.remove_coord('time')
self.fix.fix_metadata([self.cube])
cube.remove_coord('time')
fix = AllVars(None)
fix.fix_metadata([cube])
Loading