| 1283 | class TestDataArrayGroupBy: |
| 1284 | @pytest.fixture(autouse=True) |
| 1285 | def setup(self) -> None: |
| 1286 | self.attrs = {"attr1": "value1", "attr2": 2929} |
| 1287 | self.x = np.random.random((10, 20)) |
| 1288 | self.v = Variable(["x", "y"], self.x) |
| 1289 | self.va = Variable(["x", "y"], self.x, self.attrs) |
| 1290 | self.ds = Dataset({"foo": self.v}) |
| 1291 | self.dv = self.ds["foo"] |
| 1292 | |
| 1293 | self.mindex = pd.MultiIndex.from_product( |
| 1294 | [["a", "b"], [1, 2]], names=("level_1", "level_2") |
| 1295 | ) |
| 1296 | self.mda = DataArray([0, 1, 2, 3], coords={"x": self.mindex}, dims="x") |
| 1297 | |
| 1298 | self.da = self.dv.copy() |
| 1299 | self.da.coords["abc"] = ("y", np.array(["a"] * 9 + ["c"] + ["b"] * 10)) |
| 1300 | self.da.coords["y"] = 20 + 100 * self.da["y"] |
| 1301 | |
| 1302 | def test_stack_groupby_unsorted_coord(self) -> None: |
| 1303 | data = [[0, 1], [2, 3]] |