diff --git a/lib/iris/tests/integration/test_grib_load.py b/lib/iris/tests/integration/test_grib_load.py deleted file mode 100644 index f1eb5888d5..0000000000 --- a/lib/iris/tests/integration/test_grib_load.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright Iris contributors -# -# This file is part of Iris and is released under the LGPL license. -# See COPYING and COPYING.LESSER in the root of the repository for full -# licensing details. -""" -Integration tests for grib2 file loading. - -This code used to be part of 'tests/test_grib_load.py', but these integration- -style tests have been split out of there. - -The remainder of the old 'tests/test_grib_load.py' is now renamed as -'tests/test_grib_load_translations.py'. Those tests are implementation- -specific, and target the module 'iris_grib'. - -""" - -# Import iris tests first so that some things can be initialised before -# importing anything else -import iris.tests as tests - -import iris -import iris.exceptions -import iris.tests.stock -import iris.util - - -@tests.skip_data -@tests.skip_grib -class TestBasicLoad(tests.GraphicsTest): - def test_load_rotated(self): - cubes = iris.load( - tests.get_data_path(("GRIB", "rotated_uk", "uk_wrongparam.grib1")) - ) - self.assertCML(cubes, ("grib_load", "rotated.cml")) - - def test_load_time_bound(self): - cubes = iris.load( - tests.get_data_path(("GRIB", "time_processed", "time_bound.grib1")) - ) - self.assertCML(cubes, ("grib_load", "time_bound_grib1.cml")) - - def test_load_time_processed(self): - cubes = iris.load( - tests.get_data_path(("GRIB", "time_processed", "time_bound.grib2")) - ) - self.assertCML(cubes, ("grib_load", "time_bound_grib2.cml")) - - def test_load_3_layer(self): - cubes = iris.load( - tests.get_data_path(("GRIB", "3_layer_viz", "3_layer.grib2")) - ) - cubes = iris.cube.CubeList([cubes[1], cubes[0], cubes[2]]) - self.assertCML(cubes, ("grib_load", "3_layer.cml")) - - def test_load_masked(self): - gribfile = tests.get_data_path( - ("GRIB", "missing_values", "missing_values.grib2") - ) - cubes = iris.load(gribfile) - self.assertCML(cubes, ("grib_load", "missing_values_grib2.cml")) - - def test_polar_stereo_grib1(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "polar_stereo", "ST4.2013052210.01h")) - ) - self.assertCML(cube, ("grib_load", "polar_stereo_grib1.cml")) - - def test_polar_stereo_grib2_grid_definition(self): - cube = iris.load_cube( - tests.get_data_path( - ( - "GRIB", - "polar_stereo", - "CMC_glb_TMP_ISBL_1015_ps30km_2013052000_P006.grib2", - ) - ) - ) - self.assertEqual(cube.shape, (200, 247)) - pxc = cube.coord("projection_x_coordinate") - self.assertAlmostEqual(pxc.points.max(), 4769905.5125, places=4) - self.assertAlmostEqual(pxc.points.min(), -2610094.4875, places=4) - pyc = cube.coord("projection_y_coordinate") - self.assertAlmostEqual(pyc.points.max(), -216.1459, places=4) - self.assertAlmostEqual(pyc.points.min(), -5970216.1459, places=4) - self.assertEqual(pyc.coord_system, pxc.coord_system) - self.assertEqual(pyc.coord_system.grid_mapping_name, "stereographic") - self.assertEqual(pyc.coord_system.central_lat, 90.0) - self.assertEqual(pyc.coord_system.central_lon, 249.0) - self.assertEqual(pyc.coord_system.false_easting, 0.0) - self.assertEqual(pyc.coord_system.false_northing, 0.0) - self.assertEqual(pyc.coord_system.true_scale_lat, 60.0) - - def test_lambert_grib1(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "lambert", "lambert.grib1")) - ) - self.assertCML(cube, ("grib_load", "lambert_grib1.cml")) - - def test_lambert_grib2(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "lambert", "lambert.grib2")) - ) - self.assertCML(cube, ("grib_load", "lambert_grib2.cml")) - - def test_regular_gg_grib1(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "gaussian", "regular_gg.grib1")) - ) - self.assertCML(cube, ("grib_load", "regular_gg_grib1.cml")) - - def test_regular_gg_grib2(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "gaussian", "regular_gg.grib2")) - ) - self.assertCML(cube, ("grib_load", "regular_gg_grib2.cml")) - - def test_reduced_ll(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "reduced", "reduced_ll.grib1")) - ) - self.assertCML(cube, ("grib_load", "reduced_ll_grib1.cml")) - - def test_reduced_gg(self): - cube = iris.load_cube( - tests.get_data_path(("GRIB", "reduced", "reduced_gg.grib2")) - ) - self.assertCML(cube, ("grib_load", "reduced_gg_grib2.cml")) - - -@tests.skip_data -@tests.skip_grib -class TestIjDirections(tests.GraphicsTest): - @staticmethod - def _old_compat_load(name): - cube = iris.load(tests.get_data_path(("GRIB", "ij_directions", name)))[ - 0 - ] - return [cube] - - def test_ij_directions_ipos_jpos(self): - cubes = self._old_compat_load("ipos_jpos.grib2") - self.assertCML(cubes, ("grib_load", "ipos_jpos.cml")) - - def test_ij_directions_ipos_jneg(self): - cubes = self._old_compat_load("ipos_jneg.grib2") - self.assertCML(cubes, ("grib_load", "ipos_jneg.cml")) - - def test_ij_directions_ineg_jneg(self): - cubes = self._old_compat_load("ineg_jneg.grib2") - self.assertCML(cubes, ("grib_load", "ineg_jneg.cml")) - - def test_ij_directions_ineg_jpos(self): - cubes = self._old_compat_load("ineg_jpos.grib2") - self.assertCML(cubes, ("grib_load", "ineg_jpos.cml")) - - -@tests.skip_data -@tests.skip_grib -class TestShapeOfEarth(tests.GraphicsTest): - @staticmethod - def _old_compat_load(name): - cube = iris.load( - tests.get_data_path(("GRIB", "shape_of_earth", name)) - )[0] - return cube - - def test_shape_of_earth_basic(self): - # pre-defined sphere - cube = self._old_compat_load("0.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_0.cml")) - - def test_shape_of_earth_custom_1(self): - # custom sphere - cube = self._old_compat_load("1.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_1.cml")) - - def test_shape_of_earth_IAU65(self): - # IAU65 oblate sphere - cube = self._old_compat_load("2.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_2.cml")) - - def test_shape_of_earth_custom_3(self): - # custom oblate spheroid (km) - cube = self._old_compat_load("3.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_3.cml")) - - def test_shape_of_earth_IAG_GRS80(self): - # IAG-GRS80 oblate spheroid - cube = self._old_compat_load("4.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_4.cml")) - - def test_shape_of_earth_WGS84(self): - # WGS84 - cube = self._old_compat_load("5.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_5.cml")) - - def test_shape_of_earth_pre_6(self): - # pre-defined sphere - cube = self._old_compat_load("6.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_6.cml")) - - def test_shape_of_earth_custom_7(self): - # custom oblate spheroid (m) - cube = self._old_compat_load("7.grib2") - self.assertCML(cube, ("grib_load", "earth_shape_7.cml")) - - def test_shape_of_earth_grib1(self): - # grib1 - same as grib2 shape 6, above - cube = self._old_compat_load("global.grib1") - self.assertCML(cube, ("grib_load", "earth_shape_grib1.cml")) - - -if __name__ == "__main__": - tests.main() diff --git a/lib/iris/tests/results/grib_load/3_layer.cml b/lib/iris/tests/results/grib_load/3_layer.cml deleted file mode 100644 index 76cc41a04a..0000000000 --- a/lib/iris/tests/results/grib_load/3_layer.cml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_0.cml b/lib/iris/tests/results/grib_load/earth_shape_0.cml deleted file mode 100644 index bb51db3201..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_0.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_1.cml b/lib/iris/tests/results/grib_load/earth_shape_1.cml deleted file mode 100644 index 774e9921b5..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_1.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_2.cml b/lib/iris/tests/results/grib_load/earth_shape_2.cml deleted file mode 100644 index 3ff9ccccb5..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_2.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_3.cml b/lib/iris/tests/results/grib_load/earth_shape_3.cml deleted file mode 100644 index 47d11467ee..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_3.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_4.cml b/lib/iris/tests/results/grib_load/earth_shape_4.cml deleted file mode 100644 index e6aa14e45a..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_4.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_5.cml b/lib/iris/tests/results/grib_load/earth_shape_5.cml deleted file mode 100644 index 1257c9c2ad..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_5.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_6.cml b/lib/iris/tests/results/grib_load/earth_shape_6.cml deleted file mode 100644 index eb96657104..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_6.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_7.cml b/lib/iris/tests/results/grib_load/earth_shape_7.cml deleted file mode 100644 index d27ce04a4c..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_7.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/earth_shape_grib1.cml b/lib/iris/tests/results/grib_load/earth_shape_grib1.cml deleted file mode 100644 index 7ee99f8d74..0000000000 --- a/lib/iris/tests/results/grib_load/earth_shape_grib1.cml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/ineg_jneg.cml b/lib/iris/tests/results/grib_load/ineg_jneg.cml deleted file mode 100644 index a7d7741092..0000000000 --- a/lib/iris/tests/results/grib_load/ineg_jneg.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/ineg_jpos.cml b/lib/iris/tests/results/grib_load/ineg_jpos.cml deleted file mode 100644 index f578fceadb..0000000000 --- a/lib/iris/tests/results/grib_load/ineg_jpos.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/ipos_jneg.cml b/lib/iris/tests/results/grib_load/ipos_jneg.cml deleted file mode 100644 index bb51db3201..0000000000 --- a/lib/iris/tests/results/grib_load/ipos_jneg.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/ipos_jpos.cml b/lib/iris/tests/results/grib_load/ipos_jpos.cml deleted file mode 100644 index 4dc6d7f980..0000000000 --- a/lib/iris/tests/results/grib_load/ipos_jpos.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/lambert_grib1.cml b/lib/iris/tests/results/grib_load/lambert_grib1.cml deleted file mode 100644 index 74fe0a27fb..0000000000 --- a/lib/iris/tests/results/grib_load/lambert_grib1.cml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/lambert_grib2.cml b/lib/iris/tests/results/grib_load/lambert_grib2.cml deleted file mode 100644 index dc938f0aca..0000000000 --- a/lib/iris/tests/results/grib_load/lambert_grib2.cml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/missing_values_grib2.cml b/lib/iris/tests/results/grib_load/missing_values_grib2.cml deleted file mode 100644 index c4c0d81915..0000000000 --- a/lib/iris/tests/results/grib_load/missing_values_grib2.cml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/polar_stereo_grib1.cml b/lib/iris/tests/results/grib_load/polar_stereo_grib1.cml deleted file mode 100644 index f8e03e6d18..0000000000 --- a/lib/iris/tests/results/grib_load/polar_stereo_grib1.cml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/reduced_gg_grib2.cml b/lib/iris/tests/results/grib_load/reduced_gg_grib2.cml deleted file mode 100644 index fa3ba45e3d..0000000000 --- a/lib/iris/tests/results/grib_load/reduced_gg_grib2.cml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/reduced_ll_grib1.cml b/lib/iris/tests/results/grib_load/reduced_ll_grib1.cml deleted file mode 100644 index b1d68014fd..0000000000 --- a/lib/iris/tests/results/grib_load/reduced_ll_grib1.cml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/regular_gg_grib1.cml b/lib/iris/tests/results/grib_load/regular_gg_grib1.cml deleted file mode 100644 index b1dc1f6c81..0000000000 --- a/lib/iris/tests/results/grib_load/regular_gg_grib1.cml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/regular_gg_grib2.cml b/lib/iris/tests/results/grib_load/regular_gg_grib2.cml deleted file mode 100644 index 14213c1602..0000000000 --- a/lib/iris/tests/results/grib_load/regular_gg_grib2.cml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/rotated.cml b/lib/iris/tests/results/grib_load/rotated.cml deleted file mode 100644 index 06e2b517e1..0000000000 --- a/lib/iris/tests/results/grib_load/rotated.cml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/time_bound_grib1.cml b/lib/iris/tests/results/grib_load/time_bound_grib1.cml deleted file mode 100644 index 89902729b5..0000000000 --- a/lib/iris/tests/results/grib_load/time_bound_grib1.cml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/results/grib_load/time_bound_grib2.cml b/lib/iris/tests/results/grib_load/time_bound_grib2.cml deleted file mode 100644 index bb51db3201..0000000000 --- a/lib/iris/tests/results/grib_load/time_bound_grib2.cml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -