-
Notifications
You must be signed in to change notification settings - Fork 283
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
Iris 3.3.1 fails unhelpfully when it finds a bad cell_methods attribute #5319
Comments
This also was the case with #5237, although with some AVD help we did manage to find the issue |
I can't reproduce the failure with v3.3.1, but the file does not seem to have been modified since January 😕 In [1]: import iris
In [2]: iris.load('/data/users/esmval/ESMValTool/temporary/obs/Tier2/ESACCI-SOILMOISTURE/OBS_ESACCI-SOILMOISTURE_sat_L3S-SSMV-COMBINED-v4.2_Lmon_sm_197901-201
...: 612.nc')
Out[2]: [<iris 'Cube' of Volumetric Moisture in Upper Portion of Soil Column / (m3 m-3) (time: 456; latitude: 720; longitude: 1440)>]
In [3]: iris.__version__
Out[3]: '3.3.1' |
Thanks for investigating @rcomer. I think that the file has been updated, but as a mirror of larger tree, so the file timestamp probably reflects the update time in the source of the mirror. I've taken a copy and hacked the problem back into the header. New bad file is: Note that the fix to the source file means that this is a less pressing issue for me at least. Though I'd still argue that Iris should fail more gracefully in such cases, as a nice-to-have. |
Discussed at @SciTools/peloton, when/if #5126 is banked we can see whether it also addresses this issue. |
Have confirmed locally that #5126 would fix this. |
🐛 Bug Report
Loading a file produced by the ESA CCI project, it fails with
IndexError: list index out of range
(full traceback in additional context section). To be fair on Iris, the file contains a dodgy cell_methods attribute (see also in additional context) and fails cfchecker as a result. (Deleting the cell_methods attribute with ncatted prevents the error.)The alleged bug is the unhelpful error message (though the traceback gives a clue as to where the issue is).
How To Reproduce
Steps to reproduce the behaviour:
(Not saying which system that path is on, but AVD team may be able to guess ;o). The same file can be found on JASMIN at /gws/nopw/j04/esmeval/obsdata-v2/Tier2/ESACCI-SOILMOISTURE/OBS_ESACCI-SOILMOISTURE_sat_L3S-SSMV-COMBINED-v4.2_Lmon_sm_197901-201612.nc)
Expected behaviour
Either return a cube (potentially with a warning about the CF non-compliance), or provide an informative error message.
Iris 3.2.1 returned a cube with no warning, and no cell_methods attribute, which was acceptable behaviour for me at least. Note that both Iris 3.2.1 and 3.3.1 happily ignore bad cell_measures and standard_name attributes in the same file.
Screenshots
Environment
Additional context
Traceback and partial netCDF header in details...
Click to expand this section...
netCDF header for offending variable:
Traceback
The text was updated successfully, but these errors were encountered: