-
Notifications
You must be signed in to change notification settings - Fork 300
NEMO Ocean Data Gallery Example #3398
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
Conversation
| them without the intervention shown here. | ||
| """ | ||
| from __future__ import unicode_literals | ||
| import iris |
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.
I003 isort expected 1 blank line in imports, found 0
| """ | ||
| from __future__ import unicode_literals | ||
| import iris | ||
| from iris.util import promote_aux_coord_to_dim_coord |
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.
I001 isort found an import in the wrong position
|
@jonseddon Awesome, thanks! 😄 You weren't to know, but you also need to add a test for this new gallery example, that ensures our gallery items aren't broken. You'll find boiler plate code of example tests for individual gallery items in the So you'll need a # (C) British Crown Copyright 2019, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Iris is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Iris. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# Import Iris tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests
from .extest_util import (add_examples_to_path,
show_replaced_by_check_graphic,
fail_any_deprecation_warnings)
class TestLoadNemo(tests.GraphicsTest):
"""Test the load_nemo example code."""
def test_load_nemo(self):
with fail_any_deprecation_warnings():
with add_examples_to_path():
import load_nemo
with show_replaced_by_check_graphic(self):
load_nemo.main()
if __name__ == '__main__':
tests.main()When this test runs in our travis-ci instance, it will fail, simply because we don't have an entry for the perceptual image hash of the image generated by the gallery. Unfortunately, there is a bit more work involved to configure this, but I'll help you through this (somehow) 😅 |
|
@jonseddon Please apply the following patch to your branch... Go to the directory containing the git branch for this PR. Then, copy the following and paste it into a file called Then, perform the following command to apply the patch to your branch, which will introduce two new commits: $ cat patchfile | git amThen, to view the contents of those new commits in your branch from applying the patch: $ git log -n2 -pOnce you're happy, push this to your repo to automatically update this PR: $ git push origin HEAD |
|
@jonseddon For this PR to run successfully on |
|
Ping @jonseddon ... do you have capacity to service this PR? If not, then I'm happy to create another PR based on this to get it over the line 😉 |
|
@bjlittle thanks for another prod. I should be able to finish the coding to get a big chunk of data out of the door this morning. As that's running I'll finish this PR. Sadly the tape system was too efficient last week and wrote my data in only a few hours and so I didn't get the rest that I hoped for then. |
|
@bjlittle Thanks for doing all the work for me! The patch has been applied and the tests successfully pass. |
|
@jonseddon Awesome, nice one! Thanks for the PR, hopefully the first of many 😉 |
Added a gallery example showing how to concatenate NEMO ocean model data as suggested by @bjlittle . This PR requires SciTools/iris-sample-data#24.