Remove apparently obsolete code in iris.save #4919
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I suspect that [this line] does not do anything useful, but recent testing changes have to accommodate it, e.g.
Notably here, and this supporting code,
which were introduced in #3411
This is now affecting #4913, which is also having to work around testing for this usage.
But I can't see that this usage does any good (!)
UPDATE:
This fails in
iris.tests.test_file_save, demonstrating that there was originally an intention to support saving to an open file (handle), which is what this code was supposed to enable.So, at present, this does work for PP files (as tested in iris/tests/test_file_save.py), but not for netcdf saves.
Not knowing about this, I recently wrote a PoC patch to add saving to an open netCDF4.Dataset object, via a different mechanism here
TODO: possibly should fix to support this mode?