-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RuntimeError: NetCDF: Invalid dimension ID or name #8072
Comments
interestingly enough, I can open the file using the In any case, |
Yes, I am aware that the file can be opened with Ok, I did not investigate the health of the file following Wondering if it could be doable to make (for reference: see the updated notebook at the link above:
produces:
) |
it appears we recently relaxed this: see #7989 (I totally missed that PR, hence my confusion). That means that after we release the next version you will be able to open the file as-is. To rename the dimension, I think you would need to use import netcdf4 as nc
with nc.Dataset("bar_BSO3_a_rcm7_2008_09.nc", "r+") as ds:
ds.renameDimension("six_con", "six_con_dim")
ds.renameDimension("all_con", "all_con_dim") does not appear to work, so I'm not sure what is wrong with that. |
Ok, so if I understand well, the issue with the initial dataset without ncrename should disappear (which would be enough to more or less close this issue), but there is an issue with ncrename, right? I think this is where this function is developed: https://github.com/nco/nco/blob/master/src/nco/ncrename.c Do you think I should report this issue on their repo at https://github.com/nco/nco for them to look into? :) |
I don't know a lot about |
So nco confirmed this is a bug with the netcdf library, and offered a workaround. Looks like the maintainers of the netcdf library do not have the resources to fix the issue at the moment. Then I guess that this answer from nco, + the fact that a recent pull request fixes this, means that we can close this issue, right? Or am I forgetting something? :) |
Thanks for following up on the NCO repository @jerabaul29
Yes. |
What happened?
I got a long error message and the
RuntimeError: NetCDF: Invalid dimension ID or name
error when trying to open a nc file with xarray. I did a bit of digging around, but could not find a workaround (the issues with similar problems I found were old and supposed to be solved).What did you expect to happen?
No response
Minimal Complete Verifiable Example
See the jupyter notebook: https://github.com/jerabaul29/public_bug_reports/blob/main/xarray/2023_08_15/illustrate_issue_xr.ipynb .
Copying the commands (note that it should be run as a notebook):
MVCE confirmation
Relevant log output
The text was updated successfully, but these errors were encountered: