@@ -650,7 +650,7 @@ def test_merge_one_dim_concat_another(self):
650
650
expected = Dataset ({'foo' : ('x' , [0 , 1 , 2 , 3 ]),
651
651
'bar' : ('x' , [10 , 20 , 30 , 40 ])})
652
652
653
- actual = auto_combine (objs , concat_dim = ['x' , None ])
653
+ actual = auto_combine (objs , concat_dim = ['x' , None ], compat = 'equals' )
654
654
assert_identical (expected , actual )
655
655
656
656
actual = auto_combine (objs )
@@ -661,7 +661,19 @@ def test_merge_one_dim_concat_another(self):
661
661
Dataset ({'foo' : ('x' , [2 , 3 ])})],
662
662
[Dataset ({'bar' : ('x' , [10 , 20 ])}),
663
663
Dataset ({'bar' : ('x' , [30 , 40 ])})]]
664
- actual = auto_combine (objs , concat_dim = [None , 'x' ])
664
+ actual = auto_combine (objs , concat_dim = [None , 'x' ], compat = 'equals' )
665
+ assert_identical (expected , actual )
666
+
667
+ def test_internal_ordering (self ):
668
+ # This gives a MergeError if _auto_combine_1d is not sorting by
669
+ # data_vars correctly, see GH #2662
670
+ objs = [Dataset ({'foo' : ('x' , [0 , 1 ])}),
671
+ Dataset ({'bar' : ('x' , [10 , 20 ])}),
672
+ Dataset ({'foo' : ('x' , [2 , 3 ])}),
673
+ Dataset ({'bar' : ('x' , [30 , 40 ])})]
674
+ actual = auto_combine (objs , concat_dim = 'x' , compat = 'equals' )
675
+ expected = Dataset ({'foo' : ('x' , [0 , 1 , 2 , 3 ]),
676
+ 'bar' : ('x' , [10 , 20 , 30 , 40 ])})
665
677
assert_identical (expected , actual )
666
678
667
679
def test_combine_concat_over_redundant_nesting (self ):
0 commit comments