-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Consistently report all dimensions in error messages if invalid dimensions are given #8079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e01bca0
0ffc8bc
dc6edcb
d84ab2a
1388bf0
99ca40b
595c735
a498ef5
67addd7
7fa5026
fdcad9a
ee1ced1
5b6ebd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -391,17 +391,20 @@ def process_subset_opt(opt, subset): | |||||
else: | ||||||
raise ValueError(f"unexpected value for {subset}: {opt}") | ||||||
else: | ||||||
invalid_vars = [k for k in opt if k not in getattr(datasets[0], subset)] | ||||||
valid_vars = tuple(getattr(datasets[0], subset)) | ||||||
invalid_vars = [k for k in opt if k not in valid_vars] | ||||||
if invalid_vars: | ||||||
if subset == "coords": | ||||||
raise ValueError( | ||||||
"some variables in coords are not coordinates on " | ||||||
f"the first dataset: {invalid_vars}" | ||||||
f"the variables {invalid_vars} in coords are not " | ||||||
f"found in the coordinates of the first dataset {valid_vars}" | ||||||
) | ||||||
else: | ||||||
# note: data_vars are not listed in the error message here, | ||||||
# because there may be lots of them | ||||||
raise ValueError( | ||||||
"some variables in data_vars are not data variables " | ||||||
f"on the first dataset: {invalid_vars}" | ||||||
f"the variables {invalid_vars} in data_vars are not " | ||||||
f"found in the data variables of the first dataset" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I explicitly left out listing the data variables, because it's more likely to have many of them like in #5546 (see also the comment in the code right above this) |
||||||
) | ||||||
concat_over.update(opt) | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.