Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ This document explains the changes made to Iris for this release
💣 Incompatible Changes
=======================

#. N/A
#. `@trexfeathers`_ altered testing to accept new Dask copying behaviour from
`dask/dask#9555`_ - copies of a Dask array created using ``da.from_array()``
will all ``compute()`` to a shared identical array. So creating a
:class:`~iris.cube.Cube` using ``Cube(data=da.from_array(...``, then
using :class:`~iris.cube.Cube` :meth:`~iris.cube.Cube.copy`,
will produce two :class:`~iris.cube.Cube`\s that both return an identical
array when requesting :class:`~iris.cube.Cube` :attr:`~iris.cube.Cube.data`.
We do not expect this to affect typical user workflows but please get in
touch if you need help. (:pull:`5041`)


🚀 Performance Enhancements
Expand Down Expand Up @@ -133,6 +141,8 @@ This document explains the changes made to Iris for this release
:mod:`iris.palette` in response to a deprecation warning. Using the new
Matplotlib API also means a ``matplotlib>=3.5`` pin. (:pull:`4998`)

#. See `💣 Incompatible Changes`_ for notes about `dask/dask#9555`_.


📚 Documentation
================
Expand Down Expand Up @@ -186,3 +196,4 @@ This document explains the changes made to Iris for this release
.. _pypa/setuptools#1684: https://github.com/pypa/setuptools/issues/1684
.. _SciTools/cartopy@fcb784d: https://github.com/SciTools/cartopy/commit/fcb784daa65d95ed9a74b02ca292801c02bc4108
.. _SciTools/cartopy@8860a81: https://github.com/SciTools/cartopy/commit/8860a8186d4dc62478e74c83f3b2b3e8f791372e
.. _dask/dask#9555: https://github.com/dask/dask/pull/9555
9 changes: 7 additions & 2 deletions lib/iris/tests/unit/cube/test_Cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,12 +1865,14 @@ class Test_copy(tests.IrisTest):
def _check_copy(self, cube, cube_copy):
self.assertIsNot(cube_copy, cube)
self.assertEqual(cube_copy, cube)
self.assertIsNot(cube_copy.data, cube.data)
self.assertIsNot(cube_copy.core_data(), cube.core_data())
if ma.isMaskedArray(cube.data):
self.assertMaskedArrayEqual(cube_copy.data, cube.data)
if cube.data.mask is not ma.nomask:
# "No mask" is a constant : all other cases must be distinct.
self.assertIsNot(cube_copy.data.mask, cube.data.mask)
self.assertIsNot(
cube_copy.core_data().mask, cube.core_data().mask
)
else:
self.assertArrayEqual(cube_copy.data, cube.data)

Expand Down Expand Up @@ -1911,6 +1913,9 @@ def test__masked_scalar_arraymask(self):
self._check_copy(cube, cube.copy())

def test__lazy(self):
# 2022-11-02: Dask's current behaviour is that the computed array will
# be the same for cube and cube.copy(), even if the Dask arrays are
# different.
cube = Cube(as_lazy_data(np.array([1, 0])))
self._check_copy(cube, cube.copy())

Expand Down
Loading