Skip to content

Commit

Permalink
Added what's new entry
Browse files Browse the repository at this point in the history
  • Loading branch information
schlunma committed Dec 19, 2023
1 parent 0b94878 commit 20b9a90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ This document explains the changes made to Iris for this release
#. `@bouweandela`_ added the option to specify the Dask chunks of the target
array in :func:`iris.util.broadcast_to_shape`. (:pull:`5620`)

#. `@schlunma`_ allowed :func:`iris.analysis.cartography.area_weights` to
return dask arrays with arbitrary chunks. (:pull:`TBA`)

🔥 Deprecations
===============

Expand Down
6 changes: 2 additions & 4 deletions lib/iris/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def broadcast_to_shape(array, shape, dim_map, chunks=None):
"""Broadcast an array to a given shape."""
"""Broadcast an array to a given shape.
Each dimension of the array must correspond to a dimension in the
given shape. The result is a read-only view (see :func:`numpy.broadcast_to`).
Expand Down Expand Up @@ -88,9 +88,7 @@ def broadcast_to_shape(array, shape, dim_map, chunks=None):
# dimensions that have size 1 in the source array.
if array.shape[src_idx] != 1:
chunks[tgt_idx] = array.chunks[src_idx]
broadcast = functools.partial(
da.broadcast_to, shape=shape, chunks=chunks
)
broadcast = functools.partial(da.broadcast_to, shape=shape, chunks=chunks)
else:
broadcast = functools.partial(np.broadcast_to, shape=shape)

Expand Down

0 comments on commit 20b9a90

Please sign in to comment.