Skip to content

Commit

Permalink
undo the sorting of dimensions
Browse files Browse the repository at this point in the history
since they are already sorted for Dataset objects
  • Loading branch information
keewis committed Sep 6, 2020
1 parent d110fd2 commit d813c7c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions xarray/core/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .duck_array_ops import array_equiv
from .options import OPTIONS
from .pycompat import dask_array_type, sparse_array_type
from .utils import is_dict_like, is_duck_array
from .utils import is_duck_array


def pretty_print(x, numchars: int):
Expand Down Expand Up @@ -405,10 +405,7 @@ def indexes_repr(indexes):


def dim_summary(obj):
dims = obj.sizes
if is_dict_like(obj):
dims = dict(sorted(dims.items(), key=lambda item: str(item[0])))
elements = [f"{k}: {v}" for k, v in dims.items()]
elements = [f"{k}: {v}" for k, v in obj.sizes.items()]
return ", ".join(elements)


Expand Down

0 comments on commit d813c7c

Please sign in to comment.