Skip to content

Commit 14c3166

Browse files
Merge pull request #891 from ThatDesert/feature/binary-functions
`cf.Data.arctan2()`: Fixes #890 by trying to conform valid units first.
2 parents 2877938 + 05dc56f commit 14c3166

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cf/data/data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4407,7 +4407,9 @@ def arctan2(cls, x1, x2):
44074407
x2: array_like
44084408
X coordinates. *x1* and *x2* must be broadcastable to
44094409
a common shape (which becomes the shape of the
4410-
output).
4410+
output). If both *x1* and *x2* have units, they must
4411+
be equal or equivalent, in which case they
4412+
will be conformed.
44114413
44124414
:Returns:
44134415
@@ -4434,6 +4436,9 @@ def arctan2(cls, x1, x2):
44344436
[90.0 -90.0]
44354437
44364438
"""
4439+
4440+
x1 = conform_units(x1, x2.Units)
4441+
44374442
try:
44384443
y = x1.to_dask_array()
44394444
except AttributeError:

0 commit comments

Comments
 (0)