16
16
merge_attrs ,
17
17
merge_collected ,
18
18
)
19
- from xarray .core .types import T_DataArray , T_Dataset
19
+ from xarray .core .types import T_DataArray , T_Dataset , T_Variable
20
20
from xarray .core .variable import Variable
21
21
from xarray .core .variable import concat as concat_vars
22
22
34
34
@overload
35
35
def concat (
36
36
objs : Iterable [T_Dataset ],
37
- dim : Hashable | T_DataArray | pd .Index ,
37
+ dim : Hashable | T_Variable | T_DataArray | pd .Index ,
38
38
data_vars : T_DataVars = "all" ,
39
39
coords : ConcatOptions | list [Hashable ] = "different" ,
40
40
compat : CompatOptions = "equals" ,
@@ -49,7 +49,7 @@ def concat(
49
49
@overload
50
50
def concat (
51
51
objs : Iterable [T_DataArray ],
52
- dim : Hashable | T_DataArray | pd .Index ,
52
+ dim : Hashable | T_Variable | T_DataArray | pd .Index ,
53
53
data_vars : T_DataVars = "all" ,
54
54
coords : ConcatOptions | list [Hashable ] = "different" ,
55
55
compat : CompatOptions = "equals" ,
@@ -80,11 +80,11 @@ def concat(
80
80
xarray objects to concatenate together. Each object is expected to
81
81
consist of variables and coordinates with matching shapes except for
82
82
along the concatenated dimension.
83
- dim : Hashable or DataArray or pandas.Index
83
+ dim : Hashable or Variable or DataArray or pandas.Index
84
84
Name of the dimension to concatenate along. This can either be a new
85
85
dimension name, in which case it is added along axis=0, or an existing
86
86
dimension name, in which case the location of the dimension is
87
- unchanged. If dimension is provided as a DataArray or Index, its name
87
+ unchanged. If dimension is provided as a Variable, DataArray or Index, its name
88
88
is used as the dimension to concatenate along and the values are added
89
89
as a coordinate.
90
90
data_vars : {"minimal", "different", "all"} or list of Hashable, optional
@@ -450,7 +450,7 @@ def _parse_datasets(
450
450
451
451
def _dataset_concat (
452
452
datasets : list [T_Dataset ],
453
- dim : str | T_DataArray | pd .Index ,
453
+ dim : str | T_Variable | T_DataArray | pd .Index ,
454
454
data_vars : T_DataVars ,
455
455
coords : str | list [str ],
456
456
compat : CompatOptions ,
@@ -676,7 +676,7 @@ def get_indexes(name):
676
676
677
677
def _dataarray_concat (
678
678
arrays : Iterable [T_DataArray ],
679
- dim : str | T_DataArray | pd .Index ,
679
+ dim : str | T_Variable | T_DataArray | pd .Index ,
680
680
data_vars : T_DataVars ,
681
681
coords : str | list [str ],
682
682
compat : CompatOptions ,
0 commit comments