-
Notifications
You must be signed in to change notification settings - Fork 285
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.save crashes for NetCDF for cube with no cell_methods #3288
Comments
That's not a save bug, it's a bad cube.
The question is, how did you come by such a thing ? |
OK. The The cube was created from NAME output. The Name_No_time_averaging.txt file is a stripped-down example. The iris/lib/iris/fileformats/name_loaders.py Line 524 in 45a18ab
The data in file matches the |
Ok, my apologies, that one clearly is a bug !! The code seems in fact to have 2 different possible ways of getting I wonder, do you feel up to proposing a fix for this yourself ? |
Yes, I can make a fix. I'll have a go next week. I have more questions; I'll ask them then. |
Fantastic! Thanks so much for engaging 💐 🥇 |
I can have a go at fixing this (including tests) but I'm not sure what the correct behaviour is. Should I update the NAME loader so that it doesn't return a cell_method of Alternatively, should I update the NetCDF Saver so that it doesn't crash if it receives a cell_method of |
Hi - just wondering if anything came of this? I've just re-encountered the problem (iris v3.0.1), so I am assuming not. Same issue, lloading NAME data that has no time averaging, and then I need to save the cube to NetCDF. Thanks |
@benjamindrummond it sure does look like this has stalled... The correct behaviour for Iris cubes without cell methods, incidentally, is that their # Confirm current behaviour.
print(cube.cell_methods)
(None,)
# Correctly specify that this cube doesn't have cell methods.
cube.cell_methods = () This workaround should mean you can at least save affected cubes! |
I think I've now got #4933 into a reasonable state. I have noted in #4933 that we could add an integration test for the fix, but it needs suitable test data which I don't have the knowledge to be sure of. |
Yes, please use the test file in iris-test-data. |
I will add a testcase for that, and fix the outstanding merge conflict ... |
Ok I think #4933 fixed! |
Just need to make sure we merge it to |
I have cube where
cube.cell_methods == (None,)
. When I try to save it to NetCDF, Iris crashes with the following exception:The error occurs within the NetCDF
Saver._create_cf_cell_methods()
function.I think this is a bug. Unfortunately I don't know enough about NetCDF to suggest a fix.
The following code reproduces the error using the NAME_No_time_averaging.txt file.
The text was updated successfully, but these errors were encountered: