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

Method test_concat_only_first_dim

xarray/tests/test_combine.py:327–348  ·  view source on GitHub ↗
(self, create_combined_ids)

Source from the content-addressed store, hash-verified

325 assert_combined_tile_ids_equal(result, {(): expected_ds})
326
327 def test_concat_only_first_dim(self, create_combined_ids):
328 shape = (2, 3)
329 combined_ids = create_combined_ids(shape)
330 result = _combine_all_along_first_dim(
331 combined_ids,
332 dim="dim1",
333 data_vars="all",
334 coords="different",
335 compat="no_conflicts",
336 fill_value=dtypes.NA,
337 join="outer",
338 combine_attrs="drop",
339 )
340
341 ds = create_test_data
342 partway1 = concat([ds(0), ds(3)], dim="dim1")
343 partway2 = concat([ds(1), ds(4)], dim="dim1")
344 partway3 = concat([ds(2), ds(5)], dim="dim1")
345 expected_datasets = [partway1, partway2, partway3]
346 expected = {(i,): ds for i, ds in enumerate(expected_datasets)}
347
348 assert_combined_tile_ids_equal(result, expected)
349
350 @pytest.mark.parametrize(
351 "concat_dim, kwargs", [("dim1", {}), ("new_dim", {"data_vars": "all"})]

Callers

nothing calls this directly

Calls 5

concatFunction · 0.90
create_combined_idsFunction · 0.85
dsFunction · 0.70

Tested by

no test coverage detected