-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have Travis test with iris-grib, remove problem tests #3469
Changes from 3 commits
9bc3735
d0625d4
4149e53
327b296
95972c5
11826d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# (C) British Crown Copyright 2014 - 2017, Met Office | ||
# (C) British Crown Copyright 2014 - 2019, Met Office | ||
# | ||
# This file is part of Iris. | ||
# | ||
|
@@ -22,6 +22,7 @@ | |
# Import iris.tests first so that some things can be initialised before | ||
# importing anything else. | ||
import iris.tests as tests | ||
from unittest import skip | ||
|
||
from cf_units import Unit | ||
import numpy.ma as ma | ||
|
@@ -49,6 +50,7 @@ def test_gdt1(self): | |
cube = load_cube(path) | ||
self.assertCMLApproxData(cube) | ||
|
||
@skip('iris-grib is currently causing errors') | ||
def test_gdt90_with_bitmap(self): | ||
path = tests.get_data_path(('GRIB', 'umukv', 'ukv_chan9.grib2')) | ||
cube = load_cube(path) | ||
|
@@ -280,6 +282,7 @@ def test_regular(self): | |
cube = load_cube(path) | ||
self.assertCMLApproxData(cube) | ||
|
||
@skip('iris-grib is currently causing failures') | ||
def test_reduced(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This failure seems to have been introduced by the latest verion of iris-grib. The points of one of the dimensions is reading [0.] rather than [~2.] . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When loading this file I got the warning:
Possibly related to this commit: SciTools/iris-grib@9f26e7a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually related to this issue: SciTools/iris-grib#150 |
||
path = tests.get_data_path(('GRIB', 'reduced', 'reduced_gg.grib2')) | ||
cube = load_cube(path) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# (C) British Crown Copyright 2010 - 2017, Met Office | ||
# (C) British Crown Copyright 2010 - 2019, Met Office | ||
# | ||
# This file is part of Iris. | ||
# | ||
|
@@ -31,6 +31,7 @@ | |
# Import iris tests first so that some things can be initialised before | ||
# importing anything else | ||
import iris.tests as tests | ||
from unittest import skip | ||
|
||
import iris | ||
import iris.exceptions | ||
|
@@ -64,6 +65,7 @@ def test_load_time_processed(self): | |
"time_bound.grib2"))) | ||
self.assertCML(cubes, ("grib_load", "time_bound_grib2.cml")) | ||
|
||
@skip('iris-grib is currently causing errors') | ||
def test_load_3_layer(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done a bit of experimenting with this test. The error seems to be thrown when trying to realise one of the cubes in It suggests that perhaps the cubes are at some point interfering with each other. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interestingly, if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I reordered the Cubelist as: The traceback can be found here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that if all the data is realised first, the test succeeds. The data must, however, be realised in the correct order:
where the data in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This problem seems to be related to the package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So for some reason, the most recent version of python-ecodes is 0.9.3 rather than 2.12.3 . When the travis file specifies There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reference, this issue is discussed here: conda-forge/python-eccodes-feedstock#49 |
||
cubes = iris.load(tests.get_data_path(('GRIB', "3_layer_viz", | ||
"3_layer.grib2"))) | ||
|
@@ -131,6 +133,7 @@ def test_reduced_ll(self): | |
("GRIB", "reduced", "reduced_ll.grib1"))) | ||
self.assertCML(cube, ("grib_load", "reduced_ll_grib1.cml")) | ||
|
||
@skip('iris-grib is currently causing failures') | ||
def test_reduced_gg(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This failure seems to have been introduced by the latest verion of iris-grib. The points of one of the dimensions is reading [0.] rather than [~2.] . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fixed by the changes suggested in SciTools/iris-grib#150 |
||
cube = iris.load_cube(tests.get_data_path( | ||
("GRIB", "reduced", "reduced_gg.grib2"))) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ def _mock_gribapi_fetch(message, key): | |
if key in message: | ||
return message[key] | ||
else: | ||
raise _mock_gribapi.GribInternalError | ||
raise _mock_gribapi.errors.GribInternalError | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gribapi has changed where GribInternalError is stored. Fixing this solves 8 of the 10 errors in the grib tests mentioned in #3447. I've decided not to handle the possibility of both cases since the updated version of iris-grib is the only one which is compatible with python3. |
||
|
||
|
||
def _mock_gribapi__grib_is_missing(grib_message, keyname): | ||
|
@@ -83,13 +83,13 @@ def _mock_gribapi__grib_get_native_type(grib_message, keyname): | |
""" | ||
if keyname in grib_message: | ||
return type(grib_message[keyname]) | ||
raise _mock_gribapi.GribInternalError(keyname) | ||
raise _mock_gribapi.errors.GribInternalError(keyname) | ||
|
||
|
||
if tests.GRIB_AVAILABLE: | ||
# Construct a mock object to mimic the gribapi for GribWrapper testing. | ||
_mock_gribapi = mock.Mock(spec=gribapi) | ||
_mock_gribapi.GribInternalError = Exception | ||
_mock_gribapi.errors.GribInternalError = Exception | ||
|
||
_mock_gribapi.grib_get_long = mock.Mock(side_effect=_mock_gribapi_fetch) | ||
_mock_gribapi.grib_get_string = mock.Mock(side_effect=_mock_gribapi_fetch) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# (C) British Crown Copyright 2010 - 2017, Met Office | ||
# (C) British Crown Copyright 2010 - 2019, Met Office | ||
# | ||
# This file is part of Iris. | ||
# | ||
|
@@ -20,6 +20,7 @@ | |
|
||
# import iris tests first so that some things can be initialised before importing anything else | ||
import iris.tests as tests | ||
from unittest import skip | ||
|
||
import os | ||
import datetime | ||
|
@@ -44,6 +45,7 @@ class TestLoadSave(tests.TestGribMessage): | |
def setUp(self): | ||
self.skip_keys = [] | ||
|
||
@skip('iris-grib is currently causing failures') | ||
def test_latlon_forecast_plev(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect the following three tests are failing due to a change introduced by this commit. It may be appropriate to change the |
||
source_grib = tests.get_data_path(("GRIB", "uk_t", "uk_t.grib2")) | ||
cubes = iris.load(source_grib) | ||
|
@@ -63,6 +65,7 @@ def test_latlon_forecast_plev(self): | |
expect_diffs, self.skip_keys, | ||
skip_sections=[2]) | ||
|
||
@skip('iris-grib is currently causing failures') | ||
def test_rotated_latlon(self): | ||
source_grib = tests.get_data_path(("GRIB", "rotated_nae_t", | ||
"sensible_pole.grib2")) | ||
|
@@ -85,6 +88,7 @@ def test_rotated_latlon(self): | |
expect_diffs, self.skip_keys, | ||
skip_sections=[2]) | ||
|
||
@skip('iris-grib is currently causing failures') | ||
def test_time_mean(self): | ||
# This test for time-mean fields also tests negative forecast time. | ||
source_grib = tests.get_data_path(("GRIB", "time_processed", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is related to (and possibly solved by) this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this with the latest version of iris-grib and I can confirm that the error does not occur with the current iris-grib master branch.