|  | 
| 1 |  | -# (C) British Crown Copyright 2013 - 2016, Met Office | 
|  | 1 | +# (C) British Crown Copyright 2013 - 2017, Met Office | 
| 2 | 2 | # | 
| 3 | 3 | # This file is part of Iris. | 
| 4 | 4 | # | 
| @@ -72,21 +72,18 @@ def check_common(self, name_cube, grib_cube): | 
| 72 | 72 |     def test_name2_field(self): | 
| 73 | 73 |         filepath = tests.get_data_path(('NAME', 'NAMEII_field.txt')) | 
| 74 | 74 |         name_cubes = iris.load(filepath) | 
| 75 |  | -        # Check gribapi version, because we currently have a known load/save | 
| 76 |  | -        # problem with gribapi 1v14 (at least). | 
| 77 |  | -        gribapi_ver = gribapi.grib_get_api_version() | 
| 78 |  | -        gribapi_fully_supported_version = \ | 
| 79 |  | -            (StrictVersion(gribapi.grib_get_api_version()) < | 
| 80 |  | -             StrictVersion('1.13')) | 
|  | 75 | + | 
|  | 76 | +        # we currently have a known load/save | 
|  | 77 | +        # problem with gribapi version and zero only data, where min == max. | 
|  | 78 | + | 
| 81 | 79 |         for i, name_cube in enumerate(name_cubes): | 
| 82 |  | -            if not gribapi_fully_supported_version: | 
| 83 |  | -                data = name_cube.data | 
| 84 |  | -                if np.min(data) == np.max(data): | 
| 85 |  | -                    msg = ('NAMEII cube #{}, "{}" has empty data : ' | 
| 86 |  | -                           'SKIPPING test for this cube, as save/load will ' | 
| 87 |  | -                           'not currently work with gribabi > 1v12.') | 
| 88 |  | -                    warnings.warn(msg.format(i, name_cube.name())) | 
| 89 |  | -                    continue | 
|  | 80 | +            data = name_cube.data | 
|  | 81 | +            if np.min(data) == np.max(data): | 
|  | 82 | +                msg = ('NAMEII cube #{}, "{}" has empty data : ' | 
|  | 83 | +                       'SKIPPING test for this cube, as save/load will ' | 
|  | 84 | +                       'not currently work with gribabi > 1v12.') | 
|  | 85 | +                warnings.warn(msg.format(i, name_cube.name())) | 
|  | 86 | +                continue | 
| 90 | 87 | 
 | 
| 91 | 88 |             with self.temp_filename('.grib2') as temp_filename: | 
| 92 | 89 |                 iris.save(name_cube, temp_filename) | 
|  | 
0 commit comments