From 87869626e6ff955c7188eb049751b5f18254452b Mon Sep 17 00:00:00 2001 From: Bill Little Date: Fri, 31 Mar 2023 16:33:20 +0100 Subject: [PATCH] raise dask min pin (#5225) * raise dask min pin * replace workaround * add whatsnew entry --- docs/src/whatsnew/latest.rst | 7 ++++++- lib/iris/analysis/cartography.py | 8 ++------ requirements/py310.yml | 2 +- requirements/py38.yml | 2 +- requirements/py39.yml | 2 +- setup.cfg | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 16069ddf6d..51adfb9d8d 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -151,6 +151,10 @@ This document explains the changes made to Iris for this release #. `@trexfeathers`_ moved the benchmark runner conveniences from ``noxfile.py`` to a dedicated ``benchmarks/bm_runner.py``. (:pull:`5215`) +#. `@bjlittle`_ follow-up to :pull:`4972`, enforced ``dask>=2022.09.0`` minimum + pin for first use of `dask.array.ma.empty_like`_ and replaced `@tinyendian`_ + workaround. (:pull:`5225`) + .. comment Whatsnew author names (@github name) in alphabetical order. Note that, @@ -167,4 +171,5 @@ This document explains the changes made to Iris for this release Whatsnew resources in alphabetical order: .. _#ShowYourStripes: https://showyourstripes.info/s/globe/ -.. _README.md: https://github.com/SciTools/iris#----- \ No newline at end of file +.. _README.md: https://github.com/SciTools/iris#----- +.. _dask.array.ma.empty_like: https://docs.dask.org/en/stable/generated/dask.array.ma.empty_like.html diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index fffb11f295..5b11495d5a 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -1244,12 +1244,8 @@ def rotate_winds(u_cube, v_cube, target_cs): if apply_mask: # Make masked arrays to accept masking. if lazy_output: - ut_cube = ut_cube.copy( - data=da.ma.masked_array(ut_cube.core_data()) - ) - vt_cube = vt_cube.copy( - data=da.ma.masked_array(vt_cube.core_data()) - ) + ut_cube = ut_cube.copy(data=da.ma.empty_like(ut_cube.core_data())) + vt_cube = vt_cube.copy(data=da.ma.empty_like(vt_cube.core_data())) else: ut_cube.data = ma.asanyarray(ut_cube.data) vt_cube.data = ma.asanyarray(vt_cube.data) diff --git a/requirements/py310.yml b/requirements/py310.yml index e3bada6596..49b8ae78ab 100644 --- a/requirements/py310.yml +++ b/requirements/py310.yml @@ -14,7 +14,7 @@ dependencies: - cartopy >=0.21 - cf-units >=3.1 - cftime >=1.5 - - dask-core >=2.26 + - dask-core >=2022.9.0 - matplotlib >=3.5 - netcdf4 - numpy >=1.19 diff --git a/requirements/py38.yml b/requirements/py38.yml index 9393060113..1e3c61f369 100644 --- a/requirements/py38.yml +++ b/requirements/py38.yml @@ -14,7 +14,7 @@ dependencies: - cartopy >=0.21 - cf-units >=3.1 - cftime >=1.5 - - dask-core >=2.26 + - dask-core >=2022.9.0 - matplotlib >=3.5 - netcdf4 - numpy >=1.19 diff --git a/requirements/py39.yml b/requirements/py39.yml index 349784ec46..6551eee495 100644 --- a/requirements/py39.yml +++ b/requirements/py39.yml @@ -14,7 +14,7 @@ dependencies: - cartopy >=0.21 - cf-units >=3.1 - cftime >=1.5 - - dask-core >=2.26 + - dask-core >=2022.9.0 - matplotlib >=3.5 - netcdf4 - numpy >=1.19 diff --git a/setup.cfg b/setup.cfg index ba9844f5d8..aac726776c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ install_requires = cartopy>=0.21 cf-units>=3.1 cftime>=1.5.0 - dask[array]>=2.26 + dask[array]>=2022.9.0 matplotlib>=3.5 netcdf4 numpy>=1.19