MCPcopy
hub / github.com/pydata/xarray / test_groupby_dataset_order

Function test_groupby_dataset_order

xarray/tests/test_groupby.py:1188–1200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1186
1187
1188def test_groupby_dataset_order() -> None:
1189 # groupby should preserve variables order
1190 ds = Dataset()
1191 for vn in ["a", "b", "c"]:
1192 ds[vn] = DataArray(np.arange(10), dims=["t"])
1193 data_vars_ref = list(ds.data_vars.keys())
1194 ds = ds.groupby("t").mean(...)
1195 data_vars = list(ds.data_vars.keys())
1196 assert data_vars == data_vars_ref
1197 # coords are now at the end of the list, so the test below fails
1198 # all_vars = list(ds.variables.keys())
1199 # all_vars_ref = list(ds.variables.keys())
1200 # .assertEqual(all_vars, all_vars_ref)
1201
1202
1203def test_groupby_dataset_fillna() -> None:

Callers

nothing calls this directly

Calls 6

groupbyMethod · 0.95
DatasetClass · 0.90
DataArrayClass · 0.90
arangeMethod · 0.80
keysMethod · 0.80
meanMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…