Skip to content

Commit

Permalink
Remove iris.experimental.fieldsfiles module (#2640)
Browse files Browse the repository at this point in the history
* Remove iris.experimental.fieldsfiles module

* Review actions: keep and move existing test modules

* Changes to get tests passing

* Common test result format

* Update result files
  • Loading branch information
lbdreyer authored and corinnebosley committed Oct 13, 2017
1 parent f7e103b commit a53a40f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 293 deletions.
281 changes: 0 additions & 281 deletions lib/iris/experimental/fieldsfile.py

This file was deleted.

20 changes: 20 additions & 0 deletions lib/iris/tests/integration/um/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (C) British Crown Copyright 2016 - 2017, 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/>.
"""Integration tests for :mod:`iris.fileformats.um` fast load functions."""

from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2014 - 2016, Met Office
# (C) British Crown Copyright 2014 - 2017, Met Office
#
# This file is part of Iris.
#
Expand All @@ -25,23 +25,30 @@
# import iris tests first so that some things can be initialised before
# importing anything else
import iris.tests as tests
from iris.cube import CubeList

from iris.experimental.fieldsfile import load
from iris.fileformats.um import load_cubes as load


@tests.skip_data
class TestStructuredLoadFF(tests.IrisTest):
def setUp(self):
self.fname = tests.get_data_path(('FF', 'structured', 'small'))

def _merge_cubes(self, cubes):
# Merge the 2D cubes returned by `iris.fileformats.um.load_cubes`.
return CubeList(cubes).merge_cube()

def test_simple(self):
cube, = load(self.fname)
list_of_cubes = list(load(self.fname, None))
cube = self._merge_cubes(list_of_cubes)
self.assertCML(cube)

def test_simple_callback(self):
def callback(cube, field, filename):
cube.attributes['processing'] = 'fast-ff'
cube, = load(self.fname, callback=callback)
list_of_cubes = list(load(self.fname, callback=callback))
cube = self._merge_cubes(list_of_cubes)
self.assertCML(cube)


Expand All @@ -51,7 +58,7 @@ def setUp(self):
self.fname = tests.get_data_path(('PP', 'structured', 'small.pp'))

def test_simple(self):
[cube] = load(self.fname)
[cube] = load(self.fname, None)
self.assertCML(cube)

def test_simple_callback(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</dimCoord>
</coord>
<coord datadims="[1]">
<auxCoord bounds="[[1.0, 0.998870030363],
<dimCoord bounds="[[1.0, 0.998870030363],
[0.998870030363, 0.996988167171],
[0.996988167171, 0.994356539679]]" id="a5c170db" long_name="sigma" points="[0.999434935344, 0.997928877018, 0.995671918702]" shape="(3,)" units="Unit('1')" value_type="float64"/>
</coord>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</dimCoord>
</coord>
<coord datadims="[1]">
<auxCoord bounds="[[1.0, 0.998870030363],
<dimCoord bounds="[[1.0, 0.998870030363],
[0.998870030363, 0.996988167171],
[0.996988167171, 0.994356539679]]" id="a5c170db" long_name="sigma" points="[0.999434935344, 0.997928877018, 0.995671918702]" shape="(3,)" units="Unit('1')" value_type="float64"/>
</coord>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2014 - 2015, Met Office
# (C) British Crown Copyright 2014 - 2017, Met Office
#
# This file is part of Iris.
#
Expand All @@ -14,7 +14,10 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Iris. If not, see <http://www.gnu.org/licenses/>.
"""Unit tests for :mod:`iris.experimental.fieldsfile`."""
"""
Unit tests for the module :mod:`iris.fileformats.um._fast_load`.
"""

from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
Loading

0 comments on commit a53a40f

Please sign in to comment.