Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/iris/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,12 +1297,6 @@ class MyPlotTests(test.GraphicsTest):
)


# TODO: remove these skips when iris-grib is fixed
skip_grib_fail = unittest.skipIf(
True, "Test(s) are failing due to known problems " 'with "iris-grib".'
)


skip_sample_data = unittest.skipIf(
not SAMPLE_DATA_AVAILABLE,
('Test(s) require "iris-sample-data", ' "which is not available."),
Expand Down
11 changes: 7 additions & 4 deletions lib/iris/tests/integration/test_grib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
if tests.GRIB_AVAILABLE:
from iris_grib import load_pairs_from_fields
from iris_grib.message import GribMessage
from iris_grib.grib_phenom_translation import GRIBCode


@tests.skip_data
Expand All @@ -36,7 +37,6 @@ def test_gdt1(self):
cube = load_cube(path)
self.assertCMLApproxData(cube)

@tests.skip_grib_fail
def test_gdt90_with_bitmap(self):
path = tests.get_data_path(("GRIB", "umukv", "ukv_chan9.grib2"))
cube = load_cube(path)
Expand Down Expand Up @@ -156,6 +156,7 @@ def test_save_load(self):
cube.add_aux_coord(tcoord)
cube.add_aux_coord(fpcoord)
cube.attributes["WMO_constituent_type"] = 0
cube.attributes["GRIB_PARAM"] = GRIBCode("GRIB2:d000c014n000")

with self.temp_filename("test_grib_pdt40.grib2") as temp_file_path:
save(cube, temp_file_path)
Expand Down Expand Up @@ -232,9 +233,12 @@ def test_save_load(self):
self.assertEqual(test_cube.shape, (744, 744))
self.assertEqual(test_cube.cell_methods, ())

# Check no cube attributes on the re-loaded cube.
# Check only the GRIB_PARAM attribute exists on the re-loaded cube.
# Note: this does *not* match the original, but is as expected.
self.assertEqual(cube_loaded_from_saved.attributes, {})
self.assertEqual(
cube_loaded_from_saved.attributes,
{"GRIB_PARAM": GRIBCode("GRIB2:d000c003n001")},
)

# Now remaining to check: coordinates + data...

Expand Down Expand Up @@ -300,7 +304,6 @@ def test_regular(self):
cube = load_cube(path)
self.assertCMLApproxData(cube)

@tests.skip_grib_fail
def test_reduced(self):
path = tests.get_data_path(("GRIB", "reduced", "reduced_gg.grib2"))
cube = load_cube(path)
Expand Down
1 change: 0 additions & 1 deletion lib/iris/tests/integration/test_grib_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def test_reduced_ll(self):
)
self.assertCML(cube, ("grib_load", "reduced_ll_grib1.cml"))

@tests.skip_grib_fail
def test_reduced_gg(self):
cube = iris.load_cube(
tests.get_data_path(("GRIB", "reduced", "reduced_gg.grib2"))
Expand Down
9 changes: 9 additions & 0 deletions lib/iris/tests/results/grib_load/3_layer.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down Expand Up @@ -31,6 +34,9 @@
<data checksum="0xd04cbc45" dtype="float64" shape="(360, 600)"/>
</cube>
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down Expand Up @@ -82,6 +88,9 @@
<data checksum="0x857e5378" dtype="float64" shape="(73, 96)"/>
</cube>
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[0.0, 0.0]]" id="1d45e087" points="[0.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_0.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_1.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_2.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_3.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_4.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_5.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_6.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/earth_shape_7.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/ineg_jneg.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/ineg_jpos.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/ipos_jneg.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/ipos_jpos.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/lambert_grib2.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[2]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/missing_values_grib2.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="x_wind" units="m s-1">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c002n002"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
1 change: 1 addition & 0 deletions lib/iris/tests/results/grib_load/reduced_gg_grib2.cml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="geopotential" units="m2 s-2">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c003n004"/>
<attribute name="centre" value="European Centre for Medium Range Weather Forecasts"/>
</attributes>
<coords>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/regular_gg_grib2.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="geopotential_height" units="m">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c003n005"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[69]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/grib_load/time_bound_grib2.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[-28587.0, 6477.0]]" id="1d45e087" points="[-11055.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="x_wind" units="m s-1">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c002n002"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[2]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="geopotential" units="m2 s-2">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c003n004"/>
<attribute name="centre" value="European Centre for Medium Range Weather Forecasts"/>
</attributes>
<coords>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="geopotential_height" units="m">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c003n005"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[69]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/integration/grib2/TestImport/gdt1.cml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" standard_name="air_temperature" units="K">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d000c000n000"/>
</attributes>
<coords>
<coord>
<dimCoord id="1d45e087" points="[0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="int64"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" units="unknown">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d003c000n002"/>
</attributes>
<coords>
<coord>
<dimCoord id="87abc70d" long_name="instrument_type" points="[207]" shape="(1,)" units="Unit('1')" value_type="int64"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" units="unknown">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d255c255n255"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[0.0, 3.0]]" id="1d45e087" points="[3.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" units="unknown">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d255c255n255"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[0.0, 3.0]]" id="1d45e087" points="[3.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" units="unknown">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d255c255n255"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[0.0, 3.0]]" id="1d45e087" points="[3.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
<cubes xmlns="urn:x-iris:cubeml-0.2">
<cube dtype="float64" units="unknown">
<attributes>
<attribute name="GRIB_PARAM" value="GRIB2:d255c255n255"/>
</attributes>
<coords>
<coord>
<dimCoord bounds="[[0.0, 3.0]]" id="1d45e087" points="[3.0]" shape="(1,)" standard_name="forecast_period" units="Unit('hours')" value_type="float64"/>
Expand Down
Loading