diff --git a/environment.yml b/environment.yml index 00696ef452..9cfe3bfe56 100644 --- a/environment.yml +++ b/environment.yml @@ -29,7 +29,7 @@ dependencies: - netcdf4 - numpy !=1.24.3,<2.0.0 # avoid pulling 2.0.0rcX - packaging - - pandas !=2.2.0,!=2.2.1,!=2.2.2 # github.com/ESMValGroup/ESMValCore/pull/2305 and #2349 + - pandas - pillow - pip !=21.3 - prov diff --git a/esmvalcore/cmor/_fixes/icon/icon.py b/esmvalcore/cmor/_fixes/icon/icon.py index 707a47f20c..51cb5a0274 100644 --- a/esmvalcore/cmor/_fixes/icon/icon.py +++ b/esmvalcore/cmor/_fixes/icon/icon.py @@ -492,8 +492,11 @@ def _fix_invalid_time_units(time_coord): # Finally, add date and day fraction to get final datetime and convert # it to correct units. Note: we also round to next second, otherwise # this results in times that are off by 1s (e.g., 13:59:59 instead of - # 14:00:00). - rounded_datetimes = (year_month_day + day_float).round('s') + # 14:00:00). We round elements individually since rounding the + # pd.Series object directly is broken + # (https://github.com/pandas-dev/pandas/issues/57002). + datetimes = year_month_day + day_float + rounded_datetimes = pd.Series(dt.round('s') for dt in datetimes) with warnings.catch_warnings(): # We already fixed the deprecated code as recommended in the # warning, but it still shows up -> ignore it diff --git a/setup.py b/setup.py index e1645d3085..4f8081b382 100755 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ 'netCDF4', 'numpy!=1.24.3,<2.0.0', # avoid pulling 2.0.0rc1 'packaging', - 'pandas!=2.2.0,!=2.2.1,!=2.2.2', # GH #2305 #2349 etc + 'pandas', 'pillow', 'prov', 'psutil',