Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 7 additions & 8 deletions lib/iris/tests/integration/test_aggregated_cube.py
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 @@ -23,8 +23,6 @@
# importing anything else.
import iris.tests as tests

import biggus

import iris
from iris.analysis import MEAN

Expand All @@ -37,15 +35,16 @@ def test_agg_by_aux_coord(self):
cube = iris.load_cube(problem_test_file)

# Test aggregating by aux coord, notably the `forecast_period` aux
# coord on `cube`, whose `_points` attribute is of type
# :class:`biggus.Array`. This test then ensures that
# aggregating using `points` instead is successful.
# coord on `cube`, whose `_points` attribute is a lazy array.
# This test then ensures that aggregating using `points` instead is
# successful.

# First confirm we've got a `biggus.Array`.
# First confirm we've got a lazy array.
# NB. This checks the merge process in `load_cube()` hasn't
# triggered the load of the coordinate's data.
forecast_period_coord = cube.coord('forecast_period')
self.assertIsInstance(forecast_period_coord._points, biggus.Array)
self.assertTrue(forecast_period_coord._points.all(),
iris._lazy_data.is_lazy_data)

# Now confirm we can aggregate along this coord.
res_cube = cube.aggregated_by('forecast_period', MEAN)
Expand Down
6 changes: 3 additions & 3 deletions lib/iris/tests/test_netcdf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2016, Met Office
# (C) British Crown Copyright 2010 - 2017, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -33,7 +33,6 @@
import stat
import tempfile

import biggus
import netCDF4 as nc
import numpy as np
import numpy.ma as ma
Expand Down Expand Up @@ -111,7 +110,8 @@ def test_load_rotated_xy_land(self):
cube = iris.load_cube(tests.get_data_path(
('NetCDF', 'rotated', 'xy', 'rotPole_landAreaFraction.nc')))
# Make sure the AuxCoords have lazy data.
self.assertIsInstance(cube.coord('latitude')._points, biggus.Array)
self.assertTrue(cube.coord('latitude')._points.all(),
iris._lazy_data.is_lazy_data)
self.assertCML(cube, ('netcdf', 'netcdf_rotated_xy_land.cml'))

def test_load_rotated_xyt_precipitation(self):
Expand Down
8 changes: 4 additions & 4 deletions lib/iris/tests/test_pp_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2013 - 2015, Met Office
# (C) British Crown Copyright 2013 - 2017, Met Office
#
# This file is part of Iris.
#
Expand All @@ -22,11 +22,11 @@
import iris.tests as tests

from copy import deepcopy
import dask
import os
from types import GeneratorType
import unittest

import biggus
import netcdftime
from numpy.testing import assert_array_equal

Expand All @@ -44,15 +44,15 @@ def setUp(self):
def test_copy_field_deferred(self):
field = next(pp.load(self.filename))
clone = field.copy()
self.assertIsInstance(clone._data, biggus.Array)
self.assertIsInstance(clone._data, dask.array.Array)
self.assertEqual(field, clone)
clone.lbyr = 666
self.assertNotEqual(field, clone)

def test_deepcopy_field_deferred(self):
field = next(pp.load(self.filename))
clone = deepcopy(field)
self.assertIsInstance(clone._data, biggus.Array)
self.assertIsInstance(clone._data, dask.array.Array)
self.assertEqual(field, clone)
clone.lbyr = 666
self.assertNotEqual(field, clone)
Expand Down
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 Down Expand Up @@ -29,9 +29,9 @@

from abc import ABCMeta, abstractmethod

import biggus
import numpy as np

import iris._lazy_data
from iris.exceptions import TranslationError
from iris.fileformats.grib.message import GribMessage
from iris.tests import mock
Expand Down Expand Up @@ -182,7 +182,7 @@ def _test(self, scanning_mode):
6: SECTION_6_NO_BITMAP,
7: {'codedValues': np.arange(12)}})
data = message.data
self.assertIsInstance(data, biggus.Array)
self.assertTrue(data, iris._lazy_data.is_lazy_data)
self.assertEqual(data.shape, (3, 4))
self.assertEqual(data.dtype, np.floating)
self.assertIs(data.fill_value, np.nan)
Expand Down