iris icon indicating copy to clipboard operation
iris copied to clipboard

Support dask arrays in binary operations

Open rcomer opened this issue 1 year ago • 1 comments

🚀 Pull Request

Description

Currently, the various arithmetic functions state that their second operand may be a cube, a coordinate, a numpy array or a number. There is nothing to stop you passing a dask array as the second operand, but it will be silently realised by the numpy.asanyarray call, which seems unhelpful to me. I think it would be good to explicitly support passing a dask array, though there may be a better way to do it than my current change.

~In draft for now because a bunch of docstrings would need modifying and some tests adding, but I wanted to see if there is agreement in principle first.~


Consult Iris pull request check list

rcomer avatar Aug 24 '22 17:08 rcomer

Since nobody has said otherwise, I went ahead and added a test and updated the docstrings. While I was in the arithmetic docstrings, I updated them to make them more consistent with each other and also applied the numpydoc style. Probably the descriptions could be further improved.

Ready for review I think.

rcomer avatar Sep 14 '22 12:09 rcomer