-
Notifications
You must be signed in to change notification settings - Fork 298
Have Travis test with iris-grib, remove problem tests #3469
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
Changes from all 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 2010 - 2017, Met Office | ||
| # (C) British Crown Copyright 2010 - 2019, Met Office | ||
| # | ||
| # This file is part of Iris. | ||
| # | ||
|
|
@@ -131,6 +131,7 @@ def test_reduced_ll(self): | |
| ("GRIB", "reduced", "reduced_ll.grib1"))) | ||
| self.assertCML(cube, ("grib_load", "reduced_ll_grib1.cml")) | ||
|
|
||
| @tests.skip_grib_fail | ||
| def test_reduced_gg(self): | ||
|
Contributor
Author
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.] .
Contributor
Author
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 | ||
|
Contributor
Author
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) | ||
|
|
||
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.
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually related to this issue: SciTools/iris-grib#150
When the suggested changes are applied this test passes again.