Skip to content
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

Cannot load data when duplicate variable in output #287

Open
jk-rieck opened this issue Nov 18, 2021 · 2 comments
Open

Cannot load data when duplicate variable in output #287

jk-rieck opened this issue Nov 18, 2021 · 2 comments

Comments

@jk-rieck
Copy link

xmitgcm.open_mdsdataset() fails with ValueError: dimensions ('time', 'j', 'i') must have the same length as the number of data dimensions, ndim=2 if the field to read has a duplicate variable, i.e. the user has defined a variable twice to the same file in data.diagnostics. For example if I define fields(1:2,1) = 'UVEL', 'UVEL',, xmitgcm cannot read the resulting model output.

Admittedly, this is not really a big issue as the case that results in the error is not a useful one. However, an error message could maybe be implemented so the user knows immediately what's wrong. Or would it make more sense to not allow the diagnostics package to write the same variable multiple times to the same file?

@rabernat
Copy link
Member

Thanks for the issue. I believe this is very closely related to #286.

@jk-rieck
Copy link
Author

A behavior like in #286 would actually be almost a feature for this issue. At least the case in #286 does not raise an error and in the end the variable is in the dataset. The difference between the two issues is that in #286 the variable with the same name/id is present in two separate files, while in #287 it is present twice in the same file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants