NetCDF files which contain any variables which have unexpected
names previously meant that terra_model._field_name_from_variable
raised a KeyError. Update the function to return None instead
when given a NetCDF variable name which we are not expecting to
read.
This was encountered when using convert_files.convert to update
old-format NetCDF files without the ncks program, which left
old variables in files which are now unexpected.
Although one could argue that requiring files do not have extra,
unexpected variables is a good feature of the reader, implementing
the behaviour introduced by this commit does mean that old code
should be able to continue to read newer file versions which only
add new variables.
NetCDF files which contain any variables which have unexpected names previously meant that
terra_model._field_name_from_variable
raised aKeyError
. Update the function to returnNone
instead when given a NetCDF variable name which we are not expecting to read.This was encountered when using
convert_files.convert
to update old-format NetCDF files without thencks
program, which left old variables in files which are now unexpected.Although one could argue that requiring files do not have extra, unexpected variables is a good feature of the reader, implementing the behaviour introduced by this commit does mean that old code should be able to continue to read newer file versions which only add new variables.
For all pull requests:
contrib/utilities/indent
script from the main directory to indent my code.