Skip to content
forked from pydata/xarray

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Oct 16, 2019
1 parent bf22695 commit 4ccdc5d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@

def check_reduce_dims(reduce_dims, dimensions):

if is_scalar(reduce_dims):
reduce_dims = [reduce_dims]

if reduce_dims is not ALL_DIMS and any(
[dim not in dimensions for dim in reduce_dims]
):
raise ValueError(
"cannot reduce over dimensions %r. expected either xarray.ALL_DIMS to reduce over all dimensions or one or more of %r."
% (reduce_dims, dimensions)
)
if reduce_dims is not ALL_DIMS:
if is_scalar(reduce_dims):
reduce_dims = [reduce_dims]
if any([dim not in dimensions for dim in reduce_dims]):
raise ValueError(
"cannot reduce over dimensions %r. expected either xarray.ALL_DIMS to reduce over all dimensions or one or more of %r."
% (reduce_dims, dimensions)
)


def unique_value_groups(ar, sort=True):
Expand Down

0 comments on commit 4ccdc5d

Please sign in to comment.