-
Is there a way to get around this? I tried setting data_vars='different' but still errors. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I guess combine_by_coords seems to work, but I wonder if concat can have a keyword to handle this automatically? |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, the documentation of the Lines 220 to 333 in dd9fe2a If I read that correctly, all variables with dim are added to the set of variables to be concatenated. Every value other than data_vars="minimal" extends that with variables that don't have that dimension.
As a summary, there are two documentation bugs: we don't explicitly state that concatenated variables have to be present in all objects (we currently only learn about that from the error message), and the documentation of I guess the conclusion is that |
Beta Was this translation helpful? Give feedback.
-
This is indeed often awkward. There's been some work and discussion around this before, but nothing yet merged; see #3545 and #508. |
Beta Was this translation helpful? Give feedback.
Unfortunately, the documentation of the
data_vars
parameter is a bit unclear, so we need to look at the code to know its purpose. The variables to be concatenated are calculated in_calc_concat_over
(which could use some refactoring, by the way):xarray/xarray/core/concat.py
Lines 220 to 333 in dd9fe2a