diff --git a/lib/iris/_concatenate.py b/lib/iris/_concatenate.py index 418cf86554..9f37fd24b2 100644 --- a/lib/iris/_concatenate.py +++ b/lib/iris/_concatenate.py @@ -330,7 +330,6 @@ def __init__(self, cube): self.defn = cube.metadata self.data_type = cube.dtype - self.fill_value = cube.fill_value # # Collate the dimension coordinate metadata. @@ -675,8 +674,6 @@ def concatenate(self): dim_coords_and_dims=dim_coords_and_dims, aux_coords_and_dims=aux_coords_and_dims, cell_measures_and_dims=new_cm_and_dims, - dtype=cube_signature.data_type, - fill_value=cube_signature.fill_value, **kwargs) else: # There are no other source-cubes to concatenate @@ -722,13 +719,6 @@ def register(self, cube, axis=None, error_on_mismatch=False, # Check for compatible coordinate signatures. if match: - fill_value = self._cube_signature.fill_value - # Determine whether the fill value requires to be - # demoted to the default value. - if fill_value is not None: - if cube_signature.fill_value != fill_value: - # Demote the fill value to the default. - self._cube_signature.fill_value = None coord_signature = _CoordSignature(cube_signature) candidate_axis = self._coord_signature.candidate_axis( coord_signature) diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index 5659604d3b..fdda7e24cd 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -37,7 +37,7 @@ class DataManager(object): """ - def __init__(self, data, fill_value='none', realised_dtype=None): + def __init__(self, data): """ Create a data manager for the specified data. @@ -48,40 +48,14 @@ def __init__(self, data, fill_value='none', realised_dtype=None): real data, or :class:`~dask.array.core.Array` lazy data to be managed. - Kwargs: - - * fill_value: - The intended fill-value of :class:`~iris._data_manager.DataManager` - masked data. Note that, the fill-value is cast relative to the - dtype of the :class:`~iris._data_manager.DataManager`. - - * realised_dtype: - The intended dtype of the specified lazy data, which must be - either integer or boolean. This is to handle the case of lazy - integer or boolean masked data. - """ # Initialise the instance. - self._fill_value = None self._lazy_array = None self._real_array = None - self._realised_dtype = None # Assign the data payload to be managed. self.data = data - # Set the lazy data realised dtype, if appropriate. - self._realised_dtype_setter(realised_dtype) - - default_fill_value = (isinstance(fill_value, six.string_types) and - fill_value == 'none') - - # Set the fill-value, must be set after the realised dtype. - if ma.isMaskedArray(data) and default_fill_value: - self._propagate_masked_data_fill_value() - else: - self.fill_value = None if default_fill_value else fill_value - # Enforce the manager contract. self._assert_axioms() @@ -134,11 +108,8 @@ def __eq__(self, other): if isinstance(other, type(self)): result = False same_lazy = self.has_lazy_data() == other.has_lazy_data() - same_fill_value = self.fill_value == other.fill_value - same_realised_dtype = self._realised_dtype == other._realised_dtype same_dtype = self.dtype == other.dtype - if same_lazy and same_fill_value and same_realised_dtype \ - and same_dtype: + if same_lazy and same_dtype: result = array_equal(self.core_data(), other.core_data()) return result @@ -171,18 +142,8 @@ def __repr__(self): Returns an string representation of the instance. """ - fmt = '{cls}({data!r}{fill_value}{dtype})' - fill_value = '' - dtype = '' - - if self.fill_value is not None: - fill_value = ', fill_value={!r}'.format(self.fill_value) - - if self._realised_dtype is not None: - dtype = ', realised_dtype={!r}'.format(self._realised_dtype) - - result = fmt.format(data=self.core_data(), cls=type(self).__name__, - fill_value=fill_value, dtype=dtype) + fmt = '{cls}({data!r})' + result = fmt.format(data=self.core_data(), cls=type(self).__name__) return result @@ -198,27 +159,8 @@ def _assert_axioms(self): state = is_lazy ^ is_real assert state, emsg.format('' if is_lazy else 'no ', '' if is_real else 'no ') - # Ensure validity of realised dtype. - state = (self._realised_dtype is None or - self._realised_dtype.kind in 'biu') - emsg = 'Unexpected realised dtype state, got {!r}' - assert state, emsg.format(self._realised_dtype) - - # Ensure validity of lazy data with realised dtype. - state = self.has_lazy_data() or self._realised_dtype is None - emsg = ('Unexpected real data with realised dtype, got ' - 'real data and realised {!r}.') - assert state, emsg.format(self._realised_dtype) - - state = not (self.has_lazy_data() and - self._lazy_array.dtype.kind != 'f' and - self._realised_dtype is not None) - emsg = ('Unexpected lazy data dtype with realised dtype, got ' - 'lazy data {!r} and realised {!r}.') - assert state, emsg.format(self._lazy_array.dtype, self._realised_dtype) - - def _deepcopy(self, memo, data=None, fill_value='none', - realised_dtype='none'): + + def _deepcopy(self, memo, data=None): """ Perform a deepcopy of the :class:`~iris._data_manager.DataManager` instance. @@ -234,12 +176,6 @@ def _deepcopy(self, memo, data=None, fill_value='none', Replacement data to substitute the currently managed data with. - * fill_value: - Replacement fill-value. - - * realised_dtype: - Replacement for the intended dtype of the realised lazy data. - Returns: :class:`~iris._data_manager.DataManager` instance. @@ -251,81 +187,13 @@ def _deepcopy(self, memo, data=None, fill_value='none', data = copy.deepcopy(self._lazy_array, memo) else: data = self._real_array.copy() - else: - # Check that the replacement data is valid relative to - # the currently managed data. - DataManager(self.core_data()).replace(data) - # If the replacement data is valid, then use it but - # without copying it. - - if isinstance(fill_value, six.string_types) and \ - fill_value == 'none': - fill_value = self.fill_value - - if isinstance(realised_dtype, six.string_types) and \ - realised_dtype == 'none': - realised_dtype = self._realised_dtype - - result = DataManager(data, fill_value=fill_value, - realised_dtype=realised_dtype) + result = DataManager(data) except ValueError as error: emsg = 'Cannot copy {!r} - {}' raise ValueError(emsg.format(type(self).__name__, error)) return result - def _propagate_masked_data_fill_value(self): - """ - Align the data manager fill-value with the real masked array - fill-value. - - """ - data = self._real_array - if ma.isMaskedArray(data): - # Determine the default numpy fill-value. - np_fill_value = ma.masked_array(0, dtype=data.dtype).fill_value - if data.fill_value == np_fill_value: - # Never store the numpy default fill-value, rather - # represent this by clearing the data manager fill-value. - self.fill_value = None - else: - # Propagate the masked array fill-value to the data manager. - self.fill_value = data.fill_value - - def _realised_dtype_setter(self, realised_dtype): - """ - Set the intended dtype of the realised lazy data. This is to support - the case of lazy masked integral and boolean data in dask. - - Args: - - * realised_dtype: - A numpy :class:`~numpy.dtype`, array-protocol type string, - or built-in scalar type. - - """ - if realised_dtype is None: - self._realised_dtype = None - else: - realised_dtype = np.dtype(realised_dtype) - if realised_dtype != self.dtype: - if not self.has_lazy_data(): - emsg = ('Cannot set realised dtype, no lazy data ' - 'is available.') - raise ValueError(emsg) - if self._lazy_array.dtype.kind != 'f': - emsg = ('Cannot set realised dtype for lazy data ' - 'with {!r}.') - raise ValueError(emsg.format(self._lazy_array.dtype)) - if realised_dtype.kind not in 'biu': - emsg = ('Can only cast lazy data to an integer or boolean ' - 'dtype, got {!r}.') - raise ValueError(emsg.format(realised_dtype)) - self._realised_dtype = realised_dtype - - # Check the manager contract, as the managed dtype has changed. - self._assert_axioms() - @property def data(self): """ @@ -338,14 +206,11 @@ def data(self): if self.has_lazy_data(): try: # Realise the lazy data. - result = as_concrete_data(self._lazy_array, - nans_replacement=ma.masked, - result_dtype=self.dtype) + result = as_concrete_data(self._lazy_array) # Assign the realised result. self._real_array = result # Reset the lazy data and the realised dtype. self._lazy_array = None - self._realised_dtype = None except MemoryError: emsg = ('Failed to realise the lazy data as there was not ' 'enough memory available.\n' @@ -354,10 +219,6 @@ def data(self): 'before trying again.') raise MemoryError(emsg.format(self.shape, self.dtype)) - if ma.isMaskedArray(self._real_array): - # Align the numpy fill-value with the data manager fill-value. - self._real_array.fill_value = self.fill_value - # Check the manager contract, as the managed data has changed. self._assert_axioms() @@ -412,18 +273,6 @@ def data(self, data): self._lazy_array = None self._real_array = data - # Always reset the realised dtype, as the managed data has changed. - self._realised_dtype = None - - # Reset the fill-value appropriately. - if init_done: - if ma.isMaskedArray(data): - # Align the data manager fill-value with the numpy fill-value. - self._propagate_masked_data_fill_value() - else: - # Clear the data manager fill-value. - self.fill_value = None - # Check the manager contract, as the managed data has changed. self._assert_axioms() @@ -433,32 +282,7 @@ def dtype(self): The dtype of the realised lazy data or the dtype of the real data. """ - if self._realised_dtype is not None: - result = self._realised_dtype - else: - result = self.core_data().dtype - - return result - - @property - def fill_value(self): - return self._fill_value - - @fill_value.setter - def fill_value(self, fill_value): - if fill_value is not None: - # Convert the given value to the dtype of the data manager. - fill_value = np.asarray([fill_value])[0] - target_dtype = self.dtype - if fill_value.dtype.kind == 'f' and target_dtype.kind in 'biu': - # Perform rounding when converting floats to ints. - fill_value = np.rint(fill_value) - try: - [fill_value] = np.asarray([fill_value], dtype=target_dtype) - except OverflowError: - emsg = 'Fill value of {!r} invalid for {!r}.' - raise ValueError(emsg.format(fill_value, self.dtype)) - self._fill_value = fill_value + return self.core_data().dtype @property def ndim(self): @@ -476,7 +300,7 @@ def shape(self): """ return self.core_data().shape - def copy(self, data=None, fill_value='none', realised_dtype='none'): + def copy(self, data=None): """ Returns a deep copy of this :class:`~iris._data_manager.DataManager` instance. @@ -486,20 +310,12 @@ def copy(self, data=None, fill_value='none', realised_dtype='none'): * data: Replace the data of the copy with this data. - * fill_value: - Replacement fill-value. - - * realised_dtype: - Replace the intended dtype of the lazy data - in the copy with this :class:`~numpy.dtype`. - Returns: A copy :class:`~iris._data_manager.DataManager` instance. """ memo = {} - return self._deepcopy(memo, data=data, fill_value=fill_value, - realised_dtype=realised_dtype) + return self._deepcopy(memo, data=data) def core_data(self): """ @@ -548,45 +364,3 @@ def lazy_data(self): result = as_lazy_data(self._real_array) return result - - def replace(self, data, fill_value=None, realised_dtype=None): - """ - Perform an in-place replacement of the managed data. - - Args: - - * data: - Replace the managed data with either the :class:`~numpy.ndarray` - or :class:`~numpy.ma.core.MaskedArray` real data, or lazy - :class:`dask.array.core.Array` - - Kwargs: - - * fill_value: - Replacement for the :class:`~iris._data_manager.DataManager` - fill-value. - - * realised_dtype: - The intended dtype of the specified lazy data. - - .. note:: - Data replacement alone will clear the intended dtype - of the realised lazy data, and the fill-value. - - """ - # Snapshot the currently managed data. - original_data = self.core_data() - # Perform in-place data assignment. - self.data = data - try: - self._realised_dtype_setter(realised_dtype) - self.fill_value = fill_value - except ValueError as error: - # Backout the data replacement, and reinstate the cached - # original managed data. - self._lazy_array = self._real_array = None - if is_lazy_data(original_data): - self._lazy_array = original_data - else: - self._real_array = original_data - raise error diff --git a/lib/iris/_lazy_data.py b/lib/iris/_lazy_data.py index 5fb61b81f3..985e79af13 100644 --- a/lib/iris/_lazy_data.py +++ b/lib/iris/_lazy_data.py @@ -94,13 +94,12 @@ def as_lazy_data(data, chunks=_MAX_CHUNK_SIZE): """ if not is_lazy_data(data): - if ma.isMaskedArray(data): - data = array_masked_to_nans(data) - data = da.from_array(data, chunks=chunks) + asarray = not ma.isMaskedArray(data) + data = da.from_array(data, chunks=chunks, asarray=asarray) return data -def as_concrete_data(data, **kwargs): +def as_concrete_data(data): """ Return the actual content of a lazy array, as a numpy array. If the input data is a NumPy `ndarray` or masked array, return it @@ -108,17 +107,11 @@ def as_concrete_data(data, **kwargs): If the input data is lazy, return the realised result. - Where lazy data contains NaNs these are translated by filling or converting - to masked data, using the :func:`~iris._lazy_data.convert_nans_array` - function. - Args: * data: A dask array, NumPy `ndarray` or masked array - Kwargs are passed through to :func:`~iris._lazy_data.convert_nans_array`. - Returns: A NumPy `ndarray` or masked array. @@ -129,53 +122,10 @@ def as_concrete_data(data, **kwargs): # rather than a numpy.ndarray object. # Recorded in https://github.com/dask/dask/issues/2111. data = np.asanyarray(data.compute()) - # Convert any missing data as requested. - data = convert_nans_array(data, **kwargs) return data -def nan_array_type(dtype): - return np.dtype('f8') if dtype.kind in 'biu' else dtype - - -def array_masked_to_nans(array): - """ - Convert a masked array to a NumPy `ndarray` filled with NaN values. Input - NumPy arrays with no mask are returned unchanged. - This is used for dask integration, as dask does not support masked arrays. - - Args: - - * array: - A NumPy `ndarray` or masked array. - - Returns: - A NumPy `ndarray`. This is the input array if unmasked, or an array - of floating-point values with NaN values where the mask was `True` if - the input array is masked. - - .. note:: - The fill value and mask of the input masked array will be lost. - - .. note:: - Integer masked arrays are cast to 8-byte floats because NaN is a - floating-point value. - - """ - if not ma.isMaskedArray(array): - result = array - else: - if ma.is_masked(array): - mask = array.mask - new_dtype = nan_array_type(array.data.dtype) - result = array.data.astype(new_dtype) - result[mask] = np.nan - else: - result = array.data - return result - - def multidim_lazy_stack(stack): """ Recursively build a multidimensional stacked dask array. @@ -202,70 +152,3 @@ def multidim_lazy_stack(stack): result = da.stack([multidim_lazy_stack(subarray) for subarray in stack]) return result - - -def convert_nans_array(array, nans_replacement=None, result_dtype=None): - """ - Convert a :class:`~numpy.ndarray` that may contain one or more NaN values - to either a :class:`~numpy.ma.core.MaskedArray` or a - :class:`~numpy.ndarray` with the NaN values filled. - - Args: - - * array: - The :class:`~numpy.ndarray` to be converted. - - Kwargs: - - * nans_replacement: - If `nans_replacement` is None, then raise an exception if the `array` - contains any NaN values (default behaviour). - If `nans_replacement` is `numpy.ma.masked`, then convert the `array` - to a :class:`~numpy.ma.core.MaskedArray`. - Otherwise, use the specified `nans_replacement` value as the `array` - fill value. - - * result_dtype: - Cast the resultant array to this target :class:`~numpy.dtype`. - - Returns: - An :class:`numpy.ndarray`. - - .. note:: - An input array that is either a :class:`~numpy.ma.core.MaskedArray` - or has an integral dtype will be returned unaltered. - - .. note:: - In some cases, the input array is modified in-place. - - """ - if not ma.isMaskedArray(array) and array.dtype.kind == 'f': - # First, calculate the mask. - mask = np.isnan(array) - # Now, cast the dtype, if required. - if result_dtype is not None: - result_dtype = np.dtype(result_dtype) - if array.dtype != result_dtype: - array = array.astype(result_dtype) - # Finally, mask or fill the data, as required or raise an exception - # if we detect there are NaNs present and we didn't expect any. - if np.any(mask): - if nans_replacement is None: - emsg = 'Array contains unexpected NaNs.' - raise ValueError(emsg) - elif nans_replacement is ma.masked: - # Mask the array with the default fill_value. - array = ma.masked_array(array, mask=mask) - else: - # Check the fill value is appropriate for the - # result array dtype. - try: - [fill_value] = np.asarray([nans_replacement], - dtype=array.dtype) - except OverflowError: - emsg = 'Fill value of {!r} invalid for array result {!r}.' - raise ValueError(emsg.format(nans_replacement, - array.dtype)) - # Fill the array. - array[mask] = fill_value - return array diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index 754bee7b86..ee87cefe82 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -315,7 +315,7 @@ class _CoordSignature(namedtuple('CoordSignature', class _CubeSignature(namedtuple('CubeSignature', ['defn', 'data_shape', 'data_type', - 'fill_value', 'cell_measures_and_dims'])): + 'cell_measures_and_dims'])): """ Criterion for identifying a specific type of :class:`iris.cube.Cube` based on its metadata. @@ -331,9 +331,6 @@ class _CubeSignature(namedtuple('CubeSignature', * data_type: The data payload :class:`numpy.dtype` of a :class:`iris.cube.Cube`. - * fill_value: - The fill-value for the data payload of a :class:`iris.cube.Cube`. - * cell_measures_and_dims: A list of cell_measures and dims for the cube. @@ -1241,9 +1238,7 @@ def merge(self, unique=True): # All inputs were concrete, so turn the result back into a # normal array. dtype = self._cube_signature.data_type - merged_data = as_concrete_data(merged_data, - nans_replacement=ma.masked, - result_dtype=dtype) + merged_data = as_concrete_data(merged_data) # Unmask the array if it has no masked points. if (ma.isMaskedArray(merged_data) and not ma.is_masked(merged_data)): @@ -1283,14 +1278,6 @@ def register(self, cube, error_on_mismatch=False): other = self._build_signature(cube) match = cube_signature.match(other, error_on_mismatch) if match: - # Determine whether the fill value requires to be demoted - # to the default value. - if cube_signature.fill_value is not None: - if cube_signature.fill_value != other.fill_value: - # Demote the fill value to the default. - signature = self._build_signature(self._source, - default_fill_value=True) - self._cube_signature = signature coord_payload = self._extract_coord_payload(cube) match = coord_payload.match_signature(self._coord_signature, error_on_mismatch) @@ -1504,8 +1491,6 @@ def _get_cube(self, data): dim_coords_and_dims=dim_coords_and_dims, aux_coords_and_dims=aux_coords_and_dims, cell_measures_and_dims=cms_and_dims, - fill_value=signature.fill_value, - dtype=signature.data_type, **kwargs) # Add on any aux coord factories. @@ -1611,7 +1596,7 @@ def _build_coordinates(self): self._vector_aux_coords_dims): aux_coords_and_dims.append(_CoordAndDims(item.coord, dims)) - def _build_signature(self, cube, default_fill_value=False): + def _build_signature(self, cube): """ Generate the signature that defines this cube. @@ -1620,22 +1605,13 @@ def _build_signature(self, cube, default_fill_value=False): * cube: The source cube to create the cube signature from. - Kwargs: - - * default_fill_value: - Override the cube fill value with the default fill value of None. - Default is False i.e. use the provided cube.fill_value when - constructing the cube signature. - Returns: The cube signature. """ - fill_value = cube.fill_value - if default_fill_value: - fill_value = None - return _CubeSignature(cube.metadata, cube.shape, cube.dtype, - fill_value, cube._cell_measures_and_dims) + + return _CubeSignature(cube.metadata, cube.shape, + cube.dtype, cube._cell_measures_and_dims) def _add_cube(self, cube, coord_payload): """Create and add the source-cube skeleton to the ProtoCube.""" diff --git a/lib/iris/analysis/__init__.py b/lib/iris/analysis/__init__.py index 818bf2ac91..74bce2a458 100644 --- a/lib/iris/analysis/__init__.py +++ b/lib/iris/analysis/__init__.py @@ -563,8 +563,7 @@ def post_process(self, collapsed_cube, data_result, coords, **kwargs): The collapsed cube with its aggregated data payload. """ - collapsed_cube.replace(data_result, - fill_value=collapsed_cube.fill_value) + collapsed_cube.data = data_result return collapsed_cube def aggregate_shape(self, **kwargs): diff --git a/lib/iris/analysis/_interpolate_private.py b/lib/iris/analysis/_interpolate_private.py index a56683f8c2..3990fb6414 100644 --- a/lib/iris/analysis/_interpolate_private.py +++ b/lib/iris/analysis/_interpolate_private.py @@ -602,7 +602,6 @@ def regrid(source_cube, grid_cube, mode='bilinear', **kwargs): # Start with just the metadata and the re-sampled data... new_cube = iris.cube.Cube(new_data) new_cube.metadata = source_cube.metadata - new_cube.fill_value = source_cube.fill_value # ... and then copy across all the unaffected coordinates. diff --git a/lib/iris/analysis/_interpolation.py b/lib/iris/analysis/_interpolation.py index 46dd1115b6..405a14e24e 100644 --- a/lib/iris/analysis/_interpolation.py +++ b/lib/iris/analysis/_interpolation.py @@ -627,7 +627,6 @@ def __call__(self, sample_points, collapse_scalar=True): cube = self._src_cube new_cube = iris.cube.Cube(interpolated_data) new_cube.metadata = cube.metadata - new_cube.fill_value = cube.fill_value def construct_new_coord_given_points(coord, points): # Handle what was previously a DimCoord which may no longer be diff --git a/lib/iris/analysis/_regrid.py b/lib/iris/analysis/_regrid.py index 8dfffc0c2e..eb7a16d075 100644 --- a/lib/iris/analysis/_regrid.py +++ b/lib/iris/analysis/_regrid.py @@ -391,7 +391,6 @@ def _create_cube(data, src, x_dim, y_dim, src_x_coord, src_y_coord, # Create a result cube with the appropriate metadata result = iris.cube.Cube(data) result.metadata = copy.deepcopy(src.metadata) - result.fill_value = src.fill_value # Copy across all the coordinates which don't span the grid. # Record a mapping from old coordinate IDs to new coordinates, diff --git a/lib/iris/analysis/calculus.py b/lib/iris/analysis/calculus.py index 8d7d35d9c4..a18a4a2aed 100644 --- a/lib/iris/analysis/calculus.py +++ b/lib/iris/analysis/calculus.py @@ -341,9 +341,8 @@ def _copy_cube_transformed(src_cube, data, coord_func): assert src_cube.ndim == data.ndim # Start with just the metadata and the data... - new_cube = iris.cube.Cube(data, - fill_value=src_cube.fill_value, - dtype=src_cube.dtype) + new_cube = iris.cube.Cube(data) + new_cube.metadata = src_cube.metadata new_cube.metadata = src_cube.metadata # ... and then create all the coordinates. diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index 481350b39d..2f61cb7f37 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -765,7 +765,6 @@ def project(cube, target_proj, nx=None, ny=None): # Copy metadata across new_cube.metadata = cube.metadata - new_cube.fill_value = cube.fill_value return new_cube, extent diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 7ca49f0e7b..c5433c91fc 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -380,9 +380,6 @@ def interpolate(cube, sample_points, method=None): new_cube_coord.points = src_coord.points[fancy_coord_index_arrays] # NOTE: the new coords do *not* have bounds. - # Set the fill-value last, as any previous data setter will clear it. - new_cube.fill_value = cube.fill_value - return new_cube @@ -547,7 +544,6 @@ def __call__(self, src_cube): # Make a new result cube with the reshaped data. result_cube = iris.cube.Cube(data_2d_x_and_y) result_cube.metadata = src_cube.metadata - result_cube.fill_value = src_cube.fill_value # Copy all the coords from the trajectory result. i_trajectory_dim = result_trajectory_cube.ndim - 1 diff --git a/lib/iris/coords.py b/lib/iris/coords.py index e2cc855de2..d651770c6e 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -1866,12 +1866,7 @@ def data(self, data): raise ValueError('The data payload of a CellMeasure may not be ' 'None; it must be a numpy array or equivalent.') if is_lazy_data(data) and data.dtype.kind in 'biu': - # Disallow lazy integral data, as it will cause problems with dask - # if it turns out to contain any masked points. - # Non-floating cell measures are not valid up to CF v1.7 anyway, - # but this avoids any possible problems with non-compliant files. - # Future usage could be supported by adding a fill_value and dtype - # as for cube data. For now, disallowing it is just simpler. + # Non-floating cell measures are not valid up to CF v1.7 msg = ('Cannot create cell measure with lazy data of type {}, as ' 'integer types are not currently supported.') raise ValueError(msg.format(data.dtype)) diff --git a/lib/iris/cube.py b/lib/iris/cube.py index efa8d4a34d..2bd02424c1 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -41,7 +41,6 @@ import iris._concatenate import iris._constraints from iris._data_manager import DataManager -from iris._deprecation import warn_deprecated import iris._merge import iris.analysis @@ -648,7 +647,7 @@ def __init__(self, data, standard_name=None, long_name=None, var_name=None, units=None, attributes=None, cell_methods=None, dim_coords_and_dims=None, aux_coords_and_dims=None, aux_factories=None, - cell_measures_and_dims=None, fill_value=None, dtype=None): + cell_measures_and_dims=None): """ Creates a cube with data and optional metadata. @@ -695,14 +694,6 @@ def __init__(self, data, standard_name=None, long_name=None, :mod:`iris.aux_factory`. * cell_measures_and_dims A list of CellMeasures with dimension mappings. - * fill_value - The intended fill-value of :class:`~iris.cube.Cube` masked data. - Note that, the fill-value is cast relative to the dtype of the - :class:`~iris.cube.Cube`. - * dtype - The intended dtype of the specified lazy data, which must be - either integer or boolean. This is to handle the case of lazy - integer or boolean masked data. For example:: >>> from iris.coords import DimCoord @@ -723,8 +714,7 @@ def __init__(self, data, standard_name=None, long_name=None, raise TypeError('Invalid data type: {!r}.'.format(data)) # Initialise the cube data manager. - self._data_manager = DataManager(data, fill_value=fill_value, - realised_dtype=dtype) + self._data_manager = DataManager(data) #: The "standard name" for the Cube's phenomenon. self.standard_name = standard_name @@ -1589,27 +1579,6 @@ def dtype(self): """ return self._data_manager.dtype - @property - def fill_value(self): - """ - A fill value for the data of the :class:`~iris.cube.Cube`. - - This is a value suitable for filling masked points in this cube's data. - It may be ``None``, meaning that no suitable fill value is known. - - .. Note:: - - Ideally, this value will not occur anywhere in the cube data. - Thus, many operations that change cube data will also set - ``fill_value`` to ``None``. - - """ - return self._data_manager.fill_value - - @fill_value.setter - def fill_value(self, fill_value): - self._data_manager.fill_value = fill_value - @property def ndim(self): """The number of dimensions in the data of this cube.""" @@ -2146,9 +2115,7 @@ def new_cell_measure_dims(cm_): data = ma.array(data.data, mask=data.mask, dtype=cube_data.dtype) # Make the new cube slice - cube = Cube(data, - fill_value=self.fill_value, - dtype=self._data_manager.dtype) + cube = Cube(data) cube.metadata = deepcopy(self.metadata) # Record a mapping from old coordinate IDs to new coordinates, @@ -2386,9 +2353,7 @@ def make_chunk(key): module = ma if ma.isMaskedArray(self.data) else np func = module.concatenate data = func(chunk_data, dim) - result = iris.cube.Cube(data, - fill_value=self.fill_value, - dtype=self.dtype) + result = iris.cube.Cube(data) result.metadata = deepcopy(self.metadata) # Record a mapping from old coordinate IDs to new coordinates, @@ -2778,8 +2743,7 @@ def transpose(self, new_order=None): # Transpose the data payload. dm = self._data_manager data = dm.core_data().transpose(new_order) - self._data_manager = DataManager(data, fill_value=dm.fill_value, - realised_dtype=dm.dtype) + self._data_manager = DataManager(data) dim_mapping = {src: dest for dest, src in enumerate(new_order)} @@ -2821,8 +2785,6 @@ def _xml_element(self, doc, checksum=False, order=True, byteorder=True): if self.var_name: cube_xml_element.setAttribute('var_name', self.var_name) cube_xml_element.setAttribute('units', str(self.units)) - if self.fill_value is not None: - cube_xml_element.setAttribute('fill_value', str(self.fill_value)) cube_xml_element.setAttribute('dtype', self.dtype.name) cube_xml_element.setAttribute('core-dtype', self.core_data().dtype.name) @@ -2939,40 +2901,15 @@ def _order(array): if order and ma.isMaskedArray(data): data_xml_element.setAttribute('mask_order', _order(data.mask)) - else: - dtype = self.lazy_data().dtype - data_xml_element.setAttribute('dtype', dtype.name) + else: + dtype = self.lazy_data().dtype + data_xml_element.setAttribute('dtype', dtype.name) cube_xml_element.appendChild(data_xml_element) return cube_xml_element - def replace(self, data, dtype=None, fill_value=None): - """ - Perform an in-place replacement of the cube data. - - Args: - - * data: - Replace the data of the cube with the provided data payload. - - Kwargs: - - * dtype: - Replacement for the intended dtype of the realised lazy data. - - * fill_value: - Replacement for the cube data fill-value. - - .. note:: - Data replacement alone will clear the intended dtype - of the realised lazy data and the fill-value. - - """ - self._data_manager.replace(data, fill_value=fill_value, - realised_dtype=dtype) - - def copy(self, data=None, dtype='none', fill_value='none'): + def copy(self, data=None): """ Returns a deep copy of this cube. @@ -2981,19 +2918,12 @@ def copy(self, data=None, dtype='none', fill_value='none'): * data: Replace the data of the cube copy with provided data payload. - * dtype: - Replacement for the intended dtype of the realised lazy data. - - * fill_value: - Replacement fill-value. - Returns: A copy instance of the :class:`Cube`. """ memo = {} - cube = self._deepcopy(memo, data=data, dtype=dtype, - fill_value=fill_value) + cube = self._deepcopy(memo, data=data) return cube def __copy__(self): @@ -3004,9 +2934,8 @@ def __copy__(self): def __deepcopy__(self, memo): return self._deepcopy(memo) - def _deepcopy(self, memo, data=None, dtype='none', fill_value='none'): - dm = self._data_manager.copy(data=data, fill_value=fill_value, - realised_dtype=dtype) + def _deepcopy(self, memo, data=None): + dm = self._data_manager.copy(data=data) new_dim_coords_and_dims = deepcopy(self._dim_coords_and_dims, memo) new_aux_coords_and_dims = deepcopy(self._aux_coords_and_dims, memo) @@ -3025,9 +2954,7 @@ def _deepcopy(self, memo, data=None, dtype='none', fill_value='none'): new_cube = Cube(dm.core_data(), dim_coords_and_dims=new_dim_coords_and_dims, - aux_coords_and_dims=new_aux_coords_and_dims, - fill_value=dm.fill_value, - dtype=dm.dtype) + aux_coords_and_dims=new_aux_coords_and_dims) new_cube.metadata = deepcopy(self.metadata, memo) @@ -3043,10 +2970,6 @@ def __eq__(self, other): if isinstance(other, Cube): result = self.metadata == other.metadata - # check the cube fill-value. - if result: - result = self.fill_value == other.fill_value - # having checked the metadata, now check the coordinates if result: coord_comparison = iris.analysis.coord_comparison(self, other) diff --git a/lib/iris/etc/pp_save_rules.txt b/lib/iris/etc/pp_save_rules.txt index 8d3183729e..4d02a8babd 100644 --- a/lib/iris/etc/pp_save_rules.txt +++ b/lib/iris/etc/pp_save_rules.txt @@ -761,14 +761,14 @@ THEN #MDI IF - cm.fill_value is not None + isinstance(cm.data, ma.core.MaskedArray) THEN - pp.bmdi = cm.fill_value + pp.bmdi = cm.data.fill_value IF - cm.fill_value is None + not isinstance(cm.data, ma.core.MaskedArray) THEN - pp.bmdi = -1e30 +pp.bmdi = -1e30 # CFname mega rule diff --git a/lib/iris/experimental/regrid.py b/lib/iris/experimental/regrid.py index 021d0ce3e2..c5c67ff688 100644 --- a/lib/iris/experimental/regrid.py +++ b/lib/iris/experimental/regrid.py @@ -1131,7 +1131,6 @@ def _regrid_weighted_curvilinear_to_rectilinear__perform( cube = iris.cube.Cube(weighted_mean.reshape(grid_cube.shape), dim_coords_and_dims=dim_coords_and_dims) cube.metadata = copy.deepcopy(src_cube.metadata) - cube.fill_value = src_cube.fill_value for coord in src_cube.coords(dimensions=()): cube.add_aux_coord(coord.copy()) @@ -1494,7 +1493,6 @@ def _create_cube(self, data, src, src_xy_dim, src_x_coord, src_y_coord, # Create a result cube with the appropriate metadata result = iris.cube.Cube(data) result.metadata = copy.deepcopy(src.metadata) - result.fill_value = src.fill_value # Copy across all the coordinates which don't span the grid. # Record a mapping from old coordinate IDs to new coordinates, diff --git a/lib/iris/fileformats/grib/__init__.py b/lib/iris/fileformats/grib/__init__.py index 34ce13ac36..d4ea3d86af 100644 --- a/lib/iris/fileformats/grib/__init__.py +++ b/lib/iris/fileformats/grib/__init__.py @@ -34,7 +34,7 @@ import numpy as np import numpy.ma as ma -from iris._lazy_data import as_lazy_data, convert_nans_array +from iris._lazy_data import as_lazy_data import iris.coord_systems as coord_systems from iris.exceptions import TranslationError, NotYetImplementedError # NOTE: careful here, to avoid circular imports (as iris imports grib) @@ -139,7 +139,6 @@ class GribWrapper(object): def __init__(self, grib_message, grib_fh=None): """Store the grib message and compute our extra keys.""" self.grib_message = grib_message - self.realised_dtype = np.array([0.]).dtype if self.edition != 1: emsg = 'GRIB edition {} is not supported by {!r}.' @@ -178,14 +177,11 @@ def __init__(self, grib_message, grib_fh=None): # The byte offset requires to be reset back to the first byte # of this message. The file pointer offset is always at the end # of the current message due to the grib-api reading the message. - proxy = GribDataProxy(shape, self.realised_dtype, grib_fh.name, + proxy = GribDataProxy(shape, np.array([0.]).dtype, grib_fh.name, offset - message_length) self._data = as_lazy_data(proxy) else: values_array = _message_values(grib_message, shape) - # mask where the values are nan - self.data = convert_nans_array(values_array, - nans_replacement=ma.masked) def _confirm_in_scope(self): """Ensure we have a grib flavour that we choose to support.""" @@ -692,6 +688,10 @@ def _message_values(grib_message, shape): data = gribapi.grib_get_double_array(grib_message, 'values') data = data.reshape(shape) + # Handle missing values in a sensible way. + mask = np.isnan(data) + if mask.any(): + data = ma.array(data, mask=mask, fill_value=np.nan) return data diff --git a/lib/iris/fileformats/grib/_save_rules.py b/lib/iris/fileformats/grib/_save_rules.py index 7a5a8fce49..8182246305 100644 --- a/lib/iris/fileformats/grib/_save_rules.py +++ b/lib/iris/fileformats/grib/_save_rules.py @@ -1160,17 +1160,20 @@ def product_definition_section(cube, grib): def data_section(cube, grib): # Masked data? if ma.isMaskedArray(cube.data): - fill_value = cube.fill_value - if fill_value is None or np.isnan(cube.fill_value): + if not np.isnan(cube.data.fill_value): + # Use the data's fill value. + fill_value = float(cube.data.fill_value) + else: # We can't use the cube's fill value if it's NaN, # the GRIB API doesn't like it. # Calculate an MDI outside the data range. min, max = cube.data.min(), cube.data.max() fill_value = min - (max - min) * 0.1 + # Prepare the unmaksed data array, using fill_value as the MDI. + data = cube.data.filled(fill_value) else: fill_value = None - - data = cube.data + data = cube.data # units scaling grib2_info = gptx.cf_phenom_to_grib2_info(cube.standard_name, diff --git a/lib/iris/fileformats/grib/message.py b/lib/iris/fileformats/grib/message.py index c936fe6e8b..d7ed3c40a6 100644 --- a/lib/iris/fileformats/grib/message.py +++ b/lib/iris/fileformats/grib/message.py @@ -30,7 +30,7 @@ import numpy as np import numpy.ma as ma -from iris._lazy_data import array_masked_to_nans, as_lazy_data +from iris._lazy_data import as_lazy_data from iris.exceptions import TranslationError @@ -120,10 +120,6 @@ def bmdi(self): # Default for fill value is None. return None - @property - def realised_dtype(self): - return np.dtype('f8') - def core_data(self): return self.data @@ -164,8 +160,7 @@ def data(self): shape = (grid_section['numberOfDataPoints'],) else: shape = (grid_section['Nj'], grid_section['Ni']) - proxy = _DataProxy(shape, self.realised_dtype, np.nan, - self._recreate_raw) + proxy = _DataProxy(shape, np.dtype('f8'), self._recreate_raw) data = as_lazy_data(proxy) else: fmt = 'Grid definition template {} is not supported' @@ -196,7 +191,7 @@ class _DataProxy(object): __slots__ = ('shape', 'dtype', 'recreate_raw') - def __init__(self, shape, dtype, fill_value, recreate_raw): + def __init__(self, shape, dtype, recreate_raw): self.shape = shape self.dtype = dtype self.recreate_raw = recreate_raw @@ -258,10 +253,9 @@ def __getitem__(self, keys): # Only the non-masked values are included in codedValues. _data = np.empty(shape=bitmap.shape) _data[bitmap.astype(bool)] = data - # Use nan where input = 1, the opposite of the behaviour - # specified by the GRIB spec. - _data[np.logical_not(bitmap.astype(bool))] = np.nan - data = _data + # `ma.masked_array` masks where input = 1, the opposite of + # the behaviour specified by the GRIB spec. + data = ma.masked_array(_data, mask=np.logical_not(bitmap)) else: msg = 'Shapes of data and bitmap do not match.' raise TranslationError(msg) @@ -272,7 +266,8 @@ def __getitem__(self, keys): def __repr__(self): msg = '<{self.__class__.__name__} shape={self.shape} ' \ - 'dtype={self.dtype!r} recreate_raw={self.recreate_raw!r} ' + 'dtype={self.dtype!r} fill_value={self.fill_value!r} ' \ + 'recreate_raw={self.recreate_raw!r} ' return msg.format(self=self) def __getstate__(self): diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index deb6a26b73..e65b90ef2f 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -56,8 +56,7 @@ import iris.fileformats._pyke_rules import iris.io import iris.util -from iris._lazy_data import (array_masked_to_nans, as_lazy_data, - convert_nans_array, nan_array_type) +from iris._lazy_data import as_lazy_data # Show Pyke inference engine statistics. DEBUG = False @@ -395,14 +394,7 @@ def __getitem__(self, keys): var = variable[keys] finally: dataset.close() - if ma.isMaskedArray(var): - if self.dtype.kind in 'biu': - msg = "NetCDF variable {!r} has masked data, which is not " \ - "supported for declared dtype {!r}." - raise TypeError( - msg.format(self.variable_name, self.dtype.name)) - var = array_masked_to_nans(var) - return np.asanyarray(var, dtype=self.dtype) + return np.asanyarray(var) def __repr__(self): fmt = '<{self.__class__.__name__} shape={self.shape}' \ @@ -510,11 +502,10 @@ def _load_cube(engine, cf, cf_var, filename): # Create cube with deferred data, but no metadata fill_value = getattr(cf_var.cf_data, '_FillValue', None) - dtype = nan_array_type(dummy_data.dtype) - proxy = NetCDFDataProxy(cf_var.shape, dtype, + proxy = NetCDFDataProxy(cf_var.shape, dummy_data.dtype, filename, cf_var.cf_name, fill_value) data = as_lazy_data(proxy, chunks=cf_var.shape) - cube = iris.cube.Cube(data, fill_value=fill_value, dtype=dummy_data.dtype) + cube = iris.cube.Cube(data) # Reset the pyke inference engine. engine.reset() @@ -1958,7 +1949,11 @@ def set_packing_ncattrs(cfvar): # Explicitly assign the fill_value, which will be the type default # in the case of an unmasked array. if packing is None: - fill_value = cube.fill_value + if hasattr(cube.lazy_data(), 'fill_value'): + fill_value = cube.lazy_data().fill_value + else: + fill_value = None + dtype = cube.lazy_data().dtype.newbyteorder('=') cf_var = self._dataset.createVariable( @@ -1967,12 +1962,8 @@ def set_packing_ncattrs(cfvar): **kwargs) set_packing_ncattrs(cf_var) - # Now stream the cube data payload straight to the netCDF - # data variable within the netCDF file, where any NaN values - # are replaced with the specified cube fill_value. - data = da.map_blocks(convert_nans_array, cube.lazy_data(), - nans_replacement=cube.fill_value, - result_dtype=cube.dtype) + data = cube.lazy_data() + da.store([data], [cf_var]) if cube.standard_name: diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 5f79a8966e..89c374ffc7 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -39,8 +39,7 @@ import netcdftime from iris._deprecation import warn_deprecated -from iris._lazy_data import (array_masked_to_nans, as_concrete_data, - as_lazy_data, is_lazy_data) +from iris._lazy_data import as_concrete_data, as_lazy_data, is_lazy_data import iris.config import iris.fileformats.rules import iris.fileformats.pp_rules @@ -862,8 +861,8 @@ def _lbpack_getter(self): @property def dtype(self): - return np.dtype('f8') if self.src_dtype.kind == 'i' \ - else self.src_dtype.newbyteorder('=') + return np.dtype('f8') if self.src_dtype.kind == 'i' else \ + self.src_dtype.newbyteorder('=') @property def fill_value(self): @@ -1081,7 +1080,7 @@ def _pp_attribute_names(header_defn): special_headers = list('_' + name for name in _SPECIAL_HEADERS) extra_data = list(EXTRA_DATA.values()) special_attributes = ['_raw_header', 'raw_lbtim', 'raw_lbpack', - 'boundary_packing', '_realised_dtype'] + 'boundary_packing'] return normal_headers + special_headers + extra_data + special_attributes @@ -1114,7 +1113,6 @@ def __init__(self, header=None): self.raw_lbtim = None self.raw_lbpack = None self.boundary_packing = None - self._realised_dtype = None if header is not None: self.raw_lbtim = header[self.HEADER_DICT['lbtim'][0]] self.raw_lbpack = header[self.HEADER_DICT['lbpack'][0]] @@ -1286,9 +1284,7 @@ def data(self): """ if is_lazy_data(self._data): # Replace with real data on the first access. - self._data = as_concrete_data(self._data, - nans_replacement=ma.masked, - result_dtype=self.realised_dtype) + self._data = as_concrete_data(self._data) return self._data @data.setter @@ -1298,16 +1294,6 @@ def data(self, value): def core_data(self): return self._data - @property - def realised_dtype(self): - return self._data.dtype \ - if self._realised_dtype is None \ - else self._realised_dtype - - @realised_dtype.setter - def realised_dtype(self, value): - self._realised_dtype = value - @property def calendar(self): """Return the calendar of the field.""" @@ -1401,8 +1387,7 @@ def save(self, file_handle): # Integer or Boolean data : No masking is supported. msg = 'Non-floating masked data cannot be saved to PP.' raise ValueError(msg) - fill_value = self.bmdi - data = data.filled(fill_value=fill_value) + data = data.filled(fill_value=self.bmdi) # Make sure the data is big-endian if data.dtype.newbyteorder('>') != data.dtype: @@ -1900,7 +1885,6 @@ def _create_field_data(field, data_shape, land_mask): field.raw_lbpack, field.boundary_packing, field.bmdi, land_mask) - field.realised_dtype = dtype.newbyteorder('=') block_shape = data_shape if 0 not in data_shape else (1, 1) field.data = as_lazy_data(proxy, chunks=block_shape) diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index f8e003f9b7..b101604b74 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -898,18 +898,11 @@ def _make_cube(field, converter): metadata = converter(field) cube_data = field.core_data() - cube_dtype = field.realised_dtype - if cube_dtype.kind in 'biu': - # Don't adopt BMDI as a fill value for integer data. - cube_fill_value = None - else: - cube_fill_value = field.bmdi cube = iris.cube.Cube(cube_data, attributes=metadata.attributes, cell_methods=metadata.cell_methods, dim_coords_and_dims=metadata.dim_coords_and_dims, - aux_coords_and_dims=metadata.aux_coords_and_dims, - fill_value=cube_fill_value, dtype=cube_dtype) + aux_coords_and_dims=metadata.aux_coords_and_dims) # Temporary code to deal with invalid standard names in the # translation table. diff --git a/lib/iris/tests/integration/test_netcdf.py b/lib/iris/tests/integration/test_netcdf.py index 6b6871500d..4d9895d15f 100644 --- a/lib/iris/tests/integration/test_netcdf.py +++ b/lib/iris/tests/integration/test_netcdf.py @@ -212,7 +212,7 @@ def test_lazy_preserved_save(self): def test_lazy_mask_preserve_fill_value(self): data = ma.array([0, 1], mask=[False, True]) - cube = iris.cube.Cube(data, fill_value=-1) + cube = iris.cube.Cube(data) with self.temp_filename(suffix='.nc') as filename, \ self.temp_filename(suffix='.nc') as other_filename: iris.save(cube, filename, unlimited_dimensions=[]) diff --git a/lib/iris/tests/results/COLPEX/small_colpex_theta_p_alt.cml b/lib/iris/tests/results/COLPEX/small_colpex_theta_p_alt.cml index 03a0fe20dd..1cd1d1d53e 100644 --- a/lib/iris/tests/results/COLPEX/small_colpex_theta_p_alt.cml +++ b/lib/iris/tests/results/COLPEX/small_colpex_theta_p_alt.cml @@ -1,6 +1,6 @@ - + @@ -523,7 +523,7 @@ - + @@ -1046,7 +1046,7 @@ - + diff --git a/lib/iris/tests/results/FF/air_temperature_1.cml b/lib/iris/tests/results/FF/air_temperature_1.cml index 8d653c28e9..fedd074dee 100644 --- a/lib/iris/tests/results/FF/air_temperature_1.cml +++ b/lib/iris/tests/results/FF/air_temperature_1.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/FF/air_temperature_2.cml b/lib/iris/tests/results/FF/air_temperature_2.cml index d06ff4d286..c0bc0fff8b 100644 --- a/lib/iris/tests/results/FF/air_temperature_2.cml +++ b/lib/iris/tests/results/FF/air_temperature_2.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/FF/soil_temperature_1.cml b/lib/iris/tests/results/FF/soil_temperature_1.cml index 2549b1b962..e1134337ed 100644 --- a/lib/iris/tests/results/FF/soil_temperature_1.cml +++ b/lib/iris/tests/results/FF/soil_temperature_1.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/FF/surface_altitude_1.cml b/lib/iris/tests/results/FF/surface_altitude_1.cml index 8ec0c305da..aec7a834e3 100644 --- a/lib/iris/tests/results/FF/surface_altitude_1.cml +++ b/lib/iris/tests/results/FF/surface_altitude_1.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/abs.cml b/lib/iris/tests/results/analysis/abs.cml index a427761d7f..9a012ca90f 100644 --- a/lib/iris/tests/results/analysis/abs.cml +++ b/lib/iris/tests/results/analysis/abs.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition.cml b/lib/iris/tests/results/analysis/addition.cml index b44455cb95..f3f54ca912 100644 --- a/lib/iris/tests/results/analysis/addition.cml +++ b/lib/iris/tests/results/analysis/addition.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition_coord_x.cml b/lib/iris/tests/results/analysis/addition_coord_x.cml index 507d1ccdd9..3b5c037ee5 100644 --- a/lib/iris/tests/results/analysis/addition_coord_x.cml +++ b/lib/iris/tests/results/analysis/addition_coord_x.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition_coord_y.cml b/lib/iris/tests/results/analysis/addition_coord_y.cml index 8edf44f3a0..816c795e33 100644 --- a/lib/iris/tests/results/analysis/addition_coord_y.cml +++ b/lib/iris/tests/results/analysis/addition_coord_y.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition_different_std_name.cml b/lib/iris/tests/results/analysis/addition_different_std_name.cml index aa7d48f976..70488b8c3d 100644 --- a/lib/iris/tests/results/analysis/addition_different_std_name.cml +++ b/lib/iris/tests/results/analysis/addition_different_std_name.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition_in_place.cml b/lib/iris/tests/results/analysis/addition_in_place.cml index b44455cb95..f3f54ca912 100644 --- a/lib/iris/tests/results/analysis/addition_in_place.cml +++ b/lib/iris/tests/results/analysis/addition_in_place.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition_in_place_coord.cml b/lib/iris/tests/results/analysis/addition_in_place_coord.cml index a909fd67a9..827c8019a1 100644 --- a/lib/iris/tests/results/analysis/addition_in_place_coord.cml +++ b/lib/iris/tests/results/analysis/addition_in_place_coord.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/addition_scalar.cml b/lib/iris/tests/results/analysis/addition_scalar.cml index 6eaf5ef2bd..2ebba99227 100644 --- a/lib/iris/tests/results/analysis/addition_scalar.cml +++ b/lib/iris/tests/results/analysis/addition_scalar.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/apply_ifunc.cml b/lib/iris/tests/results/analysis/apply_ifunc.cml index 5e93dcfb6a..805e20c259 100644 --- a/lib/iris/tests/results/analysis/apply_ifunc.cml +++ b/lib/iris/tests/results/analysis/apply_ifunc.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/apply_ifunc_frompyfunc.cml b/lib/iris/tests/results/analysis/apply_ifunc_frompyfunc.cml index 73aa603992..9292dc2d88 100644 --- a/lib/iris/tests/results/analysis/apply_ifunc_frompyfunc.cml +++ b/lib/iris/tests/results/analysis/apply_ifunc_frompyfunc.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/apply_ifunc_original.cml b/lib/iris/tests/results/analysis/apply_ifunc_original.cml index b86e0d7c06..de5e989950 100644 --- a/lib/iris/tests/results/analysis/apply_ifunc_original.cml +++ b/lib/iris/tests/results/analysis/apply_ifunc_original.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/apply_ufunc.cml b/lib/iris/tests/results/analysis/apply_ufunc.cml index 5e93dcfb6a..805e20c259 100644 --- a/lib/iris/tests/results/analysis/apply_ufunc.cml +++ b/lib/iris/tests/results/analysis/apply_ufunc.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/apply_ufunc_frompyfunc.cml b/lib/iris/tests/results/analysis/apply_ufunc_frompyfunc.cml index fc7cce9134..3e7dd10957 100644 --- a/lib/iris/tests/results/analysis/apply_ufunc_frompyfunc.cml +++ b/lib/iris/tests/results/analysis/apply_ufunc_frompyfunc.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/apply_ufunc_original.cml b/lib/iris/tests/results/analysis/apply_ufunc_original.cml index b86e0d7c06..de5e989950 100644 --- a/lib/iris/tests/results/analysis/apply_ufunc_original.cml +++ b/lib/iris/tests/results/analysis/apply_ufunc_original.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/areaweights_original.cml b/lib/iris/tests/results/analysis/areaweights_original.cml index 49f0dcf24d..f5197f9d77 100644 --- a/lib/iris/tests/results/analysis/areaweights_original.cml +++ b/lib/iris/tests/results/analysis/areaweights_original.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/division.cml b/lib/iris/tests/results/analysis/division.cml index c91c6c4919..1210f3d736 100644 --- a/lib/iris/tests/results/analysis/division.cml +++ b/lib/iris/tests/results/analysis/division.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/division_by_array.cml b/lib/iris/tests/results/analysis/division_by_array.cml index 781f95173d..279fc00969 100644 --- a/lib/iris/tests/results/analysis/division_by_array.cml +++ b/lib/iris/tests/results/analysis/division_by_array.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/division_by_latitude.cml b/lib/iris/tests/results/analysis/division_by_latitude.cml index e68307ded1..a9570c2dfe 100644 --- a/lib/iris/tests/results/analysis/division_by_latitude.cml +++ b/lib/iris/tests/results/analysis/division_by_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/division_by_longitude.cml b/lib/iris/tests/results/analysis/division_by_longitude.cml index 31da15b10d..8f7c88d240 100644 --- a/lib/iris/tests/results/analysis/division_by_longitude.cml +++ b/lib/iris/tests/results/analysis/division_by_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/division_by_singular_coord.cml b/lib/iris/tests/results/analysis/division_by_singular_coord.cml index 9fc56108d5..8599423542 100644 --- a/lib/iris/tests/results/analysis/division_by_singular_coord.cml +++ b/lib/iris/tests/results/analysis/division_by_singular_coord.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/division_scalar.cml b/lib/iris/tests/results/analysis/division_scalar.cml index 781f95173d..279fc00969 100644 --- a/lib/iris/tests/results/analysis/division_scalar.cml +++ b/lib/iris/tests/results/analysis/division_scalar.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/exponentiate.cml b/lib/iris/tests/results/analysis/exponentiate.cml index 62f4bf08ab..1e8db08a0f 100644 --- a/lib/iris/tests/results/analysis/exponentiate.cml +++ b/lib/iris/tests/results/analysis/exponentiate.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/gmean_latitude.cml b/lib/iris/tests/results/analysis/gmean_latitude.cml index e71bb14e74..138073df12 100644 --- a/lib/iris/tests/results/analysis/gmean_latitude.cml +++ b/lib/iris/tests/results/analysis/gmean_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/gmean_latitude_longitude.cml b/lib/iris/tests/results/analysis/gmean_latitude_longitude.cml index 1176acb50c..f37d247c47 100644 --- a/lib/iris/tests/results/analysis/gmean_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/gmean_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/gmean_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/gmean_latitude_longitude_1call.cml index ac4ed1681d..4e12d0c5f5 100644 --- a/lib/iris/tests/results/analysis/gmean_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/gmean_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/hmean_latitude.cml b/lib/iris/tests/results/analysis/hmean_latitude.cml index 6cc2242648..806acbb4c5 100644 --- a/lib/iris/tests/results/analysis/hmean_latitude.cml +++ b/lib/iris/tests/results/analysis/hmean_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/hmean_latitude_longitude.cml b/lib/iris/tests/results/analysis/hmean_latitude_longitude.cml index 2abf38fef2..9b8e4169d1 100644 --- a/lib/iris/tests/results/analysis/hmean_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/hmean_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/hmean_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/hmean_latitude_longitude_1call.cml index 931e8c0a97..923e323714 100644 --- a/lib/iris/tests/results/analysis/hmean_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/hmean_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/linear/real_2dslice.cml b/lib/iris/tests/results/analysis/interpolation/linear/real_2dslice.cml index 3533831071..695b038f0c 100644 --- a/lib/iris/tests/results/analysis/interpolation/linear/real_2dslice.cml +++ b/lib/iris/tests/results/analysis/interpolation/linear/real_2dslice.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/linear/real_2slices.cml b/lib/iris/tests/results/analysis/interpolation/linear/real_2slices.cml index 20a59d23a9..4c5f273fa6 100644 --- a/lib/iris/tests/results/analysis/interpolation/linear/real_2slices.cml +++ b/lib/iris/tests/results/analysis/interpolation/linear/real_2slices.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/linear/real_circular_2dslice.cml b/lib/iris/tests/results/analysis/interpolation/linear/real_circular_2dslice.cml index dbf4f6dbe8..b4365291b4 100644 --- a/lib/iris/tests/results/analysis/interpolation/linear/real_circular_2dslice.cml +++ b/lib/iris/tests/results/analysis/interpolation/linear/real_circular_2dslice.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded.cml b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded.cml index 4044ad0497..f9c1138755 100644 --- a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded.cml +++ b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded_mid_point.cml b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded_mid_point.cml index 4044ad0497..f9c1138755 100644 --- a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded_mid_point.cml +++ b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_bounded_mid_point.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude.cml b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude.cml index a7b0953a56..7f98c24e4d 100644 --- a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude.cml +++ b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude_longitude.cml b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude_longitude.cml index da5633089a..31f864502f 100644 --- a/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/interpolation/nearest_neighbour_extract_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/log.cml b/lib/iris/tests/results/analysis/log.cml index ff5147fb1e..8bbe5a3a58 100644 --- a/lib/iris/tests/results/analysis/log.cml +++ b/lib/iris/tests/results/analysis/log.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/log10.cml b/lib/iris/tests/results/analysis/log10.cml index e1c1bbe21b..1ef012c899 100644 --- a/lib/iris/tests/results/analysis/log10.cml +++ b/lib/iris/tests/results/analysis/log10.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/log2.cml b/lib/iris/tests/results/analysis/log2.cml index 30da9b3566..9d4a9b88a8 100644 --- a/lib/iris/tests/results/analysis/log2.cml +++ b/lib/iris/tests/results/analysis/log2.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/maths_original.cml b/lib/iris/tests/results/analysis/maths_original.cml index a1757f47e8..6c05986111 100644 --- a/lib/iris/tests/results/analysis/maths_original.cml +++ b/lib/iris/tests/results/analysis/maths_original.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/max_latitude.cml b/lib/iris/tests/results/analysis/max_latitude.cml index b9acb2e1a0..b60e76ea8d 100644 --- a/lib/iris/tests/results/analysis/max_latitude.cml +++ b/lib/iris/tests/results/analysis/max_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/max_latitude_longitude.cml b/lib/iris/tests/results/analysis/max_latitude_longitude.cml index 623d412a61..3a7d98bbb1 100644 --- a/lib/iris/tests/results/analysis/max_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/max_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/max_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/max_latitude_longitude_1call.cml index f432a91b37..3291118177 100644 --- a/lib/iris/tests/results/analysis/max_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/max_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/mean_latitude.cml b/lib/iris/tests/results/analysis/mean_latitude.cml index 0317e2b1e2..f7e97e1ec3 100644 --- a/lib/iris/tests/results/analysis/mean_latitude.cml +++ b/lib/iris/tests/results/analysis/mean_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/mean_latitude_longitude.cml b/lib/iris/tests/results/analysis/mean_latitude_longitude.cml index a45e0a610e..ed89374ee5 100644 --- a/lib/iris/tests/results/analysis/mean_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/mean_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/mean_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/mean_latitude_longitude_1call.cml index 44f9930efd..f5caed6288 100644 --- a/lib/iris/tests/results/analysis/mean_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/mean_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/median_latitude.cml b/lib/iris/tests/results/analysis/median_latitude.cml index b43235dd05..b5c35a765f 100644 --- a/lib/iris/tests/results/analysis/median_latitude.cml +++ b/lib/iris/tests/results/analysis/median_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/median_latitude_longitude.cml b/lib/iris/tests/results/analysis/median_latitude_longitude.cml index 4e1335e64b..dc4196bffd 100644 --- a/lib/iris/tests/results/analysis/median_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/median_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/median_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/median_latitude_longitude_1call.cml index f617c0895f..f02423597d 100644 --- a/lib/iris/tests/results/analysis/median_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/median_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/min_latitude.cml b/lib/iris/tests/results/analysis/min_latitude.cml index 7cf5ac7130..b79085ea21 100644 --- a/lib/iris/tests/results/analysis/min_latitude.cml +++ b/lib/iris/tests/results/analysis/min_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/min_latitude_longitude.cml b/lib/iris/tests/results/analysis/min_latitude_longitude.cml index 0f4087c17c..1889a86e0d 100644 --- a/lib/iris/tests/results/analysis/min_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/min_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/min_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/min_latitude_longitude_1call.cml index cb6d0f200d..c93909c324 100644 --- a/lib/iris/tests/results/analysis/min_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/min_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/multiply.cml b/lib/iris/tests/results/analysis/multiply.cml index a96908621c..9fe9f1a16b 100644 --- a/lib/iris/tests/results/analysis/multiply.cml +++ b/lib/iris/tests/results/analysis/multiply.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/multiply_different_std_name.cml b/lib/iris/tests/results/analysis/multiply_different_std_name.cml index 510934ba83..5d75a86e81 100644 --- a/lib/iris/tests/results/analysis/multiply_different_std_name.cml +++ b/lib/iris/tests/results/analysis/multiply_different_std_name.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/original.cml b/lib/iris/tests/results/analysis/original.cml index 7229c5903a..683d505487 100644 --- a/lib/iris/tests/results/analysis/original.cml +++ b/lib/iris/tests/results/analysis/original.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/original_common.cml b/lib/iris/tests/results/analysis/original_common.cml index 2b7643b909..d6aa8fe63b 100644 --- a/lib/iris/tests/results/analysis/original_common.cml +++ b/lib/iris/tests/results/analysis/original_common.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/original_hmean.cml b/lib/iris/tests/results/analysis/original_hmean.cml index f342ccc1b7..cda6275472 100644 --- a/lib/iris/tests/results/analysis/original_hmean.cml +++ b/lib/iris/tests/results/analysis/original_hmean.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/linear_both_circular.cml b/lib/iris/tests/results/analysis/regrid/linear_both_circular.cml index 171925699d..ef8e0217a2 100644 --- a/lib/iris/tests/results/analysis/regrid/linear_both_circular.cml +++ b/lib/iris/tests/results/analysis/regrid/linear_both_circular.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/linear_circular_grid.cml b/lib/iris/tests/results/analysis/regrid/linear_circular_grid.cml index 08c5a81e1f..23da537d1a 100644 --- a/lib/iris/tests/results/analysis/regrid/linear_circular_grid.cml +++ b/lib/iris/tests/results/analysis/regrid/linear_circular_grid.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/linear_circular_src.cml b/lib/iris/tests/results/analysis/regrid/linear_circular_src.cml index 5d832e6ba6..a39cf83d04 100644 --- a/lib/iris/tests/results/analysis/regrid/linear_circular_src.cml +++ b/lib/iris/tests/results/analysis/regrid/linear_circular_src.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/linear_circular_srcmissingmask.cml b/lib/iris/tests/results/analysis/regrid/linear_circular_srcmissingmask.cml index 5d832e6ba6..a39cf83d04 100644 --- a/lib/iris/tests/results/analysis/regrid/linear_circular_srcmissingmask.cml +++ b/lib/iris/tests/results/analysis/regrid/linear_circular_srcmissingmask.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/linear_non_circular.cml b/lib/iris/tests/results/analysis/regrid/linear_non_circular.cml index ded7ffd106..7faef54684 100644 --- a/lib/iris/tests/results/analysis/regrid/linear_non_circular.cml +++ b/lib/iris/tests/results/analysis/regrid/linear_non_circular.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/nearest_both_circular.cml b/lib/iris/tests/results/analysis/regrid/nearest_both_circular.cml index d14b6e1d2d..78d6a79c4a 100644 --- a/lib/iris/tests/results/analysis/regrid/nearest_both_circular.cml +++ b/lib/iris/tests/results/analysis/regrid/nearest_both_circular.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/nearest_circular_grid.cml b/lib/iris/tests/results/analysis/regrid/nearest_circular_grid.cml index d73639f66d..e1f6df038b 100644 --- a/lib/iris/tests/results/analysis/regrid/nearest_circular_grid.cml +++ b/lib/iris/tests/results/analysis/regrid/nearest_circular_grid.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/nearest_circular_src.cml b/lib/iris/tests/results/analysis/regrid/nearest_circular_src.cml index 0a589642fd..15ede8da0c 100644 --- a/lib/iris/tests/results/analysis/regrid/nearest_circular_src.cml +++ b/lib/iris/tests/results/analysis/regrid/nearest_circular_src.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/nearest_circular_srcmissingmask.cml b/lib/iris/tests/results/analysis/regrid/nearest_circular_srcmissingmask.cml index 0a589642fd..15ede8da0c 100644 --- a/lib/iris/tests/results/analysis/regrid/nearest_circular_srcmissingmask.cml +++ b/lib/iris/tests/results/analysis/regrid/nearest_circular_srcmissingmask.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/regrid/nearest_non_circular.cml b/lib/iris/tests/results/analysis/regrid/nearest_non_circular.cml index 5b842c8811..23a19b5185 100644 --- a/lib/iris/tests/results/analysis/regrid/nearest_non_circular.cml +++ b/lib/iris/tests/results/analysis/regrid/nearest_non_circular.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/rms_latitude.cml b/lib/iris/tests/results/analysis/rms_latitude.cml index f134bece0c..8422647cbc 100644 --- a/lib/iris/tests/results/analysis/rms_latitude.cml +++ b/lib/iris/tests/results/analysis/rms_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/rms_latitude_longitude.cml b/lib/iris/tests/results/analysis/rms_latitude_longitude.cml index 16fcffe176..095c9cb6ae 100644 --- a/lib/iris/tests/results/analysis/rms_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/rms_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/rms_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/rms_latitude_longitude_1call.cml index 8c18d225bf..4fb3e44896 100644 --- a/lib/iris/tests/results/analysis/rms_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/rms_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/sqrt.cml b/lib/iris/tests/results/analysis/sqrt.cml index fee35a10a8..e801a5e236 100644 --- a/lib/iris/tests/results/analysis/sqrt.cml +++ b/lib/iris/tests/results/analysis/sqrt.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/std_dev_latitude.cml b/lib/iris/tests/results/analysis/std_dev_latitude.cml index f5c5ee6634..0e3e4479ca 100644 --- a/lib/iris/tests/results/analysis/std_dev_latitude.cml +++ b/lib/iris/tests/results/analysis/std_dev_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/std_dev_latitude_longitude.cml b/lib/iris/tests/results/analysis/std_dev_latitude_longitude.cml index cc75ca3b56..573350d8bf 100644 --- a/lib/iris/tests/results/analysis/std_dev_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/std_dev_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/std_dev_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/std_dev_latitude_longitude_1call.cml index 50f54f537a..f935b50cca 100644 --- a/lib/iris/tests/results/analysis/std_dev_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/std_dev_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/subtract.cml b/lib/iris/tests/results/analysis/subtract.cml index ace9a0046d..35ef131b8f 100644 --- a/lib/iris/tests/results/analysis/subtract.cml +++ b/lib/iris/tests/results/analysis/subtract.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/subtract_array.cml b/lib/iris/tests/results/analysis/subtract_array.cml index aa7d48f976..70488b8c3d 100644 --- a/lib/iris/tests/results/analysis/subtract_array.cml +++ b/lib/iris/tests/results/analysis/subtract_array.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/subtract_coord_x.cml b/lib/iris/tests/results/analysis/subtract_coord_x.cml index b7665597fd..a4a9b9654d 100644 --- a/lib/iris/tests/results/analysis/subtract_coord_x.cml +++ b/lib/iris/tests/results/analysis/subtract_coord_x.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/subtract_coord_y.cml b/lib/iris/tests/results/analysis/subtract_coord_y.cml index 2a9995ccab..80612ea4c3 100644 --- a/lib/iris/tests/results/analysis/subtract_coord_y.cml +++ b/lib/iris/tests/results/analysis/subtract_coord_y.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/subtract_scalar.cml b/lib/iris/tests/results/analysis/subtract_scalar.cml index ff0a1ff9e2..24b360467d 100644 --- a/lib/iris/tests/results/analysis/subtract_scalar.cml +++ b/lib/iris/tests/results/analysis/subtract_scalar.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/sum_latitude.cml b/lib/iris/tests/results/analysis/sum_latitude.cml index 3d1e13a955..5875384cb6 100644 --- a/lib/iris/tests/results/analysis/sum_latitude.cml +++ b/lib/iris/tests/results/analysis/sum_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/sum_latitude_longitude.cml b/lib/iris/tests/results/analysis/sum_latitude_longitude.cml index 4135f70210..948134bea9 100644 --- a/lib/iris/tests/results/analysis/sum_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/sum_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/sum_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/sum_latitude_longitude_1call.cml index d7f26a82f8..818f2aed1a 100644 --- a/lib/iris/tests/results/analysis/sum_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/sum_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/variance_latitude.cml b/lib/iris/tests/results/analysis/variance_latitude.cml index 91921d0e79..60b4228404 100644 --- a/lib/iris/tests/results/analysis/variance_latitude.cml +++ b/lib/iris/tests/results/analysis/variance_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/variance_latitude_longitude.cml b/lib/iris/tests/results/analysis/variance_latitude_longitude.cml index 82ef78a4ee..45f1e63943 100644 --- a/lib/iris/tests/results/analysis/variance_latitude_longitude.cml +++ b/lib/iris/tests/results/analysis/variance_latitude_longitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/variance_latitude_longitude_1call.cml b/lib/iris/tests/results/analysis/variance_latitude_longitude_1call.cml index 531ec056b7..1fe09f9080 100644 --- a/lib/iris/tests/results/analysis/variance_latitude_longitude_1call.cml +++ b/lib/iris/tests/results/analysis/variance_latitude_longitude_1call.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/analysis/weighted_mean_original.cml b/lib/iris/tests/results/analysis/weighted_mean_original.cml index 2779549286..ad7063d025 100644 --- a/lib/iris/tests/results/analysis/weighted_mean_original.cml +++ b/lib/iris/tests/results/analysis/weighted_mean_original.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cdm/extract/lat_eq_10.cml b/lib/iris/tests/results/cdm/extract/lat_eq_10.cml index 2c8d99f40c..01879b3318 100644 --- a/lib/iris/tests/results/cdm/extract/lat_eq_10.cml +++ b/lib/iris/tests/results/cdm/extract/lat_eq_10.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cdm/extract/lat_gt_10.cml b/lib/iris/tests/results/cdm/extract/lat_gt_10.cml index c9c96744d4..57f8c3ff84 100644 --- a/lib/iris/tests/results/cdm/extract/lat_gt_10.cml +++ b/lib/iris/tests/results/cdm/extract/lat_gt_10.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cdm/extract/lat_gt_10_and_lon_ge_10.cml b/lib/iris/tests/results/cdm/extract/lat_gt_10_and_lon_ge_10.cml index a5115f079b..cbf6ae670f 100644 --- a/lib/iris/tests/results/cdm/extract/lat_gt_10_and_lon_ge_10.cml +++ b/lib/iris/tests/results/cdm/extract/lat_gt_10_and_lon_ge_10.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cdm/masked_cube.cml b/lib/iris/tests/results/cdm/masked_cube.cml index f281e3f192..5a1577dd20 100644 --- a/lib/iris/tests/results/cdm/masked_cube.cml +++ b/lib/iris/tests/results/cdm/masked_cube.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/concatenate/concat_2y2d.cml b/lib/iris/tests/results/concatenate/concat_2y2d.cml index 533cadc621..9c11ea11ba 100644 --- a/lib/iris/tests/results/concatenate/concat_2y2d.cml +++ b/lib/iris/tests/results/concatenate/concat_2y2d.cml @@ -1,6 +1,6 @@ - + - + - + @@ -51,7 +51,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -154,7 +154,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/all_ml_10_22_load_match.cml b/lib/iris/tests/results/constrained_load/all_ml_10_22_load_match.cml index 73eeb4dc7f..c2803db131 100644 --- a/lib/iris/tests/results/constrained_load/all_ml_10_22_load_match.cml +++ b/lib/iris/tests/results/constrained_load/all_ml_10_22_load_match.cml @@ -1,6 +1,6 @@ - + @@ -53,7 +53,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -160,7 +160,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/attribute_constraint.cml b/lib/iris/tests/results/constrained_load/attribute_constraint.cml index 9736c2ac22..f81d8ee0d2 100644 --- a/lib/iris/tests/results/constrained_load/attribute_constraint.cml +++ b/lib/iris/tests/results/constrained_load/attribute_constraint.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_match.cml b/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_match.cml index 83e82d5d06..6d1c955fbd 100644 --- a/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_match.cml @@ -1,6 +1,6 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_strict.cml index 83e82d5d06..6d1c955fbd 100644 --- a/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_10_and_theta_level_gt_30_le_3_load_strict.cml @@ -1,6 +1,6 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_10_load_match.cml b/lib/iris/tests/results/constrained_load/theta_10_load_match.cml index a7574c485d..6b6db0b26f 100644 --- a/lib/iris/tests/results/constrained_load/theta_10_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_10_load_match.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_10_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_10_load_strict.cml index a7574c485d..6b6db0b26f 100644 --- a/lib/iris/tests/results/constrained_load/theta_10_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_10_load_strict.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_and_all_10_load_match.cml b/lib/iris/tests/results/constrained_load/theta_and_all_10_load_match.cml index 2d3c5be943..e919278bdb 100644 --- a/lib/iris/tests/results/constrained_load/theta_and_all_10_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_and_all_10_load_match.cml @@ -1,6 +1,6 @@ - + @@ -140,7 +140,7 @@ - + @@ -191,7 +191,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -294,7 +294,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_and_theta_10_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_and_theta_10_load_strict.cml index 80f4ed9f5b..081aebcd27 100644 --- a/lib/iris/tests/results/constrained_load/theta_and_theta_10_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_and_theta_10_load_strict.cml @@ -1,6 +1,6 @@ - + @@ -140,7 +140,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_and_theta_load_match.cml b/lib/iris/tests/results/constrained_load/theta_and_theta_load_match.cml index f1c5f05f0a..04a3467b75 100644 --- a/lib/iris/tests/results/constrained_load/theta_and_theta_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_and_theta_load_match.cml @@ -1,6 +1,6 @@ - + @@ -140,7 +140,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_and_theta_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_and_theta_load_strict.cml index f1c5f05f0a..04a3467b75 100644 --- a/lib/iris/tests/results/constrained_load/theta_and_theta_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_and_theta_load_strict.cml @@ -1,6 +1,6 @@ - + @@ -140,7 +140,7 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_match.cml b/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_match.cml index 03642e12d1..ea9ea1d3a3 100644 --- a/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_match.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_strict.cml index 03642e12d1..ea9ea1d3a3 100644 --- a/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_gt_30_le_3_load_strict.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_lat_30_load_match.cml b/lib/iris/tests/results/constrained_load/theta_lat_30_load_match.cml index cfe94f04a6..3e37596f71 100644 --- a/lib/iris/tests/results/constrained_load/theta_lat_30_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_lat_30_load_match.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_lat_30_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_lat_30_load_strict.cml index cfe94f04a6..3e37596f71 100644 --- a/lib/iris/tests/results/constrained_load/theta_lat_30_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_lat_30_load_strict.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_match.cml b/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_match.cml index 97a518f433..42fda871e2 100644 --- a/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_match.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_strict.cml index 97a518f433..42fda871e2 100644 --- a/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_lat_gt_30_load_strict.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_load_match.cml b/lib/iris/tests/results/constrained_load/theta_load_match.cml index f80d9e072a..f976e656f9 100644 --- a/lib/iris/tests/results/constrained_load/theta_load_match.cml +++ b/lib/iris/tests/results/constrained_load/theta_load_match.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/constrained_load/theta_load_strict.cml b/lib/iris/tests/results/constrained_load/theta_load_strict.cml index f80d9e072a..f976e656f9 100644 --- a/lib/iris/tests/results/constrained_load/theta_load_strict.cml +++ b/lib/iris/tests/results/constrained_load/theta_load_strict.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_io/pickling/cubelist.cml b/lib/iris/tests/results/cube_io/pickling/cubelist.cml index c2b7f60194..f53bacfb6f 100644 --- a/lib/iris/tests/results/cube_io/pickling/cubelist.cml +++ b/lib/iris/tests/results/cube_io/pickling/cubelist.cml @@ -1,6 +1,6 @@ - + @@ -516,7 +516,7 @@ - + diff --git a/lib/iris/tests/results/cube_io/pickling/single_cube.cml b/lib/iris/tests/results/cube_io/pickling/single_cube.cml index d793a391f6..3df9dd7602 100644 --- a/lib/iris/tests/results/cube_io/pickling/single_cube.cml +++ b/lib/iris/tests/results/cube_io/pickling/single_cube.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_io/pickling/theta.cml b/lib/iris/tests/results/cube_io/pickling/theta.cml index c3d1825cd2..a85fccd62e 100644 --- a/lib/iris/tests/results/cube_io/pickling/theta.cml +++ b/lib/iris/tests/results/cube_io/pickling/theta.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_io/pp/load/global.cml b/lib/iris/tests/results/cube_io/pp/load/global.cml index 2779549286..ad7063d025 100644 --- a/lib/iris/tests/results/cube_io/pp/load/global.cml +++ b/lib/iris/tests/results/cube_io/pp/load/global.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing1.cml b/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing1.cml index 8693d1222d..30beb4ef20 100644 --- a/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing1.cml +++ b/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing1.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing2.cml b/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing2.cml index 1e01200db9..2655740cf8 100644 --- a/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing2.cml +++ b/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing2.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing3.cml b/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing3.cml index 439d183b19..e113bf4ac9 100644 --- a/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing3.cml +++ b/lib/iris/tests/results/cube_slice/real_data_dual_tuple_indexing3.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/cube_slice/real_empty_data_indexing.cml b/lib/iris/tests/results/cube_slice/real_empty_data_indexing.cml index e61668baa3..74be87f6a5 100644 --- a/lib/iris/tests/results/cube_slice/real_empty_data_indexing.cml +++ b/lib/iris/tests/results/cube_slice/real_empty_data_indexing.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple.cml b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple.cml index 5cb0de933c..9d985a7ae8 100644 --- a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple.cml +++ b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple_callback.cml b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple_callback.cml index 62126aa03b..daf98f9dbd 100644 --- a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple_callback.cml +++ b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadFF/simple_callback.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple.cml b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple.cml index cc062c176a..1ff0282592 100644 --- a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple.cml +++ b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple_callback.cml b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple_callback.cml index 9c955e24d7..4f2ad1aca3 100644 --- a/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple_callback.cml +++ b/lib/iris/tests/results/experimental/fieldsfile/TestStructuredLoadPP/simple_callback.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/file_load/theta_levels.cml b/lib/iris/tests/results/file_load/theta_levels.cml index abd5f6ce84..ac4d7f04c1 100644 --- a/lib/iris/tests/results/file_load/theta_levels.cml +++ b/lib/iris/tests/results/file_load/theta_levels.cml @@ -1,6 +1,6 @@ - + @@ -51,7 +51,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -306,7 +306,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -408,7 +408,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -510,7 +510,7 @@ - + @@ -561,7 +561,7 @@ - + @@ -612,7 +612,7 @@ - + @@ -663,7 +663,7 @@ - + @@ -714,7 +714,7 @@ - + @@ -765,7 +765,7 @@ - + @@ -816,7 +816,7 @@ - + @@ -867,7 +867,7 @@ - + @@ -918,7 +918,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1020,7 +1020,7 @@ - + @@ -1071,7 +1071,7 @@ - + @@ -1122,7 +1122,7 @@ - + @@ -1173,7 +1173,7 @@ - + @@ -1224,7 +1224,7 @@ - + @@ -1275,7 +1275,7 @@ - + @@ -1326,7 +1326,7 @@ - + @@ -1377,7 +1377,7 @@ - + @@ -1428,7 +1428,7 @@ - + @@ -1479,7 +1479,7 @@ - + @@ -1530,7 +1530,7 @@ - + @@ -1581,7 +1581,7 @@ - + @@ -1632,7 +1632,7 @@ - + @@ -1683,7 +1683,7 @@ - + @@ -1734,7 +1734,7 @@ - + @@ -1785,7 +1785,7 @@ - + @@ -1836,7 +1836,7 @@ - + @@ -1887,7 +1887,7 @@ - + diff --git a/lib/iris/tests/results/file_load/u_wind_levels.cml b/lib/iris/tests/results/file_load/u_wind_levels.cml index c0b5a76a34..763b56186d 100644 --- a/lib/iris/tests/results/file_load/u_wind_levels.cml +++ b/lib/iris/tests/results/file_load/u_wind_levels.cml @@ -1,6 +1,6 @@ - + @@ -52,7 +52,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -312,7 +312,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -416,7 +416,7 @@ - + @@ -468,7 +468,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -624,7 +624,7 @@ - + @@ -676,7 +676,7 @@ - + @@ -728,7 +728,7 @@ - + @@ -780,7 +780,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -884,7 +884,7 @@ - + @@ -936,7 +936,7 @@ - + @@ -988,7 +988,7 @@ - + @@ -1040,7 +1040,7 @@ - + @@ -1092,7 +1092,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1196,7 +1196,7 @@ - + @@ -1248,7 +1248,7 @@ - + @@ -1300,7 +1300,7 @@ - + @@ -1352,7 +1352,7 @@ - + @@ -1404,7 +1404,7 @@ - + @@ -1456,7 +1456,7 @@ - + @@ -1508,7 +1508,7 @@ - + @@ -1560,7 +1560,7 @@ - + @@ -1612,7 +1612,7 @@ - + @@ -1664,7 +1664,7 @@ - + @@ -1716,7 +1716,7 @@ - + @@ -1768,7 +1768,7 @@ - + @@ -1820,7 +1820,7 @@ - + @@ -1872,7 +1872,7 @@ - + @@ -1924,7 +1924,7 @@ - + diff --git a/lib/iris/tests/results/file_load/v_wind_levels.cml b/lib/iris/tests/results/file_load/v_wind_levels.cml index f8fe971f90..e4e3709a13 100644 --- a/lib/iris/tests/results/file_load/v_wind_levels.cml +++ b/lib/iris/tests/results/file_load/v_wind_levels.cml @@ -1,6 +1,6 @@ - + @@ -52,7 +52,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -312,7 +312,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -416,7 +416,7 @@ - + @@ -468,7 +468,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -624,7 +624,7 @@ - + @@ -676,7 +676,7 @@ - + @@ -728,7 +728,7 @@ - + @@ -780,7 +780,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -884,7 +884,7 @@ - + @@ -936,7 +936,7 @@ - + @@ -988,7 +988,7 @@ - + @@ -1040,7 +1040,7 @@ - + @@ -1092,7 +1092,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1196,7 +1196,7 @@ - + @@ -1248,7 +1248,7 @@ - + @@ -1300,7 +1300,7 @@ - + @@ -1352,7 +1352,7 @@ - + @@ -1404,7 +1404,7 @@ - + @@ -1456,7 +1456,7 @@ - + @@ -1508,7 +1508,7 @@ - + @@ -1560,7 +1560,7 @@ - + @@ -1612,7 +1612,7 @@ - + @@ -1664,7 +1664,7 @@ - + @@ -1716,7 +1716,7 @@ - + @@ -1768,7 +1768,7 @@ - + @@ -1820,7 +1820,7 @@ - + @@ -1872,7 +1872,7 @@ - + @@ -1924,7 +1924,7 @@ - + diff --git a/lib/iris/tests/results/file_load/wind_levels.cml b/lib/iris/tests/results/file_load/wind_levels.cml index 8fba633749..3c4bf37ae8 100644 --- a/lib/iris/tests/results/file_load/wind_levels.cml +++ b/lib/iris/tests/results/file_load/wind_levels.cml @@ -1,6 +1,6 @@ - + @@ -52,7 +52,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -312,7 +312,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -416,7 +416,7 @@ - + @@ -468,7 +468,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -624,7 +624,7 @@ - + @@ -676,7 +676,7 @@ - + @@ -728,7 +728,7 @@ - + @@ -780,7 +780,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -884,7 +884,7 @@ - + @@ -936,7 +936,7 @@ - + @@ -988,7 +988,7 @@ - + @@ -1040,7 +1040,7 @@ - + @@ -1092,7 +1092,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1196,7 +1196,7 @@ - + @@ -1248,7 +1248,7 @@ - + @@ -1300,7 +1300,7 @@ - + @@ -1352,7 +1352,7 @@ - + @@ -1404,7 +1404,7 @@ - + @@ -1456,7 +1456,7 @@ - + @@ -1508,7 +1508,7 @@ - + @@ -1560,7 +1560,7 @@ - + @@ -1612,7 +1612,7 @@ - + @@ -1664,7 +1664,7 @@ - + @@ -1716,7 +1716,7 @@ - + @@ -1768,7 +1768,7 @@ - + @@ -1820,7 +1820,7 @@ - + @@ -1872,7 +1872,7 @@ - + @@ -1924,7 +1924,7 @@ - + @@ -1976,7 +1976,7 @@ - + @@ -2028,7 +2028,7 @@ - + @@ -2080,7 +2080,7 @@ - + @@ -2132,7 +2132,7 @@ - + @@ -2184,7 +2184,7 @@ - + @@ -2236,7 +2236,7 @@ - + @@ -2288,7 +2288,7 @@ - + @@ -2340,7 +2340,7 @@ - + @@ -2392,7 +2392,7 @@ - + @@ -2444,7 +2444,7 @@ - + @@ -2496,7 +2496,7 @@ - + @@ -2548,7 +2548,7 @@ - + @@ -2600,7 +2600,7 @@ - + @@ -2652,7 +2652,7 @@ - + @@ -2704,7 +2704,7 @@ - + @@ -2756,7 +2756,7 @@ - + @@ -2808,7 +2808,7 @@ - + @@ -2860,7 +2860,7 @@ - + @@ -2912,7 +2912,7 @@ - + @@ -2964,7 +2964,7 @@ - + @@ -3016,7 +3016,7 @@ - + @@ -3068,7 +3068,7 @@ - + @@ -3120,7 +3120,7 @@ - + @@ -3172,7 +3172,7 @@ - + @@ -3224,7 +3224,7 @@ - + @@ -3276,7 +3276,7 @@ - + @@ -3328,7 +3328,7 @@ - + @@ -3380,7 +3380,7 @@ - + @@ -3432,7 +3432,7 @@ - + @@ -3484,7 +3484,7 @@ - + @@ -3536,7 +3536,7 @@ - + @@ -3588,7 +3588,7 @@ - + @@ -3640,7 +3640,7 @@ - + @@ -3692,7 +3692,7 @@ - + @@ -3744,7 +3744,7 @@ - + @@ -3796,7 +3796,7 @@ - + @@ -3848,7 +3848,7 @@ - + @@ -3900,7 +3900,7 @@ - + diff --git a/lib/iris/tests/results/merge/dec.cml b/lib/iris/tests/results/merge/dec.cml index 57e4a0eae0..f26ee2048c 100644 --- a/lib/iris/tests/results/merge/dec.cml +++ b/lib/iris/tests/results/merge/dec.cml @@ -1,6 +1,6 @@ - + @@ -140,7 +140,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -421,7 +421,7 @@ - + diff --git a/lib/iris/tests/results/merge/theta.cml b/lib/iris/tests/results/merge/theta.cml index f80d9e072a..f976e656f9 100644 --- a/lib/iris/tests/results/merge/theta.cml +++ b/lib/iris/tests/results/merge/theta.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/merge/theta_two_times.cml b/lib/iris/tests/results/merge/theta_two_times.cml index bed9f06208..6b99b63d8b 100644 --- a/lib/iris/tests/results/merge/theta_two_times.cml +++ b/lib/iris/tests/results/merge/theta_two_times.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_cell_methods.cml b/lib/iris/tests/results/netcdf/netcdf_cell_methods.cml index c50b6915e6..5a5b010d7b 100644 --- a/lib/iris/tests/results/netcdf/netcdf_cell_methods.cml +++ b/lib/iris/tests/results/netcdf/netcdf_cell_methods.cml @@ -1,6 +1,6 @@ - + @@ -20,7 +20,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -190,7 +190,7 @@ - + @@ -213,7 +213,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -295,7 +295,7 @@ - + @@ -320,7 +320,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -359,7 +359,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -385,7 +385,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -424,7 +424,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -460,7 +460,7 @@ - + @@ -473,7 +473,7 @@ - + @@ -486,7 +486,7 @@ - + @@ -499,7 +499,7 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_deferred_index_0.cml b/lib/iris/tests/results/netcdf/netcdf_deferred_index_0.cml index 9e03a24a45..b168b70cc9 100644 --- a/lib/iris/tests/results/netcdf/netcdf_deferred_index_0.cml +++ b/lib/iris/tests/results/netcdf/netcdf_deferred_index_0.cml @@ -1,6 +1,6 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/lib/iris/tests/results/netcdf/netcdf_global_xyt_total.cml b/lib/iris/tests/results/netcdf/netcdf_global_xyt_total.cml index 0d685802ca..a88e7bb3b9 100644 --- a/lib/iris/tests/results/netcdf/netcdf_global_xyt_total.cml +++ b/lib/iris/tests/results/netcdf/netcdf_global_xyt_total.cml @@ -1,6 +1,6 @@ - + - + @@ -26,7 +26,7 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_0.cml b/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_0.cml index 8a61b31886..1bacbc75a9 100644 --- a/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_0.cml +++ b/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_1.cml b/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_1.cml index cb0ce6d5fd..35d3220cb9 100644 --- a/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_1.cml +++ b/lib/iris/tests/results/netcdf/netcdf_global_xyzt_gems_iter_1.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_lcc.cml b/lib/iris/tests/results/netcdf/netcdf_lcc.cml index 9bdf866815..3916f15cc1 100644 --- a/lib/iris/tests/results/netcdf/netcdf_lcc.cml +++ b/lib/iris/tests/results/netcdf/netcdf_lcc.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_rotated_xy_land.cml b/lib/iris/tests/results/netcdf/netcdf_rotated_xy_land.cml index bde933568b..a9fdb2ffca 100644 --- a/lib/iris/tests/results/netcdf/netcdf_rotated_xy_land.cml +++ b/lib/iris/tests/results/netcdf/netcdf_rotated_xy_land.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_rotated_xyt_precipitation.cml b/lib/iris/tests/results/netcdf/netcdf_rotated_xyt_precipitation.cml index 3347b542c8..a5584ceb8d 100644 --- a/lib/iris/tests/results/netcdf/netcdf_rotated_xyt_precipitation.cml +++ b/lib/iris/tests/results/netcdf/netcdf_rotated_xyt_precipitation.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_save_load_hybrid_height.cml b/lib/iris/tests/results/netcdf/netcdf_save_load_hybrid_height.cml index 2230369b19..8f207b126b 100644 --- a/lib/iris/tests/results/netcdf/netcdf_save_load_hybrid_height.cml +++ b/lib/iris/tests/results/netcdf/netcdf_save_load_hybrid_height.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_save_load_ndim_auxiliary.cml b/lib/iris/tests/results/netcdf/netcdf_save_load_ndim_auxiliary.cml index 1347f87884..4f92fd1466 100644 --- a/lib/iris/tests/results/netcdf/netcdf_save_load_ndim_auxiliary.cml +++ b/lib/iris/tests/results/netcdf/netcdf_save_load_ndim_auxiliary.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_stereo.cml b/lib/iris/tests/results/netcdf/netcdf_stereo.cml index 3a79250bf2..19750b255f 100644 --- a/lib/iris/tests/results/netcdf/netcdf_stereo.cml +++ b/lib/iris/tests/results/netcdf/netcdf_stereo.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/netcdf/netcdf_tmerc_and_climatology.cml b/lib/iris/tests/results/netcdf/netcdf_tmerc_and_climatology.cml index ccfdbf6a90..2850984e75 100644 --- a/lib/iris/tests/results/netcdf/netcdf_tmerc_and_climatology.cml +++ b/lib/iris/tests/results/netcdf/netcdf_tmerc_and_climatology.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/pp_rules/global.cml b/lib/iris/tests/results/pp_rules/global.cml index 2779549286..ad7063d025 100644 --- a/lib/iris/tests/results/pp_rules/global.cml +++ b/lib/iris/tests/results/pp_rules/global.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/pp_rules/lbproc_mean_max_min.cml b/lib/iris/tests/results/pp_rules/lbproc_mean_max_min.cml index 1d8f73a624..00dc804914 100644 --- a/lib/iris/tests/results/pp_rules/lbproc_mean_max_min.cml +++ b/lib/iris/tests/results/pp_rules/lbproc_mean_max_min.cml @@ -1,6 +1,6 @@ - + @@ -37,7 +37,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -160,7 +160,7 @@ - + diff --git a/lib/iris/tests/results/pp_rules/lbtim_2.cml b/lib/iris/tests/results/pp_rules/lbtim_2.cml index 8ff9abfd72..868ce81e7d 100644 --- a/lib/iris/tests/results/pp_rules/lbtim_2.cml +++ b/lib/iris/tests/results/pp_rules/lbtim_2.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/pp_rules/ocean_depth.cml b/lib/iris/tests/results/pp_rules/ocean_depth.cml index 7e71f6f20e..7cbafa6cd4 100644 --- a/lib/iris/tests/results/pp_rules/ocean_depth.cml +++ b/lib/iris/tests/results/pp_rules/ocean_depth.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/pp_rules/ocean_depth_bounded.cml b/lib/iris/tests/results/pp_rules/ocean_depth_bounded.cml index f237523131..3aee7ff671 100644 --- a/lib/iris/tests/results/pp_rules/ocean_depth_bounded.cml +++ b/lib/iris/tests/results/pp_rules/ocean_depth_bounded.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/pp_rules/rotated_uk.cml b/lib/iris/tests/results/pp_rules/rotated_uk.cml index e4cbe096da..5ad678c9b9 100644 --- a/lib/iris/tests/results/pp_rules/rotated_uk.cml +++ b/lib/iris/tests/results/pp_rules/rotated_uk.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/airpress_on_theta_0d.cml b/lib/iris/tests/results/regrid/airpress_on_theta_0d.cml index c7385cb73d..8b52a0eb80 100644 --- a/lib/iris/tests/results/regrid/airpress_on_theta_0d.cml +++ b/lib/iris/tests/results/regrid/airpress_on_theta_0d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/airpress_on_theta_1d.cml b/lib/iris/tests/results/regrid/airpress_on_theta_1d.cml index 5578685dba..4f91acd589 100644 --- a/lib/iris/tests/results/regrid/airpress_on_theta_1d.cml +++ b/lib/iris/tests/results/regrid/airpress_on_theta_1d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/airpress_on_theta_2d.cml b/lib/iris/tests/results/regrid/airpress_on_theta_2d.cml index fac981fc3a..d73d0c4430 100644 --- a/lib/iris/tests/results/regrid/airpress_on_theta_2d.cml +++ b/lib/iris/tests/results/regrid/airpress_on_theta_2d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/airpress_on_theta_3d.cml b/lib/iris/tests/results/regrid/airpress_on_theta_3d.cml index b282aade93..d8dc722cec 100644 --- a/lib/iris/tests/results/regrid/airpress_on_theta_3d.cml +++ b/lib/iris/tests/results/regrid/airpress_on_theta_3d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/theta_on_airpress_0d.cml b/lib/iris/tests/results/regrid/theta_on_airpress_0d.cml index 14bb6c0b45..380dc48af7 100644 --- a/lib/iris/tests/results/regrid/theta_on_airpress_0d.cml +++ b/lib/iris/tests/results/regrid/theta_on_airpress_0d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/theta_on_airpress_1d.cml b/lib/iris/tests/results/regrid/theta_on_airpress_1d.cml index 6927fcfc0b..c1357d7b0a 100644 --- a/lib/iris/tests/results/regrid/theta_on_airpress_1d.cml +++ b/lib/iris/tests/results/regrid/theta_on_airpress_1d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/theta_on_airpress_2d.cml b/lib/iris/tests/results/regrid/theta_on_airpress_2d.cml index 213c07a6e8..cf04c386e7 100644 --- a/lib/iris/tests/results/regrid/theta_on_airpress_2d.cml +++ b/lib/iris/tests/results/regrid/theta_on_airpress_2d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/regrid/theta_on_airpress_3d.cml b/lib/iris/tests/results/regrid/theta_on_airpress_3d.cml index ce4db59a32..65d19cf14e 100644 --- a/lib/iris/tests/results/regrid/theta_on_airpress_3d.cml +++ b/lib/iris/tests/results/regrid/theta_on_airpress_3d.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/system/supported_filetype_.pp.cml b/lib/iris/tests/results/system/supported_filetype_.pp.cml index ff3192275a..80bd5e704b 100644 --- a/lib/iris/tests/results/system/supported_filetype_.pp.cml +++ b/lib/iris/tests/results/system/supported_filetype_.pp.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/trajectory/constant_latitude.cml b/lib/iris/tests/results/trajectory/constant_latitude.cml index 22f31e282e..b3bb8a4257 100644 --- a/lib/iris/tests/results/trajectory/constant_latitude.cml +++ b/lib/iris/tests/results/trajectory/constant_latitude.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/trajectory/single_point.cml b/lib/iris/tests/results/trajectory/single_point.cml index 92f333d984..7b2b3293d5 100644 --- a/lib/iris/tests/results/trajectory/single_point.cml +++ b/lib/iris/tests/results/trajectory/single_point.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml b/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml index 667cc75881..cf5d676534 100644 --- a/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml +++ b/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/trajectory/zigzag.cml b/lib/iris/tests/results/trajectory/zigzag.cml index 00a2b214ec..46fb640969 100644 --- a/lib/iris/tests/results/trajectory/zigzag.cml +++ b/lib/iris/tests/results/trajectory/zigzag.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/uri_callback/pp_global.cml b/lib/iris/tests/results/uri_callback/pp_global.cml index ce1867b078..90a3efe009 100644 --- a/lib/iris/tests/results/uri_callback/pp_global.cml +++ b/lib/iris/tests/results/uri_callback/pp_global.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/001000000000.00.000.000000.1860.01.01.00.00.f.b_0.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/001000000000.00.000.000000.1860.01.01.00.00.f.b_0.cml index 3bbce1c88a..602a4c2563 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/001000000000.00.000.000000.1860.01.01.00.00.f.b_0.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/001000000000.00.000.000000.1860.01.01.00.00.f.b_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/002000000000.44.101.131200.1920.09.01.00.00.b_0.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/002000000000.44.101.131200.1920.09.01.00.00.b_0.cml index 7d36670817..8dbbc28f0a 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/002000000000.44.101.131200.1920.09.01.00.00.b_0.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/002000000000.44.101.131200.1920.09.01.00.00.b_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/ocean_xsect.b_0.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/ocean_xsect.b_0.cml index 2cb6add07f..320fb0f500 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/ocean_xsect.b_0.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/ocean_xsect.b_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc699.b_0.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc699.b_0.cml index 0188278080..693ad593c8 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc699.b_0.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc699.b_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc942.b_0.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc942.b_0.cml index 2737aef8a8..82d8bfe47c 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc942.b_0.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st0fc942.b_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st30211.b_0.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st30211.b_0.cml index 9d5a2963e1..ea42daee37 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st30211.b_0.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_netcdf/st30211.b_0.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.000128.1990.12.01.00.00.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.000128.1990.12.01.00.00.b.cml index 7c7fd73071..d86da5d7f0 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.000128.1990.12.01.00.00.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.000128.1990.12.01.00.00.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.004224.1990.12.01.00.00.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.004224.1990.12.01.00.00.b.cml index 3e1c4e410d..9721c1c337 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.004224.1990.12.01.00.00.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.004224.1990.12.01.00.00.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.008320.1990.12.01.00.00.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.008320.1990.12.01.00.00.b.cml index 0add047cb5..9b8099f0d3 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.008320.1990.12.01.00.00.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.03.236.008320.1990.12.01.00.00.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.16.202.000128.1860.09.01.00.00.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.16.202.000128.1860.09.01.00.00.b.cml index 00228b6062..9996a29982 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.16.202.000128.1860.09.01.00.00.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/000003000000.16.202.000128.1860.09.01.00.00.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/001000000000.00.000.000000.1860.01.01.00.00.f.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/001000000000.00.000.000000.1860.01.01.00.00.f.b.cml index 3eb9c511fc..19036efc41 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/001000000000.00.000.000000.1860.01.01.00.00.f.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/001000000000.00.000.000000.1860.01.01.00.00.f.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/002000000000.44.101.131200.1920.09.01.00.00.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/002000000000.44.101.131200.1920.09.01.00.00.b.cml index a7c05c68d4..423aed112d 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/002000000000.44.101.131200.1920.09.01.00.00.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/002000000000.44.101.131200.1920.09.01.00.00.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/008000000000.44.101.000128.1890.09.01.00.00.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/008000000000.44.101.000128.1890.09.01.00.00.b.cml index 172795a587..02cc81bf6b 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/008000000000.44.101.000128.1890.09.01.00.00.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/008000000000.44.101.000128.1890.09.01.00.00.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/12187.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/12187.b.cml index abe280a915..e1be4ef2c0 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/12187.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/12187.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/HadCM2_ts_SAT_ann_18602100.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/HadCM2_ts_SAT_ann_18602100.b.cml index 41c1b7581c..ec16f05cf0 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/HadCM2_ts_SAT_ann_18602100.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/HadCM2_ts_SAT_ann_18602100.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_level_lat_orig.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_level_lat_orig.b.cml index 65dda30cc7..d1e1bef60e 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_level_lat_orig.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_level_lat_orig.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_press_orig.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_press_orig.b.cml index 8b73a8db3a..182f9c96ff 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_press_orig.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_press_orig.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_several.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_several.b.cml index 9ee5e5d275..1553ac9f23 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_several.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_lon_lat_several.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_n10r13xy.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_n10r13xy.b.cml index b24f67bb2f..03dc8a7659 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_n10r13xy.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_n10r13xy.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_time_press.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_time_press.b.cml index 64efb9da32..95177cd0b4 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_time_press.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_time_press.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_tseries.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_tseries.b.cml index 6bfad0dad3..77025cc627 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_tseries.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/aaxzc_tseries.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abcza_pa19591997_daily_29.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abcza_pa19591997_daily_29.b.cml index 6f9491951c..d67206b642 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abcza_pa19591997_daily_29.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abcza_pa19591997_daily_29.b.cml @@ -1,6 +1,6 @@ - + @@ -63,7 +63,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abxpa_press_lat.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abxpa_press_lat.b.cml index 6fb4c3fe64..227eca3abd 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abxpa_press_lat.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/abxpa_press_lat.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/model.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/model.b.cml index 9ba807ca0c..0a0c72caea 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/model.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/model.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/ocean_xsect.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/ocean_xsect.b.cml index 5ec956458e..c22fc8c248 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/ocean_xsect.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/ocean_xsect.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc699.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc699.b.cml index 974426afc9..338e5c69bd 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc699.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc699.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc942.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc942.b.cml index cd2cf478dc..7c73cfbe87 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc942.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st0fc942.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st30211.b.cml b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st30211.b.cml index 230f890423..e0547febdd 100644 --- a/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st30211.b.cml +++ b/lib/iris/tests/results/usecases/pp_to_cf_conversion/from_pp/st30211.b.cml @@ -1,6 +1,6 @@ - + diff --git a/lib/iris/tests/test_analysis.py b/lib/iris/tests/test_analysis.py index 0ffd7e18ab..091670972b 100644 --- a/lib/iris/tests/test_analysis.py +++ b/lib/iris/tests/test_analysis.py @@ -129,13 +129,13 @@ def test_weighted_mean_little(self): # to catch cases where there is a loss of precision however. if a.dtype > np.float32: cast_data = a.data.astype(np.float32) - a.replace(cast_data, fill_value=a.fill_value) + a.data = cast_data self.assertCMLApproxData(a, ('analysis', 'weighted_mean_lat.cml')) b = cube.collapsed(lon_coord, iris.analysis.MEAN, weights=weights) if b.dtype > np.float32: cast_data = b.data.astype(np.float32) - b.replace(cast_data, fill_value=b.fill_value) + b.data = cast_data b.data = np.asarray(b.data) self.assertCMLApproxData(b, ('analysis', 'weighted_mean_lon.cml')) self.assertEqual(b.coord('dummy').shape, (1, )) @@ -144,7 +144,7 @@ def test_weighted_mean_little(self): c = cube.collapsed([lat_coord[:], lon_coord], iris.analysis.MEAN, weights=weights) if c.dtype > np.float32: cast_data = c.data.astype(np.float32) - c.replace(cast_data, fill_value=c.fill_value) + c.data = cast_data self.assertCMLApproxData(c, ('analysis', 'weighted_mean_latlon.cml')) self.assertEqual(c.coord('dummy').shape, (1, )) @@ -205,12 +205,10 @@ def setUp(self): file = tests.get_data_path(('PP', 'aPProt1', 'rotatedMHtimecube.pp')) cubes = iris.load(file) self.cube = cubes[0] - self.cube_fill_val = self.cube.fill_value self.assertCML(self.cube, ('analysis', 'original.cml')) def _common(self, name, aggregate, original_name='original_common.cml', *args, **kwargs): self.cube.data = self.cube.data.astype(np.float64) - self.cube.fill_value = self.cube_fill_val self.assertCML(self.cube, ('analysis', original_name)) @@ -236,7 +234,6 @@ def test_std_dev(self): def test_hmean(self): # harmonic mean requires data > 0 self.cube.data *= self.cube.data - self.cube.fill_value = self.cube_fill_val self._common('hmean', iris.analysis.HMEAN, 'original_hmean.cml', rtol=1e-05) def test_gmean(self): diff --git a/lib/iris/tests/test_basic_maths.py b/lib/iris/tests/test_basic_maths.py index 9d9dc195d4..ca15dea4b1 100644 --- a/lib/iris/tests/test_basic_maths.py +++ b/lib/iris/tests/test_basic_maths.py @@ -39,8 +39,7 @@ class TestBasicMaths(tests.IrisTest): def setUp(self): self.cube = iris.tests.stock.global_pp() - self.cube.replace(self.cube.data - 260, - fill_value=self.cube.fill_value) + self.cube.data = self.cube.data - 260 def test_abs(self): a = self.cube @@ -361,11 +360,7 @@ def test_type_error(self): class TestDivideAndMultiply(tests.IrisTest): def setUp(self): self.cube = iris.tests.stock.global_pp() - # We require to preserve the cube fill_value - # across the cube data setter operation. - fill_value = self.cube.fill_value self.cube.data = self.cube.data - 260 - self.cube.fill_value = fill_value def test_divide(self): a = self.cube @@ -499,17 +494,11 @@ def test_multiplication_not_in_place(self): class TestExponentiate(tests.IrisTest): def setUp(self): self.cube = iris.tests.stock.global_pp() - # We require to preserve the cube fill_value - # across the cube data setter operation. - self.fill_value = self.cube.fill_value self.cube.data = self.cube.data - 260 - self.cube.fill_value = self.fill_value def test_exponentiate(self): a = self.cube a.data = a.data.astype(np.float64) - # We require to preserve the cube fill_value after setting the data. - a.fill_value = self.fill_value e = pow(a, 4) self.assertCMLApproxData(e, ('analysis', 'exponentiate.cml')) @@ -517,8 +506,6 @@ def test_square_root(self): # Make sure we have something which we can take the root of. a = self.cube a.data = abs(a.data) - # We require to preserve the cube fill_value after setting the data. - a.fill_value = self.fill_value a.units **= 2 e = a ** 0.5 diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 1e03bdfbf4..9e12c91f08 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -1030,13 +1030,13 @@ def collapse_test_common(self, cube, a_name, b_name, *args, **kwargs): # want to catch cases where there is a loss of precision however. if dual_stage.dtype > cube.dtype: data = dual_stage.data.astype(cube.dtype) - dual_stage.replace(data, fill_value=dual_stage.fill_value) + dual_stage.data = data self.assertCMLApproxData(dual_stage, ('cube_collapsed', '%s_%s_dual_stage.cml' % (a_filename, b_filename)), *args, **kwargs) single_stage = cube.collapsed([a_name, b_name], iris.analysis.MEAN) if single_stage.dtype > cube.dtype: data = single_stage.data.astype(cube.dtype) - single_stage.replace(data, fill_value=single_stage.fill_value) + single_stage.data = data self.assertCMLApproxData(single_stage, ('cube_collapsed', '%s_%s_single_stage.cml' % (a_filename, b_filename)), *args, **kwargs) # Compare the cube bits that should match @@ -1199,7 +1199,6 @@ def test_save_and_merge(self): self.assertEqual(len(merged_cubes), 1, "expected a single merged cube") merged_cube = merged_cubes[0] self.assertEqual(merged_cube.dtype, dtype) - self.assertEqual(merged_cube.fill_value, fill_value) @tests.skip_data diff --git a/lib/iris/tests/test_concatenate.py b/lib/iris/tests/test_concatenate.py index ee03370509..c00360d887 100644 --- a/lib/iris/tests/test_concatenate.py +++ b/lib/iris/tests/test_concatenate.py @@ -94,7 +94,7 @@ def _make_cube(x, y, data, aux=None, offset=0, scalar=None, cube_data = np.empty(shape, dtype=dtype) cube_data[:] = data - cube = iris.cube.Cube(cube_data, fill_value=fill_value) + cube = iris.cube.Cube(cube_data) coord = DimCoord(y_range, long_name='y') coord.guess_bounds() cube.add_dim_coord(coord, 0) @@ -233,18 +233,12 @@ def concatenate(cubes, order=None): result = cubelist.concatenate() for cube in result: - # Setting the cube.data clears the cube.dtype and cube.fill_value. - # We want to maintain the fill_value for testing purposes, even - # though we have lost the lazy data in order to pin down the array - # data order to overcome testing on different architectures. - fill_value = cube.fill_value if ma.isMaskedArray(cube.data): data = np.array(cube.data.data, copy=True, order=order) mask = np.array(cube.data.mask, copy=True, order=order) cube.data = ma.array(data, mask=mask) else: cube.data = np.array(cube.data, copy=True, order=order) - cube.fill_value = fill_value return result @@ -347,7 +341,6 @@ def test_masked_and_unmasked__default_fill_value(self): cubes.append(_make_cube((2, 4), y, 2)) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertIsNone(result[0].fill_value) np_fill_value = ma.masked_array(0, dtype=result[0].dtype).fill_value self.assertEqual(result[0].data.fill_value, np_fill_value) @@ -359,7 +352,6 @@ def test_unmasked_and_masked__default_fill_value(self): cubes.append(cube) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertIsNone(result[0].fill_value) np_fill_value = ma.masked_array(0, dtype=result[0].dtype).fill_value self.assertEqual(result[0].data.fill_value, np_fill_value) @@ -374,7 +366,6 @@ def test_masked_and_unmasked__fill_value_equal(self): fill_value=fill_value)) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertEqual(result[0].fill_value, fill_value) self.assertEqual(result[0].data.fill_value, fill_value) def test_masked_and_unmasked_int16__fill_value_equal(self): @@ -389,7 +380,6 @@ def test_masked_and_unmasked_int16__fill_value_equal(self): fill_value=fill_value)) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertEqual(result[0].fill_value, fill_value) self.assertEqual(result[0].data.fill_value, fill_value) def test_unmasked_and_masked__default_fill_value_from_None(self): @@ -401,7 +391,6 @@ def test_unmasked_and_masked__default_fill_value_from_None(self): cubes.append(cube) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertIsNone(result[0].fill_value) np_fill_value = ma.masked_array(0, dtype=result[0].dtype).fill_value self.assertEqual(result[0].data.fill_value, np_fill_value) @@ -415,7 +404,6 @@ def test_unmasked_and_masked_int16__default_fill_value_from_diff(self): cubes.append(cube) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertIsNone(result[0].fill_value) np_fill_value = ma.masked_array(0, dtype=result[0].dtype).fill_value self.assertEqual(result[0].data.fill_value, np_fill_value) @@ -437,7 +425,6 @@ def test_masked_with_data_fill_value_difference_on_arrays(self): cubes.append(cube) result = concatenate(cubes) self.assertEqual(len(result), 1) - self.assertEqual(result[0].fill_value, fill_value) self.assertEqual(result[0].data.fill_value, fill_value) def test_concat_masked_2x2d__default_fill_value_from_None(self): @@ -456,7 +443,6 @@ def test_concat_masked_2x2d__default_fill_value_from_None(self): mask = np.array([[True, False, False, True], [False, True, True, False]], dtype=np.bool) self.assertArrayEqual(result[0].data.mask, mask) - self.assertIsNone(result[0].fill_value) np_fill_value = ma.masked_array(0, dtype=result[0].dtype).fill_value self.assertEqual(result[0].data.fill_value, np_fill_value) @@ -478,7 +464,6 @@ def test_concat_masked_2y2d__default_fill_value_from_diff(self): [False, True], [True, False]], dtype=np.bool) self.assertArrayEqual(result[0].data.mask, mask) - self.assertIsNone(result[0].fill_value) np_fill_value = ma.masked_array(0, dtype=result[0].dtype).fill_value self.assertEqual(result[0].data.fill_value, np_fill_value) @@ -504,7 +489,6 @@ def test_concat_masked_2y2d_int16(self): [False, True], [True, False]], dtype=np.bool) self.assertArrayEqual(result[0].data.mask, mask) - self.assertEqual(result[0].fill_value, fill_value) self.assertEqual(result[0].data.fill_value, fill_value) def test_concat_masked_2y2d_int16_with_concrete_and_lazy(self): @@ -518,7 +502,7 @@ def test_concat_masked_2y2d_int16_with_concrete_and_lazy(self): cubes.append(cube) mask = [(0, 1), (1, 0)] cube = _make_cube(x, (2, 4), 2, dtype=dtype, mask=mask) - cube.replace(cube.lazy_data(), dtype=dtype, fill_value=fill_value) + cube.data = cube.lazy_data() cubes.append(cube) result = concatenate(cubes) self.assertCML(result, ('concatenate', 'concat_masked_2y2d_int16.cml')) @@ -529,7 +513,6 @@ def test_concat_masked_2y2d_int16_with_concrete_and_lazy(self): [False, True], [True, False]], dtype=np.bool) self.assertArrayEqual(result[0].data.mask, mask) - self.assertEqual(result[0].fill_value, fill_value) self.assertEqual(result[0].data.fill_value, fill_value) def test_concat_masked_2y2d_int16_with_lazy_and_concrete(self): @@ -539,7 +522,7 @@ def test_concat_masked_2y2d_int16_with_lazy_and_concrete(self): fill_value = -37 mask = [(0, 1), (1, 0)] cube = _make_cube(x, (2, 4), 2, dtype=dtype, mask=mask) - cube.replace(cube.lazy_data(), dtype=dtype, fill_value=fill_value) + cube.data = cube.lazy_data() cubes.append(cube) mask = [(0, 1), (0, 1)] cube = _make_cube(x, (0, 2), 1, dtype=dtype, mask=mask, @@ -554,7 +537,6 @@ def test_concat_masked_2y2d_int16_with_lazy_and_concrete(self): [False, True], [True, False]], dtype=np.bool) self.assertArrayEqual(result[0].data.mask, mask) - self.assertEqual(result[0].fill_value, fill_value) self.assertEqual(result[0].data.fill_value, fill_value) def test_concat_2x2d__default_fill_value(self): @@ -566,7 +548,6 @@ def test_concat_2x2d__default_fill_value(self): self.assertCML(result, ('concatenate', 'concat_2x2d.cml')) self.assertEqual(len(result), 1) self.assertEqual(result[0].shape, (2, 6)) - self.assertIsNone(result[0].fill_value) def test_concat_2y2d__fill_value_equal(self): cubes = [] @@ -578,7 +559,6 @@ def test_concat_2y2d__fill_value_equal(self): self.assertCML(result, ('concatenate', 'concat_2y2d.cml')) self.assertEqual(len(result), 1) self.assertEqual(result[0].shape, (6, 2)) - self.assertEqual(result[0].fill_value, fill_value) def test_concat_2x2d_aux_x__default_fill_value_from_diff(self): cubes = [] @@ -589,7 +569,6 @@ def test_concat_2x2d_aux_x__default_fill_value_from_diff(self): self.assertCML(result, ('concatenate', 'concat_2x2d_aux_x.cml')) self.assertEqual(len(result), 1) self.assertEqual(result[0].shape, (2, 6)) - self.assertIsNone(result[0].fill_value) def test_concat_2y2d_aux_x__default_fill_value_from_diff(self): cubes = [] @@ -600,7 +579,6 @@ def test_concat_2y2d_aux_x__default_fill_value_from_diff(self): self.assertCML(result, ('concatenate', 'concat_2y2d_aux_x.cml')) self.assertEqual(len(result), 1) self.assertEqual(result[0].shape, (6, 2)) - self.assertIsNone(result[0].fill_value) def test_concat_2x2d_aux_y(self): cubes = [] @@ -767,7 +745,6 @@ def test_fill_value_invariant_to_order__same_non_None(self): fill_value=fill_value) for i in range(3)] for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).concatenate_cube() - self.assertEqual(result.fill_value, fill_value) self.assertEqual(result.data.fill_value, fill_value) def test_fill_value_invariant_to_order__all_None(self): @@ -776,7 +753,6 @@ def test_fill_value_invariant_to_order__all_None(self): fill_value=None) for i in range(3)] for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).concatenate_cube() - self.assertIsNone(result.fill_value) np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(result.data.fill_value, np_fill_value) @@ -788,7 +764,6 @@ def test_fill_value_invariant_to_order__different_non_None(self): cubes.append(_make_cube((6, 8), y, 3, mask=True, fill_value=4123)) for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).concatenate_cube() - self.assertIsNone(result.fill_value) np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(result.data.fill_value, np_fill_value) @@ -799,7 +774,6 @@ def test_fill_value_invariant_to_order__mixed(self): cubes.append(_make_cube((4, 6), y, 2, mask=True, fill_value=4321)) for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).concatenate_cube() - self.assertIsNone(result.fill_value) np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(result.data.fill_value, np_fill_value) diff --git a/lib/iris/tests/test_interpolation.py b/lib/iris/tests/test_interpolation.py index 9880c6add6..78862ab4b5 100644 --- a/lib/iris/tests/test_interpolation.py +++ b/lib/iris/tests/test_interpolation.py @@ -42,8 +42,7 @@ def normalise_order(cube): # function when the circular flag is true. # * scipy.interpolate.interp1d in 0.11.0 which is used in # `Linear1dExtrapolator`. - data = np.ascontiguousarray(cube.data) - cube.replace(data, fill_value=cube.fill_value) + cube.data = np.ascontiguousarray(cube.data) class TestLinearExtrapolator(tests.IrisTest): diff --git a/lib/iris/tests/test_merge.py b/lib/iris/tests/test_merge.py index 328f902ce2..7fc693bb06 100644 --- a/lib/iris/tests/test_merge.py +++ b/lib/iris/tests/test_merge.py @@ -136,7 +136,7 @@ def _make_cube(self, data, dtype=np.dtype('int32'), fill_value=None, y = np.arange(N) payload = self._make_data(data, dtype=dtype, fill_value=fill_value, mask=mask, lazy=lazy, N=N) - cube = iris.cube.Cube(payload, dtype=dtype, fill_value=fill_value) + cube = iris.cube.Cube(payload) lat = DimCoord(y, standard_name='latitude', units='degrees') cube.add_dim_coord(lat, 0) lon = DimCoord(x, standard_name='longitude', units='degrees') @@ -155,14 +155,12 @@ def _expected_fill_value(fill0, fill1): def _check_fill_value(self, result, fill0, fill1): expected_fill_value = self._expected_fill_value(fill0, fill1) if expected_fill_value is None: - self.assertIsNone(result.fill_value) data = result.data if ma.isMaskedArray(data): np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(data.fill_value, np_fill_value) else: - self.assertEqual(result.fill_value, expected_fill_value) data = result.data if ma.isMaskedArray(data): self.assertEqual(data.fill_value, expected_fill_value) @@ -251,7 +249,6 @@ def test_fill_value_invariant_to_order__same_non_None(self): fill_value=fill_value) for i in range(3)] for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).merge_cube() - self.assertEqual(result.fill_value, fill_value) self.assertEqual(result.data.fill_value, fill_value) def test_fill_value_invariant_to_order__all_None(self): @@ -259,7 +256,6 @@ def test_fill_value_invariant_to_order__all_None(self): fill_value=None) for i in range(3)] for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).merge_cube() - self.assertIsNone(result.fill_value) np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(result.data.fill_value, np_fill_value) @@ -270,7 +266,6 @@ def test_fill_value_invariant_to_order__different_non_None(self): cubes.append(self._make_cube(3, mask=True, fill_value=4123)) for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).merge_cube() - self.assertIsNone(result.fill_value) np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(result.data.fill_value, np_fill_value) @@ -280,7 +275,6 @@ def test_fill_value_invariant_to_order__mixed(self): cubes.append(self._make_cube(2, mask=True, fill_value=4321)) for combo in itertools.permutations(cubes): result = iris.cube.CubeList(combo).merge_cube() - self.assertIsNone(result.fill_value) np_fill_value = ma.masked_array(0, dtype=result.dtype).fill_value self.assertEqual(result.data.fill_value, np_fill_value) diff --git a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py index 9f968a9ed6..ca86e5cdd7 100644 --- a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py @@ -1263,7 +1263,7 @@ def test_circular_src__masked_missingmask(self): # instead of being an array. src = self.src src.coord('longitude').circular = True - src.replace(ma.MaskedArray(src.data), fill_value=src.fill_value) + src.data = ma.MaskedArray(src.data) self.assertEqual(src.data.mask, False) method_results = self._check_circular_results(src, 'missingmask') for method_result in method_results: diff --git a/lib/iris/tests/unit/analysis/test_MEAN.py b/lib/iris/tests/unit/analysis/test_MEAN.py index 6460137419..3d40e7eb5e 100644 --- a/lib/iris/tests/unit/analysis/test_MEAN.py +++ b/lib/iris/tests/unit/analysis/test_MEAN.py @@ -43,13 +43,13 @@ def setUp(self): def test_mdtol_default(self): agg = MEAN.lazy_aggregate(self.array, axis=self.axis) - masked_result = as_concrete_data(agg, nans_replacement=ma.masked) + masked_result = as_concrete_data(agg) self.assertMaskedArrayAlmostEqual(masked_result, self.expected_masked) def test_mdtol_below(self): agg = MEAN.lazy_aggregate(self.array, axis=self.axis, mdtol=0.3) - masked_result = as_concrete_data(agg, nans_replacement=ma.masked) + masked_result = as_concrete_data(agg) expected_masked = self.expected_masked expected_masked.mask = [False, True, True, True] self.assertMaskedArrayAlmostEqual(masked_result, @@ -57,7 +57,7 @@ def test_mdtol_below(self): def test_mdtol_above(self): agg = MEAN.lazy_aggregate(self.array, axis=self.axis, mdtol=0.4) - masked_result = as_concrete_data(agg, nans_replacement=ma.masked) + masked_result = as_concrete_data(agg) self.assertMaskedArrayAlmostEqual(masked_result, self.expected_masked) @@ -66,7 +66,7 @@ def test_multi_axis(self): collapse_axes = (0, 2) lazy_data = as_lazy_data(data) agg = MEAN.lazy_aggregate(lazy_data, axis=collapse_axes) - result = as_concrete_data(agg, nans_replacement=ma.masked) + result = as_concrete_data(agg) expected = np.mean(data, axis=collapse_axes) self.assertArrayAllClose(result, expected) diff --git a/lib/iris/tests/unit/analysis/test_STD_DEV.py b/lib/iris/tests/unit/analysis/test_STD_DEV.py index 3934a5a518..f745537def 100644 --- a/lib/iris/tests/unit/analysis/test_STD_DEV.py +++ b/lib/iris/tests/unit/analysis/test_STD_DEV.py @@ -37,7 +37,7 @@ def test_mdtol(self): [1., 2., na, na]]) array = as_lazy_data(array) var = STD_DEV.lazy_aggregate(array, axis=1, mdtol=0.3) - masked_result = as_concrete_data(var, nans_replacement=np.ma.masked) + masked_result = as_concrete_data(var) masked_expected = np.ma.masked_array([0.57735, 1., 0.707107], mask=[0, 0, 1]) self.assertMaskedArrayAlmostEqual(masked_result, masked_expected) diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index 14dba07b85..19cf80a45d 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -1259,85 +1259,6 @@ def regridder(self, src, target): self.assertEqual(result, (scheme, cube, mock.sentinel.TARGET, cube)) -class Test_replace(tests.IrisTest): - def test(self): - cube = stock.simple_1d() - data = np.ones(cube.shape) - cube.replace(data) - self.assertIs(cube.core_data(), data) - - def test__lazy(self): - cube = stock.simple_1d() - data = as_lazy_data(cube.data) - cube.replace(data) - self.assertIs(cube.core_data(), data) - self.assertTrue(cube.has_lazy_data()) - - def test__lazy_with_dtype_change(self): - lazy = as_lazy_data(np.array(10.0)) - dtype = np.dtype('int16') - cube = Cube(lazy) - cube.replace(lazy * 10, dtype=dtype) - self.assertEqual(cube.dtype, dtype) - self.assertEqual(cube.core_data().dtype, lazy.dtype) - - def test__lazy_masked_with_dtype_change(self): - real = ma.array(10) - real.mask = True - lazy = as_lazy_data(real) - dtype = np.dtype('int16') - cube = Cube(lazy, dtype=real.dtype) - self.assertEqual(cube.dtype, real.dtype) - self.assertEqual(cube.core_data().dtype, lazy.dtype) - cube.replace(lazy * 10, dtype=dtype) - self.assertEqual(cube.dtype, dtype) - self.assertEqual(cube.core_data().dtype, lazy.dtype) - - def test__dtype_fill_value_clearance(self): - real = np.array(10.0) - lazy = as_lazy_data(real) - dtype = np.dtype('int16') - fill_value = 10 - cube = Cube(lazy, dtype=dtype, fill_value=fill_value) - self.assertEqual(cube.dtype, dtype) - self.assertEqual(cube.fill_value, fill_value) - cube.replace(real) - self.assertEqual(cube.dtype, real.dtype) - self.assertIsNone(cube.fill_value) - self.assertIs(cube.core_data(), real) - - def test__shape_failure(self): - cube = stock.simple_1d() - data = np.array([0]) - emsg = 'Require data with shape \(11,\), got \(1,\).' - with self.assertRaisesRegexp(ValueError, emsg): - cube.replace(data) - - def test__lazy_failure(self): - cube = stock.simple_1d() - data = np.ones(cube.shape) - dtype = np.dtype('int16') - emsg = 'Cannot set realised dtype, no lazy data is available' - with self.assertRaisesRegexp(ValueError, emsg): - cube.replace(data, dtype=dtype) - - def test__dtype_failure(self): - lazy = as_lazy_data(np.array(10.0, dtype=np.dtype('float64'))) - cube = Cube(lazy) - dtype = np.dtype('float32') - emsg = 'Can only cast lazy data to an integer or boolean dtype' - with self.assertRaisesRegexp(ValueError, emsg): - cube.replace(lazy, dtype=dtype) - - def test__promote_shape_with_dtype_failure(self): - data = np.array(666) - cube = Cube(data) - emsg = 'Cannot set realised dtype, no lazy data is available' - with self.assertRaisesRegexp(ValueError, emsg): - cube.replace(data, dtype=np.dtype('float32')) - self.assertArrayEqual(cube.data, data) - - class Test_copy(tests.IrisTest): def _check_copy(self, cube, cube_copy): self.assertIsNot(cube_copy, cube) @@ -1380,87 +1301,6 @@ def test__lazy(self): self._check_copy(cube, cube.copy()) -class Test_fill_value(tests.IrisTest): - def setUp(self): - self.dtypes = (np.dtype('int'), np.dtype('uint'), - np.dtype('bool'), np.dtype('float')) - - def test_cube___init___default_none(self): - cube = Cube(np.array(0)) - self.assertIsNone(cube.fill_value) - - def test_cube___init___setter(self): - fill_value = 123 - cube = Cube(np.array(0), fill_value=fill_value) - self.assertEqual(cube.fill_value, fill_value) - - def test_cube_setter(self): - fill_value = 123 - cube = Cube(np.array(0)) - self.assertIsNone(cube.fill_value) - cube.fill_value = fill_value - self.assertEqual(cube.fill_value, fill_value) - - def test_cube_data_setter_with_ndarray(self): - fill_value = 123 - cube = Cube(np.array(0), fill_value=fill_value) - self.assertEqual(cube.fill_value, fill_value) - cube.data = np.array(1) - self.assertIsNone(cube.fill_value) - - def test_cube_data_setter_with_masked_array(self): - fill_value = 123 - cube = Cube(np.array(0)) - self.assertIsNone(cube.fill_value) - cube.data = ma.masked_array(1, fill_value=fill_value) - self.assertEqual(cube.fill_value, fill_value) - - def test_fill_value_bool(self): - fill_value = np.bool_(True) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - cube = Cube(data, fill_value=fill_value) - [expected] = np.array([fill_value], dtype=dtype) - self.assertEqual(cube.fill_value, expected) - self.assertEqual(cube.fill_value.dtype, dtype) - - def test_fill_value_int(self): - fill_value = np.int_(123) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - cube = Cube(data, fill_value=fill_value) - [expected] = np.array([fill_value], dtype=dtype) - self.assertEqual(cube.fill_value, expected) - self.assertEqual(cube.fill_value.dtype, dtype) - - def test_fill_value_float(self): - fill_value = np.float_(123.4) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - cube = Cube(data, fill_value=fill_value) - if dtype.kind in 'biu': - fill_value = np.rint(fill_value) - [expected] = np.array([fill_value], dtype=dtype) - self.assertEqual(cube.fill_value, expected) - self.assertEqual(cube.fill_value.dtype, dtype) - - def test_fill_value_uint(self): - fill_value = np.uint(123) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - cube = Cube(data, fill_value=fill_value) - [expected] = np.array([fill_value], dtype=dtype) - self.assertEqual(cube.fill_value, expected) - self.assertEqual(cube.fill_value.dtype, dtype) - - def test_fill_value_overflow(self): - fill_value = np.float_(1e+20) - data = np.array([0], dtype=np.int) - emsg = 'Fill value of .* invalid for dtype' - with self.assertRaisesRegexp(ValueError, emsg): - Cube(data, fill_value=fill_value) - - class Test_dtype(tests.IrisTest): def setUp(self): self.dtypes = (np.dtype('int'), np.dtype('uint'), @@ -1472,12 +1312,6 @@ def test_real_data(self): cube = Cube(data) self.assertEqual(cube.dtype, dtype) - def test_real_data_with_dtype(self): - for dtype in self.dtypes: - data = np.array([0, 1], dtype=dtype) - cube = Cube(data, dtype=dtype) - self.assertEqual(cube.dtype, dtype) - def test_real_data_masked__mask_unset(self): for dtype in self.dtypes: data = ma.array([0, 1], dtype=dtype) @@ -1491,19 +1325,6 @@ def test_real_data_masked__mask_set(self): cube = Cube(data) self.assertEqual(cube.dtype, dtype) - def test_real_data_masked_with_dtype__mask_unset(self): - for dtype in self.dtypes: - data = ma.array([0, 1], dtype=dtype) - cube = Cube(data, dtype=dtype) - self.assertEqual(cube.dtype, dtype) - - def test_real_data_masked_with_dtype__mask_set(self): - for dtype in self.dtypes: - data = ma.array([0, 1], dtype=dtype) - data[0] = ma.masked - cube = Cube(data, dtype=dtype) - self.assertEqual(cube.dtype, dtype) - def test_lazy_data(self): for dtype in self.dtypes: data = np.array([0, 1], dtype=dtype) @@ -1513,15 +1334,6 @@ def test_lazy_data(self): # of the data. self.assertTrue(cube.has_lazy_data()) - def test_lazy_data_with_dtype(self): - for dtype in self.dtypes: - data = np.array([0, 1], dtype=dtype) - cube = Cube(as_lazy_data(data), dtype=dtype) - self.assertEqual(cube.dtype, dtype) - # Check that accessing the dtype does not trigger loading - # of the data. - self.assertTrue(cube.has_lazy_data()) - def test_lazy_data_masked__mask_unset(self): for dtype in self.dtypes: data = ma.array([0, 1], dtype=dtype) @@ -1541,251 +1353,6 @@ def test_lazy_data_masked__mask_set(self): # of the data. self.assertTrue(cube.has_lazy_data()) - def test_lazy_data_masked_with_dtype__mask_unset(self): - for dtype in self.dtypes: - data = ma.array([0, 1], dtype=dtype) - cube = Cube(as_lazy_data(data), dtype=dtype) - self.assertEqual(cube.dtype, dtype) - # Check that accessing the dtype does not trigger loading - # of the data. - self.assertTrue(cube.has_lazy_data()) - - def test_lazy_data_masked_with_dtype__mask_set(self): - for dtype in self.dtypes: - data = ma.array([0, 1], dtype=dtype) - data[0] = ma.masked - cube = Cube(as_lazy_data(data), dtype=dtype) - self.assertEqual(cube.dtype, dtype) - # Check that accessing the dtype does not trigger loading - # of the data. - self.assertTrue(cube.has_lazy_data()) - - def test_real_data_with_dtype_different(self): - for dtype in self.dtypes: - data = np.array([0, 1], dtype=dtype) - emsg = 'Cannot set realised dtype, no lazy data is available' - with self.assertRaisesRegexp(ValueError, emsg): - Cube(data, dtype=np.complex) - - def test_lazy_data_masked_with_dtype__non_float_lazy_dtype(self): - for dtype in self.dtypes: - if dtype != np.dtype('float'): - data = ma.array([0, 1], dtype=dtype) - emsg = ("Cannot set realised dtype for lazy data " - "with dtype\('{}'\)") - with self.assertRaisesRegexp(ValueError, emsg.format(dtype)): - Cube(as_lazy_data(data), dtype=np.dtype('int16')) - - def test_lazy_data_masked_with_dtype_non_integral(self): - for dtype in self.dtypes: - data = ma.array([0, 1], dtype=dtype) - data[0] = ma.masked - emsg = 'Can only cast lazy data to an integer or boolean dtype' - with self.assertRaisesRegexp(ValueError, emsg): - Cube(as_lazy_data(data), dtype=np.complex) - - -class Test_data_dtype_fillvalue(tests.IrisTest): - def _sample_data(self, dtype='f4', masked=False, lazy=False): - data = np.arange(6).reshape((2, 3)) - dtype = np.dtype(dtype) - data = data.astype(dtype) - if masked: - data = ma.masked_array(data, mask=[[0, 1, 0], [0, 0, 0]]) - if lazy: - data = as_lazy_data(data) - return data - - def _sample_cube(self, dtype='f4', masked=False, lazy=False, - cube_dtype=None, cube_fill_value=None): - data = self._sample_data(dtype=dtype, masked=masked, lazy=lazy) - if cube_dtype is None: - cube_dtype = dtype - # NOTE: with masked lazy integers, the resulting data dtype will - # be changed, so we must set the cube to the 'original' dtype. - else: - cube_dtype = np.dtype(cube_dtype) - cube = Cube(data, dtype=cube_dtype, fill_value=cube_fill_value) - return cube - - def test_realdata_change(self): - # Check that re-assigning real data resets dtype and fill_value. - cube = self._sample_cube(cube_fill_value=27.3) - self.assertEqual(cube.dtype, np.dtype('f4')) - self.assertArrayAllClose(cube.fill_value, 27.3) - new_data = self._sample_data(dtype=np.int32) - cube.data = new_data - self.assertIs(cube.core_data(), new_data) - self.assertEqual(cube.dtype, np.dtype('i4')) - self.assertIsNone(cube.fill_value) - - def test_realise_unmasked(self): - # Check that touching unmasked lazy data retains the fill_value. - cube = self._sample_cube(cube_fill_value=27.3, lazy=True) - data = cube.data - self.assertIs(cube.core_data(), data) - self.assertArrayAllClose(cube.fill_value, 27.3) - - def test_realise_masked(self): - # Check that touching masked lazy data retains the fill_value. - fill_value = 27.3 - cube = self._sample_cube(cube_fill_value=fill_value, masked=True, - lazy=True) - data = cube.data - self.assertIs(cube.core_data(), data) - self.assertArrayAllClose(cube.fill_value, fill_value) - self.assertArrayAllClose(data.fill_value, fill_value) - - def test_realise_maskedints(self): - # Check that touching masked integer lazy data retains the fill_value. - fill_value = 999 - cube = self._sample_cube(dtype=np.int16, masked=True, lazy=True, - cube_fill_value=fill_value) - self.assertIs(cube.core_data().dtype, np.dtype('f8')) - data = cube.data - self.assertIs(cube.core_data().dtype, np.dtype('i2')) - self.assertEqual(cube.fill_value.dtype, np.dtype('i2')) - self.assertArrayAllClose(cube.fill_value, fill_value) - self.assertArrayAllClose(data.fill_value, fill_value) - - def test_lazydata_change(self): - # Check that re-assigning lazy data resets dtype and fill_value. - cube = self._sample_cube(dtype=np.float32, lazy=True, - cube_dtype=np.int16, - cube_fill_value=27.3) - # Set a modified dtype to check it gets reset. - self.assertEqual(cube.dtype, np.dtype('i2')) - self.assertEqual(cube.core_data().dtype, np.dtype('f4')) - self.assertArrayAllClose(cube.fill_value, 27) - new_data = self._sample_data(np.float64, lazy=True) - cube.data = new_data - self.assertEqual(cube.dtype, np.dtype('f8')) - self.assertIsNone(cube.fill_value) - - def test_lazydata_nonmaskedints(self): - # Check that lazy ints retain their dtype. - data_original = self._sample_data(dtype=np.int32) - data_lazy = as_lazy_data(data_original) - cube = Cube(data_lazy) - self.assertEqual(cube.dtype, np.dtype('i4')) - self.assertEqual(cube.core_data().dtype, np.dtype('i4')) - data = cube.data - self.assertArrayEqual(data, data_original) - - def test_lazydata_maskedints(self): - # Check lazy masked ints dtype. - fill_value = 1234 - masked_data_original = self._sample_data(dtype=np.int32, masked=True) - masked_data_lazy = as_lazy_data(masked_data_original) - cube = Cube(masked_data_lazy, dtype=masked_data_original.dtype, - fill_value=fill_value) - self.assertEqual(cube.dtype, np.dtype('i4')) - self.assertEqual(cube.core_data().dtype, np.dtype('f8')) - data = cube.data - self.assertTrue(ma.is_masked(data)) - self.assertMaskedArrayEqual(data, masked_data_original) - self.assertArrayAllClose(cube.fill_value, fill_value) - self.assertArrayAllClose(data.fill_value, fill_value) - - def test_realdata_maskedconstantint(self): - fill_value = 1234 - masked_data = ma.masked_array([666], mask=True) - masked_constant = masked_data[0] - cube = Cube(masked_constant, fill_value=fill_value) - self.assertArrayAllClose(cube.fill_value, fill_value) - data = cube.data - self.assertTrue(ma.isMaskedArray(data)) - self.assertArrayAllClose(cube.fill_value, fill_value) - self.assertArrayAllClose(data.fill_value, fill_value) - self.assertNotIsInstance(data, ma.core.MaskedConstant) - - def test_lazydata_maskedconstantint(self): - fill_value = 1234 - dtype = np.dtype('i2') - masked_data = ma.masked_array([666], mask=True, dtype=dtype) - masked_constant = masked_data[0] - masked_constant_lazy = as_lazy_data(masked_constant) - cube = Cube(masked_constant_lazy, dtype=dtype, fill_value=fill_value) - self.assertArrayAllClose(cube.fill_value, fill_value) - self.assertEqual(cube.dtype, dtype) - self.assertEqual(cube.core_data().dtype, np.dtype('f8')) - data = cube.data - self.assertTrue(ma.isMaskedArray(data)) - self.assertArrayAllClose(cube.fill_value, fill_value) - self.assertArrayAllClose(data.fill_value, fill_value) - self.assertEqual(data.dtype, dtype) - self.assertNotIsInstance(data, ma.core.MaskedConstant) - - def test_fill_value__int_dtype_to_float(self): - # Check that fill_value is cast to dtype, e.g. float --> int. - cube = self._sample_cube(dtype=np.float32, cube_fill_value=1735) - self.assertEqual(cube.fill_value.dtype, np.dtype('f4')) - self.assertArrayAllClose(cube.fill_value, 1735.0) - - def test_fill_value__float_dtype_to_int(self): - # Check that fill_value is rounded to dtype, e.g. float --> int. - cube = self._sample_cube(dtype=np.int16, cube_fill_value=1734.99999) - self.assertEqual(cube.fill_value.dtype, np.dtype('i2')) - self.assertArrayAllClose(cube.fill_value, 1735) - - def test_set_fill_value(self): - cube = self._sample_cube() - cube.fill_value = -74.6 - self.assertEqual(cube.fill_value.dtype, np.dtype('f4')) - self.assertArrayAllClose(cube.fill_value, -74.6) - - def test_set_fill_value__typecast(self): - cube = self._sample_cube(dtype=np.int16) - cube.fill_value = -74.6 - self.assertEqual(cube.fill_value.dtype, np.dtype('i2')) - self.assertArrayAllClose(cube.fill_value, -75) - - def test_set_fill_value__casterror(self): - cube = self._sample_cube(dtype=np.int16) - msg = "Fill value of .* invalid for dtype\('int16'\)" - with self.assertRaisesRegexp(ValueError, msg): - # NOTE: this doesn't actually work properly in most cases. - # E.G. it will happily assign 1e12 to an int16 and gets 4096. - cube.fill_value = -1.0e23 - - def test_clear_fill_value(self): - cube = self._sample_cube(cube_fill_value=123.768) - cube.fill_value = None - self.assertIsNone(cube.fill_value) - - def test_realdata___getitem__(self): - fill_value = 123 - cube = Cube(np.arange(10), fill_value=fill_value) - subcube = cube[5:] - self.assertArrayAllClose(subcube.fill_value, fill_value) - - def test_lazydata___getitem__(self): - fill_value = 123 - dtype = np.dtype('int16') - masked_array = ma.masked_array(np.arange(5), - mask=[0, 0, 1, 0, 0], - dtype=dtype) - lazy_masked_array = as_lazy_data(masked_array) - cube = Cube(lazy_masked_array, dtype=dtype, fill_value=fill_value) - subcube = cube[3:] - self.assertEqual(subcube.dtype, dtype) - self.assertArrayAllClose(subcube.fill_value, fill_value) - - def test_data_getter__masked_with_fill_value(self): - fill_value = 1234 - cube = self._sample_cube(masked=True, - cube_fill_value=fill_value) - self.assertEqual(cube.fill_value, fill_value) - data = cube.data - self.assertEqual(data.fill_value, fill_value) - - def test_data_getter__masked_with_fill_value_default(self): - cube = self._sample_cube(masked=True) - self.assertIsNone(cube.fill_value) - data = cube.data - np_fill_value = ma.masked_array(0, dtype=cube.dtype).fill_value - self.assertEqual(data.fill_value, np_fill_value) - class TestSubset(tests.IrisTest): def test_scalar_coordinate(self): diff --git a/lib/iris/tests/unit/data_manager/test_DataManager.py b/lib/iris/tests/unit/data_manager/test_DataManager.py index 61eae3b357..4d9fe2cce3 100644 --- a/lib/iris/tests/unit/data_manager/test_DataManager.py +++ b/lib/iris/tests/unit/data_manager/test_DataManager.py @@ -79,17 +79,6 @@ def test_real_with_real_failure(self): dm2 = DataManager(np.ones(self.shape)) self.assertFalse(dm1 == dm2) - def test_real_with_real__fill_value(self): - fill_value = 1234 - dm1 = DataManager(self.real_array, fill_value=fill_value) - dm2 = DataManager(self.real_array, fill_value=fill_value) - self.assertEqual(dm1, dm2) - - def test_real_with_real__fill_value_failure(self): - dm1 = DataManager(self.real_array, fill_value=1234) - dm2 = DataManager(self.real_array, fill_value=4321) - self.assertFalse(dm1 == dm2) - def test_real_with_real__dtype_failure(self): dm1 = DataManager(self.real_array) dm2 = DataManager(self.real_array.astype(int)) @@ -111,41 +100,11 @@ def test_lazy_with_lazy_failure(self): dm2 = DataManager(as_lazy_data(self.real_array) * 10) self.assertFalse(dm1 == dm2) - def test_lazy_with_lazy__fill_value(self): - fill_value = 1234 - dm1 = DataManager(as_lazy_data(self.real_array), - fill_value=fill_value) - dm2 = DataManager(as_lazy_data(self.real_array), - fill_value=fill_value) - self.assertEqual(dm1, dm2) - - def test_lazy_with_lazy__fill_value_failure(self): - dm1 = DataManager(as_lazy_data(self.real_array), - fill_value=1234) - dm2 = DataManager(as_lazy_data(self.real_array), - fill_value=4321) - self.assertFalse(dm1 == dm2) - def test_lazy_with_lazy__dtype_failure(self): dm1 = DataManager(as_lazy_data(self.real_array)) dm2 = DataManager(as_lazy_data(self.real_array).astype(int)) self.assertFalse(dm1 == dm2) - def test_lazy_with_lazy__realised_dtype(self): - dtype = np.dtype('int16') - dm1 = DataManager(as_lazy_data(self.real_array), - realised_dtype=dtype) - dm2 = DataManager(as_lazy_data(self.real_array), - realised_dtype=dtype) - self.assertEqual(dm1, dm2) - - def test_lazy_with_lazy__realised_dtype_failure(self): - dm1 = DataManager(as_lazy_data(self.real_array), - realised_dtype=np.dtype('int8')) - dm2 = DataManager(as_lazy_data(self.real_array), - realised_dtype=np.dtype('int16')) - self.assertFalse(dm1 == dm2) - def test_non_DataManager_failure(self): dm = DataManager(np.array(0)) self.assertFalse(dm == 0) @@ -167,17 +126,6 @@ def test_real_with_real_failure(self): dm2 = DataManager(self.real_array.copy()) self.assertFalse(dm1 != dm2) - def test_real_with_real__fill_value(self): - dm1 = DataManager(self.real_array, fill_value=1234) - dm2 = DataManager(self.real_array, fill_value=4321) - self.assertNotEqual(dm1, dm2) - - def test_real_with_real__fill_value_failure(self): - fill_value = 1234 - dm1 = DataManager(self.real_array, fill_value=fill_value) - dm2 = DataManager(self.real_array, fill_value=fill_value) - self.assertFalse(dm1 != dm2) - def test_real_with_real__dtype(self): dm1 = DataManager(self.real_array) dm2 = DataManager(self.real_array.astype(int)) @@ -199,41 +147,11 @@ def test_lazy_with_lazy_failure(self): dm2 = DataManager(as_lazy_data(self.real_array)) self.assertFalse(dm1 != dm2) - def test_lazy_with_lazy__fill_value(self): - dm1 = DataManager(as_lazy_data(self.real_array), - fill_value=1234) - dm2 = DataManager(as_lazy_data(self.real_array), - fill_value=4321) - self.assertNotEqual(dm1, dm2) - - def test_lazy_with_lazy__fill_value_failure(self): - fill_value = 1234 - dm1 = DataManager(as_lazy_data(self.real_array), - fill_value=fill_value) - dm2 = DataManager(as_lazy_data(self.real_array), - fill_value=fill_value) - self.assertFalse(dm1 != dm2) - def test_lazy_with_lazy__dtype(self): dm1 = DataManager(as_lazy_data(self.real_array)) dm2 = DataManager(as_lazy_data(self.real_array).astype(int)) self.assertNotEqual(dm1, dm2) - def test_lazy_with_lazy__realised_dtype(self): - dm1 = DataManager(as_lazy_data(self.real_array), - realised_dtype=np.dtype('int8')) - dm2 = DataManager(as_lazy_data(self.real_array), - realised_dtype=np.dtype('int16')) - self.assertNotEqual(dm1, dm2) - - def test_lazy_with_lazy__realised_dtype_failure(self): - dtype = np.dtype('int16') - dm1 = DataManager(as_lazy_data(self.real_array), - realised_dtype=dtype) - dm2 = DataManager(as_lazy_data(self.real_array), - realised_dtype=dtype) - self.assertFalse(dm1 != dm2) - def test_non_DataManager(self): dm = DataManager(np.array(0)) self.assertNotEqual(dm, 0) @@ -252,46 +170,12 @@ def test_real(self): expected = '{}({!r})'.format(self.name, self.real_array) self.assertEqual(result, expected) - def test_real__fill_value(self): - fill_value = 1234 - dm = DataManager(self.real_array, fill_value=fill_value) - result = repr(dm) - fmt = '{}({!r}, fill_value={!r})' - expected = fmt.format(self.name, self.real_array, fill_value) - self.assertEqual(result, expected) - def test_lazy(self): dm = DataManager(self.lazy_array) result = repr(dm) expected = '{}({!r})'.format(self.name, self.lazy_array) self.assertEqual(result, expected) - def test_lazy__fill_value(self): - fill_value = 1234.0 - dm = DataManager(self.lazy_array, fill_value=fill_value) - result = repr(dm) - fmt = '{}({!r}, fill_value={!r})' - expected = fmt.format(self.name, self.lazy_array, fill_value) - self.assertEqual(result, expected) - - def test_lazy__realised_dtype(self): - dtype = np.dtype('int16') - dm = DataManager(self.lazy_array, realised_dtype=dtype) - result = repr(dm) - fmt = '{}({!r}, realised_dtype={!r})' - expected = fmt.format(self.name, self.lazy_array, dtype) - self.assertEqual(result, expected) - - def test_lazy__fill_value_realised_dtype(self): - fill_value = 1234 - dtype = np.dtype('int16') - dm = DataManager(self.lazy_array, fill_value=fill_value, - realised_dtype=dtype) - result = repr(dm) - fmt = '{}({!r}, fill_value={!r}, realised_dtype={!r})' - expected = fmt.format(self.name, self.lazy_array, fill_value, dtype) - self.assertEqual(result, expected) - class Test__assert_axioms(tests.IrisTest): def setUp(self): @@ -311,29 +195,6 @@ def test_array_all(self): with self.assertRaisesRegexp(AssertionError, emsg): self.dm._assert_axioms() - def test_realised_dtype(self): - self.dm._realised_dtype = np.dtype('float') - emsg = 'Unexpected realised dtype state, got dtype' - with self.assertRaisesRegexp(AssertionError, emsg): - self.dm._assert_axioms() - - def test_real_array_with_realised_dtype(self): - self.dm._realised_dtype = np.dtype('int') - emsg = ("Unexpected real data with realised dtype, got " - "real data and realised dtype\('int64'\)") - with self.assertRaisesRegexp(AssertionError, emsg): - self.dm._assert_axioms() - - def test_non_float_lazy_array_with_realised_dtype(self): - self.dm._real_array = None - self.dm._lazy_array = self.lazy_array - self.dm._realised_dtype = np.dtype('int') - emsg = ("Unexpected lazy data dtype with realised dtype, got " - "lazy data dtype\('int64'\) and realised " - "dtype\('int64'\)") - with self.assertRaisesRegexp(AssertionError, emsg): - self.dm._assert_axioms() - class Test__deepcopy(tests.IrisTest): def setUp(self): @@ -384,34 +245,6 @@ def test_lazy_with_lazy(self): self.assertEqual(result, expected) self.assertIs(result._lazy_array, data) - def test_real_with_realised_dtype_failure(self): - dm = DataManager(self.real_array) - emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): - dm._deepcopy(self.memo, realised_dtype=np.dtype('int16')) - - def test_lazy_with_realised_dtype__lazy_dtype_failure(self): - dm = DataManager(as_lazy_data(self.real_array).astype(int)) - emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): - dm._deepcopy(self.memo, realised_dtype=np.dtype('int16')) - - def test_lazy_with_realised_dtype_failure(self): - dm = DataManager(as_lazy_data(self.real_array)) - emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): - dm._deepcopy(self.memo, realised_dtype=np.dtype('float32')) - - def test_lazy_with_realised_dtype(self): - dm = DataManager(as_lazy_data(self.real_array), - realised_dtype=np.dtype('int16')) - data = as_lazy_data(self.real_array) * 10 - dtype = np.dtype('int8') - result = dm._deepcopy(self.memo, data=data, realised_dtype=dtype) - expected = DataManager(data, realised_dtype=dtype) - self.assertEqual(result, expected) - self.assertIs(result._lazy_array, data) - def test_real_with_real_failure(self): dm = DataManager(self.real_array) emsg = 'Cannot copy' @@ -436,140 +269,6 @@ def test_lazy_with_lazy_failure(self): with self.assertRaisesRegexp(ValueError, emsg): dm._deepcopy(self.memo, data=as_lazy_data(np.array(0))) - def test__default_fill_value(self): - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - result = dm._deepcopy(self.memo) - self.assertIsNone(result.fill_value) - - def test__default_with_fill_value(self): - fill_value = 1234 - dm = DataManager(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - result = dm._deepcopy(self.memo) - self.assertEqual(result.fill_value, fill_value) - - def test__clear_fill_value(self): - fill_value = 1234 - dm = DataManager(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - result = dm._deepcopy(self.memo, fill_value=None) - self.assertIsNone(result.fill_value) - - def test__set_fill_value(self): - fill_value = 1234 - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - result = dm._deepcopy(self.memo, fill_value=fill_value) - self.assertEqual(result.fill_value, fill_value) - - def test__set_fill_value_failure(self): - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): - dm._deepcopy(self.memo, fill_value=1e+20) - - -class Test__propagate_masked_data_fill_value(tests.IrisTest): - def setUp(self): - self.real_array = np.array(0) - self.mask_array = ma.array(0) - np_fill_value = ma.array(0, dtype=self.mask_array.dtype).fill_value - assert np_fill_value == self.mask_array.fill_value - self.np_fill_value = np_fill_value - self.dm = DataManager(self.mask_array) - self.dm.fill_value = None - - def test_nop__with_real_array(self): - fill_value = 1234 - dm = DataManager(self.real_array) - dm.fill_value = 1234 - self.assertEqual(dm.fill_value, fill_value) - dm._propagate_masked_data_fill_value() - self.assertEqual(dm.fill_value, fill_value) - - def test_clear_fill_value__with_np_default(self): - fill_value = 1234 - self.dm.fill_value = fill_value - self.assertEqual(self.dm.fill_value, fill_value) - self.dm._propagate_masked_data_fill_value() - self.assertIsNone(self.dm.fill_value) - - def test_set_fill_value(self): - fill_value = 1234 - self.assertIsNone(self.dm.fill_value) - self.dm._real_array.fill_value = fill_value - self.dm._propagate_masked_data_fill_value() - self.assertEqual(self.dm.fill_value, fill_value) - - -class Test__realised_dtype_setter(tests.IrisTest): - def setUp(self): - self.real_array = np.array(0.0) - self.lazy_array = as_lazy_data(self.real_array) - self.dm = DataManager(self.lazy_array) - - def test_lazy_with_none(self): - self.assertIsNone(self.dm._realised_dtype) - self.dm._realised_dtype_setter(None) - self.assertIsNone(self.dm._realised_dtype) - - def test_real_with_none(self): - self.dm._lazy_array = None - self.dm._real_array = self.real_array - self.assertIsNone(self.dm._realised_dtype) - self.dm._realised_dtype_setter(None) - self.assertIsNone(self.dm._realised_dtype) - - def test_real_with_same_dtype(self): - self.dm._lazy_array = None - self.dm._real_array = self.real_array - self.assertIsNone(self.dm._realised_dtype) - self.dm._realised_dtype_setter(self.dm.dtype) - self.assertIsNone(self.dm._realised_dtype) - - def test_lazy_with_same_dtype(self): - self.assertIsNone(self.dm._realised_dtype) - self.dm._realised_dtype_setter(self.dm.dtype) - self.assertIsNone(self.dm._realised_dtype) - - def test_real_array_failure(self): - self.dm._lazy_array = None - self.dm._real_array = self.real_array - self.assertIsNone(self.dm._realised_dtype) - emsg = 'Cannot set realised dtype, no lazy data is available' - with self.assertRaisesRegexp(ValueError, emsg): - self.dm._realised_dtype_setter(np.dtype('int16')) - - def test_invalid_realised_dtype(self): - emsg = ("Can only cast lazy data to an integer or boolean " - "dtype, got dtype\('float32'\)") - with self.assertRaisesRegexp(ValueError, emsg): - self.dm._realised_dtype_setter(np.dtype('float32')) - - def test_lazy_with_realised_dtype(self): - dtypes = (np.dtype('bool'), np.dtype('int16'), np.dtype('uint16')) - for dtype in dtypes: - self.dm._realised_dtype = None - self.dm._realised_dtype_setter(dtype) - self.assertEqual(self.dm._realised_dtype, dtype) - - def test_lazy_with_realised_dtype__lazy_dtype_failure(self): - self.dm._lazy_array = self.lazy_array.astype(np.dtype('int64')) - emsg = ("Cannot set realised dtype for lazy data " - "with dtype\('int64'\)") - with self.assertRaisesRegexp(ValueError, emsg): - self.dm._realised_dtype_setter(np.dtype('int16')) - - def test_lazy_replace_with_none(self): - self.assertIsNone(self.dm._realised_dtype) - dtype = np.dtype('int16') - self.dm._realised_dtype_setter(dtype) - self.assertEqual(self.dm._realised_dtype, dtype) - self.dm._realised_dtype_setter(None) - self.assertIsNone(self.dm._realised_dtype) - class Test_data__getter(tests.IrisTest): def setUp(self): @@ -598,72 +297,6 @@ def test_with_lazy_array(self): self.assertFalse(dm.has_lazy_data()) self.assertArrayEqual(result, self.real_array) - def test_with_real_mask_array__default_fill_value(self): - fill_value = 1234 - self.mask_array.fill_value = fill_value - dm = DataManager(self.mask_array) - self.assertEqual(dm.fill_value, fill_value) - self.assertEqual(dm.data.fill_value, fill_value) - - def test_with_real_mask_array__with_fill_value_None(self): - fill_value = 1234 - self.mask_array.fill_value = fill_value - dm = DataManager(self.mask_array, fill_value=None) - self.assertIsNone(dm.fill_value) - np_fill_value = ma.array(0, dtype=dm.dtype).fill_value - self.assertEqual(dm.data.fill_value, np_fill_value) - - def test_with_real_mask_array__with_fill_value(self): - fill_value = 1234 - dm = DataManager(self.mask_array, fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - self.assertEqual(dm.data.fill_value, fill_value) - - def test_with_lazy_mask_array__masked_default_fill_value(self): - dm = DataManager(self.lazy_mask_array_masked, - realised_dtype=self.realised_dtype) - self.assertIsNone(dm.fill_value) - np_fill_value = ma.array(0, dtype=dm.dtype).fill_value - self.assertEqual(dm.data.fill_value, np_fill_value) - - def test_with_lazy_mask_array__masked_fill_value_None(self): - dm = DataManager(self.lazy_mask_array_masked, - fill_value=None, - realised_dtype=self.realised_dtype) - self.assertIsNone(dm.fill_value) - np_fill_value = ma.array(0, dtype=dm.dtype).fill_value - self.assertEqual(dm.data.fill_value, np_fill_value) - - def test_with_lazy_mask_array__masked_with_fill_value(self): - fill_value = 1234 - dm = DataManager(self.lazy_mask_array_masked, - fill_value=fill_value, - realised_dtype=self.realised_dtype) - self.assertEqual(dm.fill_value, fill_value) - self.assertEqual(dm.data.fill_value, fill_value) - - def test_with_lazy_mask_array__not_masked(self): - dm = DataManager(self.lazy_mask_array, - realised_dtype=self.realised_dtype) - self.assertTrue(dm.has_lazy_data()) - result = dm.data - self.assertFalse(dm.has_lazy_data()) - self.assertIsInstance(result, np.core.ndarray) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, self.realised_dtype) - self.assertArrayEqual(result, self.real_array) - - def test_with_lazy_mask_array__masked(self): - dm = DataManager(self.lazy_mask_array_masked, - realised_dtype=self.realised_dtype) - self.assertTrue(dm.has_lazy_data()) - result = dm.data - self.assertFalse(dm.has_lazy_data()) - self.assertIsInstance(result, ma.MaskedArray) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, self.realised_dtype) - self.assertArrayEqual(result, self.mask_array_masked) - def test_with_real_masked_constant(self): masked_data = ma.masked_array([666], mask=True, dtype=np.dtype('f8')) masked_constant = masked_data[0] @@ -674,19 +307,6 @@ def test_with_real_masked_constant(self): self.assertNotIsInstance(result, ma.core.MaskedConstant) self.assertMaskedArrayEqual(result, masked_data) - def test_with_lazy_masked_constant(self): - dtype = np.dtype('int16') - masked_data = ma.masked_array([666], mask=True, dtype=dtype) - masked_constant = masked_data[0] - lazy_masked_constant = as_lazy_data(masked_constant) - dm = DataManager(lazy_masked_constant, realised_dtype=dtype) - self.assertEqual(dm.dtype, dtype) - result = dm.data - self.assertFalse(dm.has_lazy_data()) - self.assertIsInstance(result, ma.MaskedArray) - self.assertNotIsInstance(result, ma.core.MaskedConstant) - self.assertMaskedArrayEqual(result, masked_data) - class Test_data__setter(tests.IrisTest): def test_zero_ndim_real_with_scalar_int(self): @@ -818,35 +438,6 @@ def test_nd_lazy_to_nd_lazy(self): self.assertTrue(dm.has_lazy_data()) self.assertArrayEqual(dm.data, lazy_array.compute()) - def test_realised_dtype_none(self): - shape = (2, 3, 4) - size = np.prod(shape) - mask_array = ma.arange(size).reshape(shape) - dtype = mask_array.dtype - lazy_array = as_lazy_data(mask_array) - dm = DataManager(lazy_array, realised_dtype=dtype) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - dm.data = mask_array - self.assertIs(dm.data, mask_array) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - - def test_realised_dtype_clearance(self): - shape = (2, 3, 4) - size = np.prod(shape) - mask_array = ma.arange(size).reshape(shape) - mask_array[0, 0, 0] = ma.masked - dtype = mask_array.dtype - lazy_array = as_lazy_data(mask_array) - dm = DataManager(lazy_array, realised_dtype=dtype) - self.assertEqual(dm._realised_dtype, dtype) - self.assertEqual(dm.dtype, dtype) - dm.data = mask_array - self.assertIs(dm.data, mask_array) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - def test_coerce_to_ndarray(self): shape = (2, 3) size = np.prod(shape) @@ -868,36 +459,6 @@ def test_real_masked_constant_to_array(self): self.assertNotIsInstance(dm.data, ma.core.MaskedConstant) self.assertMaskedArrayEqual(dm.data, masked_data) - def test_real_array__fill_value_clearance(self): - fill_value = 1234 - dm = DataManager(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - dm.data = np.array(1) - self.assertIsNone(dm.fill_value) - - def test_lazy_array__fill_value_clearance(self): - fill_value = 1234 - dm = DataManager(as_lazy_data(np.array(0)), - fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - dm.data = as_lazy_data(np.array(1)) - self.assertIsNone(dm.fill_value) - - def test_mask_array__default_fill_value(self): - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - data = ma.array(1) - dm.data = data - self.assertIsNone(dm.fill_value) - - def test_mask_array__with_fill_value(self): - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - fill_value = 1234 - data = ma.array(1, fill_value=fill_value) - dm.data = data - self.assertEqual(dm.fill_value, fill_value) - class Test_dtype(tests.IrisTest): def setUp(self): @@ -912,76 +473,6 @@ def test_lazy_array(self): dm = DataManager(self.lazy_array) self.assertEqual(dm.dtype, np.dtype('float64')) - def test_lazy_array_realised_dtype(self): - dm = DataManager(self.lazy_array, realised_dtype=np.dtype('bool')) - self.assertEqual(dm.dtype, np.dtype('bool')) - self.assertEqual(dm._lazy_array.dtype, np.dtype('float64')) - - -class Test_fill_value(tests.IrisTest): - def setUp(self): - self.dtypes = (np.dtype('int'), np.dtype('uint'), - np.dtype('bool'), np.dtype('float')) - - def test___init___default(self): - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - - def test___init___with_fill_value(self): - fill_value = 1234 - dm = DataManager(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - - def test_fill_value_bool(self): - fill_value = np.bool_(True) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - dm = DataManager(data) - dm.fill_value = fill_value - [expected] = np.asarray([fill_value], dtype=dtype) - self.assertEqual(dm.fill_value, expected) - self.assertEqual(dm.fill_value.dtype, dtype) - - def test_fill_value_int(self): - fill_value = np.int(1234) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - dm = DataManager(data) - dm.fill_value = fill_value - [expected] = np.asarray([fill_value], dtype=dtype) - self.assertEqual(dm.fill_value, expected) - self.assertEqual(dm.fill_value.dtype, dtype) - - def test_fill_value_float(self): - fill_value = np.float(123.4) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - dm = DataManager(data) - dm.fill_value = fill_value - if dtype.kind in 'biu': - fill_value = np.rint(fill_value) - [expected] = np.asarray([fill_value], dtype=dtype) - self.assertEqual(dm.fill_value, expected) - self.assertEqual(dm.fill_value.dtype, dtype) - - def test_fill_value_uint(self): - fill_value = np.uint(1234) - for dtype in self.dtypes: - data = np.array([0], dtype=dtype) - dm = DataManager(data) - dm.fill_value = fill_value - [expected] = np.array([fill_value], dtype=dtype) - self.assertEqual(dm.fill_value, expected) - self.assertEqual(dm.fill_value.dtype, dtype) - - def test_fill_value_overflow(self): - fill_value = np.float(1e+20) - data = np.array([0], dtype=np.int32) - dm = DataManager(data) - emsg = 'Fill value of .* invalid for dtype' - with self.assertRaisesRegexp(ValueError, emsg): - dm.fill_value = fill_value - class Test_ndim(tests.IrisTest): def test_ndim_0(self): @@ -1030,35 +521,13 @@ def setUp(self): def test(self): dm = DataManager(np.array(0)) - kwargs = dict(data=self.data, fill_value='none', realised_dtype='none') + kwargs = dict(data=self.data) with mock.patch(self.method) as mocker: mocker.return_value = self.return_value result = dm.copy(data=self.data) mocker.assert_called_once_with(self.memo, **kwargs) self.assertIs(result, self.return_value) - def test_with_fill_value(self): - dm = DataManager(np.array(0)) - fill_value = mock.sentinel.fill_value - kwargs = dict(data=self.data, fill_value=fill_value, - realised_dtype='none') - with mock.patch(self.method) as mocker: - mocker.return_value = self.return_value - result = dm.copy(data=self.data, fill_value=fill_value) - mocker.assert_called_once_with(self.memo, **kwargs) - self.assertIs(result, self.return_value) - - def test_with_realised_dtype(self): - dm = DataManager(np.array(0)) - realised_dtype = mock.sentinel.realised_dtype - kwargs = dict(data=self.data, fill_value='none', - realised_dtype=realised_dtype) - with mock.patch(self.method) as mocker: - mocker.return_value = self.return_value - result = dm.copy(data=self.data, realised_dtype=realised_dtype) - mocker.assert_called_once_with(self.memo, **kwargs) - self.assertIs(result, self.return_value) - class Test_core_data(tests.IrisTest): def test_real_array(self): @@ -1107,157 +576,5 @@ def test_with_lazy_array(self): self.assertIs(result, dm._lazy_array) -class Test_replace(tests.IrisTest): - def setUp(self): - self.shape = (2, 3, 4) - self.size = np.prod(self.shape) - self.real_array = np.arange(self.size).reshape(self.shape) - - def test_real_with_real(self): - dm = DataManager(self.real_array * 10) - self.assertFalse(dm.has_lazy_data()) - dm.replace(self.real_array) - self.assertFalse(dm.has_lazy_data()) - self.assertIs(dm._real_array, self.real_array) - self.assertIs(dm.data, self.real_array) - - def test_real_with_lazy(self): - lazy_array = as_lazy_data(self.real_array) - dm = DataManager(self.real_array) - self.assertFalse(dm.has_lazy_data()) - dm.replace(lazy_array) - self.assertTrue(dm.has_lazy_data()) - self.assertIs(dm._lazy_array, lazy_array) - self.assertArrayEqual(dm.data, self.real_array) - - def test_lazy_with_real(self): - lazy_array = as_lazy_data(self.real_array) - dm = DataManager(lazy_array * 10) - self.assertTrue(dm.has_lazy_data()) - dm.replace(self.real_array) - self.assertFalse(dm.has_lazy_data()) - self.assertIs(dm._real_array, self.real_array) - self.assertIs(dm.data, self.real_array) - - def test_lazy_with_lazy(self): - lazy_array = as_lazy_data(self.real_array) - dm = DataManager(lazy_array * 10) - self.assertTrue(dm.has_lazy_data()) - dm.replace(lazy_array) - self.assertTrue(dm.has_lazy_data()) - self.assertIs(dm._lazy_array, lazy_array) - self.assertArrayEqual(dm.data, self.real_array) - - def test_lazy_with_real__realised_dtype_none(self): - mask_array = ma.arange(self.size).reshape(self.shape) - dtype = mask_array.dtype - lazy_array = as_lazy_data(mask_array) - dm = DataManager(lazy_array, realised_dtype=dtype) - self.assertTrue(dm.has_lazy_data()) - self.assertIsNone(dm._realised_dtype, dtype) - self.assertEqual(dm.dtype, dtype) - dm.replace(mask_array) - self.assertFalse(dm.has_lazy_data()) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - self.assertIs(dm._real_array, mask_array) - self.assertIs(dm.data, mask_array) - - def test_lazy_with_real__realised_dtype_clearance(self): - mask_array = ma.arange(self.size).reshape(self.shape) - mask_array[0, 0, 0] = ma.masked - dtype = mask_array.dtype - lazy_array = as_lazy_data(mask_array) - dm = DataManager(lazy_array, realised_dtype=dtype) - self.assertTrue(dm.has_lazy_data()) - self.assertEqual(dm._realised_dtype, dtype) - self.assertEqual(dm.dtype, dtype) - dm.replace(mask_array) - self.assertFalse(dm.has_lazy_data()) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - self.assertIs(dm._real_array, mask_array) - self.assertIs(dm.data, mask_array) - - def test_real_with_lazy__realised_dtype_setter_none(self): - mask_array = ma.masked_array(self.real_array) * 10 - dtype = mask_array.dtype - lazy_array = as_lazy_data(mask_array) - dm = DataManager(self.real_array) - self.assertFalse(dm.has_lazy_data()) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - dm.replace(lazy_array, realised_dtype=dtype) - self.assertTrue(dm.has_lazy_data()) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - self.assertIs(dm._lazy_array, lazy_array) - self.assertArrayEqual(dm.data, mask_array) - - def test_real_with_lazy__realised_dtype_setter(self): - mask_array = ma.masked_array(self.real_array) * 10 - mask_array[0, 0, 0] = ma.masked - dtype = mask_array.dtype - lazy_array = as_lazy_data(mask_array) - lazy_dtype = np.dtype('int16') - dm = DataManager(self.real_array) - self.assertFalse(dm.has_lazy_data()) - self.assertIsNone(dm._realised_dtype) - self.assertEqual(dm.dtype, dtype) - dm.replace(lazy_array, realised_dtype=lazy_dtype) - self.assertTrue(dm.has_lazy_data()) - self.assertEqual(dm._realised_dtype, lazy_dtype) - self.assertEqual(dm.dtype, lazy_dtype) - self.assertIs(dm._lazy_array, lazy_array) - self.assertArrayEqual(dm.data, mask_array) - - def test_real_with_real__realised_dtype_failure(self): - dm = DataManager(self.real_array) - emsg = 'Cannot set realised dtype, no lazy data is available.' - with self.assertRaisesRegexp(ValueError, emsg): - dm.replace(self.real_array * 10, - realised_dtype=np.dtype('int16')) - self.assertIs(dm._real_array, self.real_array) - self.assertArrayEqual(dm.data, self.real_array) - - def test_real_with_real__promote_shape_with_dtype_failure(self): - data = np.array(666) - dm = DataManager(data) - emsg = 'Cannot set realised dtype, no lazy data is available' - with self.assertRaisesRegexp(ValueError, emsg): - dm.replace(np.array([999]), - realised_dtype=np.dtype('float32')) - self.assertArrayEqual(dm.data, data) - - def test__clear_fill_value(self): - fill_value = 1234 - dm = DataManager(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - dm.replace(np.array(1)) - self.assertIsNone(dm.fill_value) - - def test__clear_fill_value_masked(self): - fill_value = 1234 - dm = DataManager(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - data = ma.masked_array(1, fill_value=4321) - dm.replace(data) - self.assertIsNone(dm.fill_value) - - def test__set_fill_value(self): - fill_value = 1234 - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - dm.replace(np.array(0), fill_value=fill_value) - self.assertEqual(dm.fill_value, fill_value) - - def test__set_fill_value_failure(self): - dm = DataManager(np.array(0)) - self.assertIsNone(dm.fill_value) - emsg = 'Fill value of .* invalid for dtype' - with self.assertRaisesRegexp(ValueError, emsg): - dm.replace(np.array(1), fill_value=1e+20) - - if __name__ == '__main__': tests.main() diff --git a/lib/iris/tests/unit/fileformats/grib/message/test_GribMessage.py b/lib/iris/tests/unit/fileformats/grib/message/test_GribMessage.py index 3bbd9c8e04..88a7d6d9fb 100644 --- a/lib/iris/tests/unit/fileformats/grib/message/test_GribMessage.py +++ b/lib/iris/tests/unit/fileformats/grib/message/test_GribMessage.py @@ -102,8 +102,7 @@ def test_bitmap_present_int_data(self): 6: {'bitMapIndicator': 0, 'bitmap': self.bitmap}, 7: {'codedValues': input_values}}) - result = as_concrete_data(message.data, nans_replacement=ma.masked, - result_dtype=data_type) + result = as_concrete_data(message.data) expected = ma.masked_array(output_values, np.logical_not(self.bitmap)) expected = expected.reshape(self.shape) @@ -121,8 +120,7 @@ def test_bitmap_present_float_data(self): 6: {'bitMapIndicator': 0, 'bitmap': self.bitmap}, 7: {'codedValues': input_values}}) - result = as_concrete_data(message.data, nans_replacement=ma.masked, - result_dtype=data_type) + result = as_concrete_data(message.data) expected = ma.masked_array(output_values, np.logical_not(self.bitmap)) expected = expected.reshape(self.shape) @@ -137,7 +135,7 @@ def test_bitmap__shapes_mismatch(self): 'bitmap': self.bitmap}, 7: {'codedValues': values}}) with self.assertRaisesRegexp(TranslationError, 'do not match'): - as_concrete_data(message.data, nans_replacement=ma.masked) + as_concrete_data(message.data) def test_bitmap__invalid_indicator(self): values = np.arange(12) @@ -146,7 +144,7 @@ def test_bitmap__invalid_indicator(self): 'bitmap': None}, 7: {'codedValues': values}}) with self.assertRaisesRegexp(TranslationError, 'unsupported bitmap'): - as_concrete_data(message.data, nans_replacement=ma.masked) + as_concrete_data(message.data) class Test_data__unsupported(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/grib/message/test__DataProxy.py b/lib/iris/tests/unit/fileformats/grib/message/test__DataProxy.py index 29dcd72120..37b1e38470 100644 --- a/lib/iris/tests/unit/fileformats/grib/message/test__DataProxy.py +++ b/lib/iris/tests/unit/fileformats/grib/message/test__DataProxy.py @@ -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. # @@ -36,20 +36,20 @@ class Test__bitmap(tests.IrisTest): def test_no_bitmap(self): section_6 = {'bitMapIndicator': 255, 'bitmap': None} - data_proxy = _DataProxy(0, 0, 0, 0) + data_proxy = _DataProxy(0, 0, 0) result = data_proxy._bitmap(section_6) self.assertIsNone(result) def test_bitmap_present(self): bitmap = randint(2, size=(12)) section_6 = {'bitMapIndicator': 0, 'bitmap': bitmap} - data_proxy = _DataProxy(0, 0, 0, 0) + data_proxy = _DataProxy(0, 0, 0) result = data_proxy._bitmap(section_6) self.assertArrayEqual(bitmap, result) def test_bitmap__invalid_indicator(self): section_6 = {'bitMapIndicator': 100, 'bitmap': None} - data_proxy = _DataProxy(0, 0, 0, 0) + data_proxy = _DataProxy(0, 0, 0) with self.assertRaisesRegexp(TranslationError, 'unsupported bitmap'): data_proxy._bitmap(section_6) diff --git a/lib/iris/tests/unit/fileformats/grib/save_rules/test_data_section.py b/lib/iris/tests/unit/fileformats/grib/save_rules/test_data_section.py index f7985f731f..b617c83d4c 100644 --- a/lib/iris/tests/unit/fileformats/grib/save_rules/test_data_section.py +++ b/lib/iris/tests/unit/fileformats/grib/save_rules/test_data_section.py @@ -93,32 +93,6 @@ def test_simple(self): # Check the correct data values have been set. self.assertValues(grib_api, np.arange(5)) - def test_masked_with_finite_fill_value(self): - cube = iris.cube.Cube(np.ma.MaskedArray([1.0, 2.0, 3.0, 1.0, 2.0, 3.0], - mask=[0, 0, 0, 1, 1, 1]), - fill_value=2000) - grib_message = mock.sentinel.GRIB_MESSAGE - with mock.patch(GRIB_API) as grib_api: - data_section(cube, grib_message) - # Check the use of a mask has been turned on. - FILL = 2000 - self.assertBitmapOn(grib_api, FILL) - # Check the correct data values have been set. - self.assertValues(grib_api, [1, 2, 3, FILL, FILL, FILL]) - - def test_masked_with_nan_fill_value(self): - cube = iris.cube.Cube(np.ma.MaskedArray([1.0, 2.0, 3.0, 1.0, 2.0, 3.0], - mask=[0, 0, 0, 1, 1, 1]), - fill_value=np.nan) - grib_message = mock.sentinel.GRIB_MESSAGE - with mock.patch(GRIB_API) as grib_api: - data_section(cube, grib_message) - # Check the use of a mask has been turned on and a suitable fill - # value has been chosen. - FILL = self.assertBitmapRange(grib_api, 1, 3) - # Check the correct data values have been set. - self.assertValues(grib_api, [1, 2, 3, FILL, FILL, FILL]) - def test_scaled(self): # If the Cube's units don't match the units required by GRIB # ensure the data values are scaled correctly. @@ -132,39 +106,6 @@ def test_scaled(self): # Check the correct data values have been set. self.assertValues(grib_api, np.arange(5) * 1000) - def test_scaled_with_finite_fill_value(self): - # When re-scaling masked data with a finite fill value, ensure - # the fill value and any filled values are also re-scaled. - cube = iris.cube.Cube(np.ma.MaskedArray([1.0, 2.0, 3.0, 1.0, 2.0, 3.0], - mask=[0, 0, 0, 1, 1, 1]), - standard_name='geopotential_height', units='km', - fill_value=2000) - grib_message = mock.sentinel.GRIB_MESSAGE - with mock.patch(GRIB_API) as grib_api: - data_section(cube, grib_message) - # Check the use of a mask has been turned on. - FILL = 2000 * 1000 - self.assertBitmapOn(grib_api, FILL) - # Check the correct data values have been set. - self.assertValues(grib_api, [1000, 2000, 3000, FILL, FILL, FILL]) - - def test_scaled_with_nan_fill_value(self): - # When re-scaling masked data with a NaN fill value, ensure - # a fill value is chosen which allows for the scaling, and any - # filled values match the chosen fill value. - cube = iris.cube.Cube(np.ma.MaskedArray([-1.0, 2.0, -1.0, 2.0], - mask=[0, 0, 1, 1]), - standard_name='geopotential_height', units='km', - fill_value=np.nan) - grib_message = mock.sentinel.GRIB_MESSAGE - with mock.patch(GRIB_API) as grib_api: - data_section(cube, grib_message) - # Check the use of a mask has been turned on and a suitable fill - # value has been chosen. - FILL = self.assertBitmapRange(grib_api, -1000, 2000) - # Check the correct data values have been set. - self.assertValues(grib_api, [-1000, 2000, FILL, FILL]) - if __name__ == "__main__": tests.main() diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py b/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py index 1e3f0c6e33..1e38baac86 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py @@ -32,83 +32,6 @@ from iris.tests import mock -class TestFillValue(tests.IrisTest): - def setUp(self): - name = 'iris.fileformats.netcdf._assert_case_specific_facts' - patch = mock.patch(name) - patch.start() - self.addCleanup(patch.stop) - - self.engine = mock.Mock() - self.cf = None - self.filename = 'DUMMY' - - def _make_cf_var(self, dtype): - variable = mock.Mock(spec=netCDF4.Variable, - dtype=dtype) - cf_var = mock.MagicMock(spec=iris.fileformats.cf.CFVariable, - cf_data=variable, - cf_name='DUMMY_VAR', - cf_group=mock.Mock(), - dtype=dtype, - shape=(1,)) - return cf_var - - def _test(self, cf_var, expected_fill_value): - cube = _load_cube(self.engine, self.cf, cf_var, self.filename) - self.assertEqual(cube.fill_value, expected_fill_value) - - def test_from_attribute_dtype_f4(self): - # A _FillValue attribute on the netCDF variable should end up as - # the fill_value for the cube. - dtype = np.dtype('f4') - fill_value = 9999. - cf_var = self._make_cf_var(dtype) - cf_var.cf_data._FillValue = fill_value - self._test(cf_var, fill_value) - - def test_from_default_dtype_f4(self): - # Without an explicit _FillValue attribute on the netCDF - # variable, the fill value should be set to `None`. - dtype = np.dtype('f4') - cf_var = self._make_cf_var(dtype) - self._test(cf_var, None) - - def test_from_attribute_dtype_i4(self): - # A _FillValue attribute on the netCDF variable should end up as - # the fill_value for the cube. - dtype = np.dtype('i4') - fill_value = 9999 - cf_var = self._make_cf_var(dtype) - cf_var.cf_data._FillValue = fill_value - self._test(cf_var, fill_value) - - def test_from_default_dtype_i4(self): - # Without an explicit _FillValue attribute on the netCDF - # variable, the fill value should be set to `None`. - dtype = np.dtype('i4') - cf_var = self._make_cf_var(dtype) - self._test(cf_var, None) - - def test_from_attribute_with_scale_offset(self): - # The _FillValue attribute still takes priority even when an - # offset/scale transformation takes place on the data. - dtype = np.dtype('i2') - fill_value = 999 - cf_var = self._make_cf_var(dtype) - cf_var.scale_factor = np.float64(1.5) - cf_var.cf_data._FillValue = fill_value - self._test(cf_var, fill_value) - - def test_from_default_with_scale_offset(self): - # Without an explicit _FillValue attribute on the netCDF - # variable, the fill value should be set to `None`. - dtype = np.dtype('i2') - cf_var = self._make_cf_var(dtype) - cf_var.scale_factor = np.float64(1.5) - self._test(cf_var, None) - - class TestCoordAttributes(tests.IrisTest): @staticmethod def _patcher(engine, cf, cf_group): diff --git a/lib/iris/tests/unit/fileformats/pp/test_as_pairs.py b/lib/iris/tests/unit/fileformats/pp/test_as_pairs.py index 7ba752d90f..7f726613a5 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_as_pairs.py +++ b/lib/iris/tests/unit/fileformats/pp/test_as_pairs.py @@ -51,8 +51,7 @@ def test_field_coords(self): def test_lazy_data(self): cube = self.cube.copy() # "Rebase" the cube onto a lazy version of its data. - cube.replace(cube.lazy_data(), dtype=cube.dtype, - fill_value=cube.fill_value) + cube.data = cube.lazy_data() # Check that lazy data is preserved in save-pairs generation. slices_and_fields = pp.as_pairs(cube) for aslice, _ in slices_and_fields: diff --git a/lib/iris/tests/unit/lazy_data/test_array_masked_to_nans.py b/lib/iris/tests/unit/lazy_data/test_array_masked_to_nans.py deleted file mode 100644 index cba4ff1cb3..0000000000 --- a/lib/iris/tests/unit/lazy_data/test_array_masked_to_nans.py +++ /dev/null @@ -1,111 +0,0 @@ -# (C) British Crown Copyright 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 . -"""Test function :func:`iris._lazy data.array_masked_to_nans`.""" - -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 - - -import numpy as np -import numpy.ma as ma - -from iris._lazy_data import array_masked_to_nans - - -class Test(tests.IrisTest): - def setUp(self): - self.integer_dtypes = (np.dtype('int'), - np.dtype('uint'), - np.dtype('bool')) - - def _common_checks(self, result): - self.assertIsInstance(result, np.ndarray) - self.assertFalse(ma.isMaskedArray(result)) - - def test_masked(self): - mask = [[False, True], [False, False]] - masked_array = ma.masked_array([[1.0, 2.0], [3.0, 4.0]], mask=mask) - - result = array_masked_to_nans(masked_array) - - self._common_checks(result) - self.assertArrayAllClose(np.isnan(result), mask) - result[0, 1] = 777.7 - self.assertArrayAllClose(result, [[1.0, 777.7], [3.0, 4.0]]) - - def test_unmasked(self): - unmasked_array = np.array([1.0, 2.0]) - result = array_masked_to_nans(unmasked_array) - # Non-masked array is returned as-is, without copying. - self.assertIs(result, unmasked_array) - - def test_empty_mask(self): - masked_array = ma.masked_array([1.0, 2.0], mask=[0, 0]) - - result = array_masked_to_nans(masked_array) - - self._common_checks(result) - self.assertArrayAllClose(result, masked_array.data) - - def test_no_mask(self): - masked_array = ma.masked_array([1.0, 2.0], mask=ma.nomask) - - result = array_masked_to_nans(masked_array) - - self._common_checks(result) - self.assertArrayAllClose(result, masked_array.data) - - def test_masked__integers(self): - for dtype in self.integer_dtypes: - mask = [[False, True], [False, False]] - data = [[1, 2], [3, 4]] - masked_array = ma.masked_array(data, mask=mask, dtype=dtype) - - result = array_masked_to_nans(masked_array) - - self._common_checks(result) - self.assertEqual(result.dtype, np.dtype('f8')) - self.assertArrayAllClose(np.isnan(result), mask) - masker = 777.7 - result[0, 1] = masker - expected = np.array(data, dtype=dtype).astype('f8') - expected[0, 1] = masker - self.assertArrayAllClose(result, expected) - - def test_unmasked__integers(self): - for dtype in self.integer_dtypes: - unmasked_array = np.array([1, 2], dtype=dtype) - result = array_masked_to_nans(unmasked_array) - # Non-masked array is returned as-is, without copying. - self.assertIs(result, unmasked_array) - - def test_no_mask__integers(self): - for dtype in self.integer_dtypes: - masked_array = ma.masked_array([1, 2], dtype=dtype, mask=ma.nomask) - - result = array_masked_to_nans(masked_array) - - self._common_checks(result) - self.assertEqual(result.dtype, dtype) - - -if __name__ == '__main__': - tests.main() diff --git a/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py b/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py index 16b0cf7b29..886622f3ab 100644 --- a/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py +++ b/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py @@ -27,7 +27,6 @@ import numpy.ma as ma from iris._lazy_data import as_concrete_data, as_lazy_data, is_lazy_data -from iris.tests import mock class Test_as_concrete_data(tests.IrisTest): @@ -44,49 +43,11 @@ def test_concrete_masked_input_data(self): self.assertFalse(is_lazy_data(result)) def test_lazy_data(self): - # Minimal testing as as_concrete_data is a wrapper to - # convert_nans_array data = np.arange(24).reshape((2, 12)) lazy_array = as_lazy_data(data) - - sentinel = mock.sentinel.data - with mock.patch('iris._lazy_data.convert_nans_array') as conv_nans: - conv_nans.return_value = sentinel - result = as_concrete_data(lazy_array) - self.assertEqual(sentinel, result) - - # Check call to convert_nans_array - self.assertEqual(conv_nans.call_count, 1) - args, kwargs = conv_nans.call_args - arg, = args - self.assertFalse(is_lazy_data(arg)) - self.assertArrayEqual(arg, data) - self.assertEqual(kwargs, {}) - - def test_lazy_data_pass_thru_kwargs(self): - # Minimal testing as as_concrete_data is a wrapper to - # convert_nans_array - data = np.arange(24).reshape((2, 12)) - lazy_array = as_lazy_data(data) - nans_replacement = 7 - result_dtype = np.int16 - - sentinel = mock.sentinel.data - with mock.patch('iris._lazy_data.convert_nans_array') as conv_nans: - conv_nans.return_value = sentinel - result = as_concrete_data(lazy_array, - nans_replacement=nans_replacement, - result_dtype=result_dtype) - self.assertEqual(sentinel, result) - - # Check call to convert_nans_array - self.assertEqual(conv_nans.call_count, 1) - args, kwargs = conv_nans.call_args - arg, = args - self.assertFalse(is_lazy_data(arg)) - self.assertArrayEqual(arg, data) - self.assertEqual(kwargs, {'nans_replacement': nans_replacement, - 'result_dtype': result_dtype, }) + result = as_concrete_data(lazy_array) + self.assertFalse(is_lazy_data(result)) + self.assertArrayEqual(result, data) if __name__ == '__main__': diff --git a/lib/iris/tests/unit/lazy_data/test_convert_nans_array.py b/lib/iris/tests/unit/lazy_data/test_convert_nans_array.py deleted file mode 100644 index f3abb6aaf4..0000000000 --- a/lib/iris/tests/unit/lazy_data/test_convert_nans_array.py +++ /dev/null @@ -1,132 +0,0 @@ -# (C) British Crown Copyright 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 . -""" -Test :func:`iris._lazy data.convert_nans_array` function. - -""" - -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 - -import numpy as np -import numpy.ma as ma - -from iris._lazy_data import convert_nans_array - - -class Test(tests.IrisTest): - def setUp(self): - self.array = np.array([[1.0, np.nan], - [3.0, 4.0]]) - - def test_pass_thru_masked_array_float(self): - array = ma.arange(10, dtype=np.float) - result = convert_nans_array(array) - self.assertIsInstance(result, ma.MaskedArray) - self.assertIs(result, array) - - def test_pass_thru_masked_array_integer(self): - array = ma.arange(10) - result = convert_nans_array(array) - self.assertIsInstance(result, ma.MaskedArray) - self.assertIs(result, array) - - def test_pass_thru_array_integer(self): - array = np.arange(10) - result = convert_nans_array(array) - self.assertNotIsInstance(result, ma.MaskedArray) - self.assertIs(result, array) - - def test_no_nans(self): - array = np.array([[1.0, 2.0], - [3.0, 4.0]]) - result = convert_nans_array(array) - self.assertNotIsInstance(result, ma.MaskedArray) - self.assertIs(result, array) - - def test_nans_masked(self): - result = convert_nans_array(self.array, - nans_replacement=ma.masked) - self.assertIsInstance(result, ma.MaskedArray) - self.assertArrayEqual(result.mask, [[False, True], - [False, False]]) - dummy = 666.0 - result[0, 1] = dummy - self.assertArrayEqual(result.data, [[1.0, dummy], - [3.0, 4.0]]) - self.assertIsNot(result, self.array) - # Check that fill value is the "standard" one for the type. - expected = ma.masked_array(self.array[0], dtype=self.array.dtype) - self.assertEqual(result.fill_value, expected.fill_value) - - def test_nans_filled(self): - fill_value = 666.0 - result = convert_nans_array(self.array, - nans_replacement=fill_value) - self.assertNotIsInstance(result, ma.MaskedArray) - self.assertIs(result, self.array) - expected = np.array([[1.0, fill_value], - [3.0, 4.0]]) - self.assertArrayEqual(result, expected) - - def test_nans_filled_failure(self): - fill_value = 1e+20 - dtype = np.dtype('int16') - emsg = 'Fill value of .* invalid for array result .*' - with self.assertRaisesRegexp(ValueError, emsg): - convert_nans_array(self.array, - nans_replacement=fill_value, - result_dtype=dtype) - - def test_nans_none_failure(self): - emsg = 'Array contains unexpected NaNs' - with self.assertRaisesRegexp(ValueError, emsg): - convert_nans_array(self.array) - - def test_result_dtype_cast_float_to_int(self): - dtype = np.int - result = convert_nans_array(self.array, - nans_replacement=ma.masked, - result_dtype=dtype) - self.assertIsInstance(result, ma.MaskedArray) - expected = ma.masked_array([[1, 2], - [3, 4]], - dtype=dtype) - expected[0, 1] = ma.masked - self.assertArrayEqual(result, expected) - self.assertIsNot(result, self.array) - - def test_filled_result_dtype_cast_float_to_int(self): - fill_value = 666 - dtype = np.int - result = convert_nans_array(self.array, - nans_replacement=fill_value, - result_dtype=dtype) - self.assertNotIsInstance(result, ma.MaskedArray) - expected = np.array([[1, fill_value], - [3, 4]], - dtype=dtype) - self.assertArrayEqual(result, expected) - self.assertIsNot(result, self.array) - - -if __name__ == '__main__': - tests.main() diff --git a/lib/iris/util.py b/lib/iris/util.py index 4ca915445c..263babac8e 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -984,8 +984,7 @@ def new_axis(src_cube, scalar_coord=None): # If the source cube is a Masked Constant, it is changed here to a Masked # Array to allow the mask to gain an extra dimension with the data. if src_cube.has_lazy_data(): - new_cube = iris.cube.Cube(src_cube.lazy_data()[None], - dtype=src_cube.dtype) + new_cube = iris.cube.Cube(src_cube.lazy_data()[None]) else: if isinstance(src_cube.data, ma.core.MaskedConstant): new_data = ma.array([np.nan], mask=[True]) @@ -994,7 +993,6 @@ def new_axis(src_cube, scalar_coord=None): new_cube = iris.cube.Cube(new_data) new_cube.metadata = src_cube.metadata - new_cube.fill_value = src_cube.fill_value for coord in src_cube.aux_coords: if scalar_coord and scalar_coord == coord: @@ -1076,9 +1074,7 @@ def as_compatible_shape(src_cube, target_cube): new_order = [order.index(i) for i in range(len(order))] new_data = np.transpose(new_data, new_order).copy() - new_cube = iris.cube.Cube(new_data.reshape(new_shape), - fill_value=src_cube.fill_value, - dtype=src_cube.dtype) + new_cube = iris.cube.Cube(new_data.reshape(new_shape)) new_cube.metadata = copy.deepcopy(src_cube.metadata) # Record a mapping from old coordinate IDs to new coordinates,