Skip to content

Commit

Permalink
keep the order of the dims in concat
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Sep 11, 2020
1 parent 1de3933 commit d53db2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xarray/core/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ def _parse_datasets(
all_coord_names.update(ds.coords)
data_vars.update(ds.data_vars)

for dim in set(ds.dims) - dims:
common_dims = set(ds.dims) - dims
for dim in ds.dims:
if dim not in common_dims:
continue

if dim not in dim_coords:
dim_coords[dim] = ds.coords[dim].variable
dims = dims | set(ds.dims)
Expand Down

0 comments on commit d53db2a

Please sign in to comment.