Skip to content

Commit

Permalink
Fixed a problem with diff'ing masked_arrays with units.
Browse files Browse the repository at this point in the history
See issue #983
  • Loading branch information
joernu76 committed Mar 30, 2020
1 parent 915dd10 commit 8b28102
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/metpy/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def diff(x, **kwargs):
# Can't just use units because of how things like temperature work
it = x.flat
true_units = (next(it) - next(it)).units
return ret * true_units
return true_units * ret
else:
return np.diff(x, **kwargs)

Expand Down

0 comments on commit 8b28102

Please sign in to comment.