Is your feature request related to a problem?
The current implementation of xarray.concat does not allow to specify paths of data variables that should be concatenated when operating on DataTrees. Instead, the data_vars argument is passed on to _dataset_concat calls unaltered on the individual nodes, so that passing a list of data variable names only works if those variables are present at all nodes of the trees.
Describe the solution you'd like
I would like to be able to specify a list of paths to data variables, e.g.
xr.concat((datatree_a, datatree_b), dim=xr.Variable("new_dim", ["a", "b"]), data_vars=["path/to/data_var_1", "path/to/data_var_2"])
The implementation of _datatree_concat would have to split the paths and then call _dataset_concat on each node only with the data vars prefixed with the path of each node.
Describe alternatives you've considered
No response
Additional context
Ideally, wildcards would be allowed both in the path and in the name of the data variable, this could easily be achieved using Pythons fnmatch module.
Is your feature request related to a problem?
The current implementation of
xarray.concatdoes not allow to specify paths of data variables that should be concatenated when operating on DataTrees. Instead, thedata_varsargument is passed on to_dataset_concatcalls unaltered on the individual nodes, so that passing a list of data variable names only works if those variables are present at all nodes of the trees.Describe the solution you'd like
I would like to be able to specify a list of paths to data variables, e.g.
The implementation of
_datatree_concatwould have to split the paths and then call_dataset_concaton each node only with the data vars prefixed with the path of each node.Describe alternatives you've considered
No response
Additional context
Ideally, wildcards would be allowed both in the path and in the name of the data variable, this could easily be achieved using Pythons
fnmatchmodule.