Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a utility for flattening Aux Coords #3030

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4222298
Adding a utility for flattening Aux Coords (e.g. for later use in ext…
duncanwp May 24, 2018
4b19906
Adding a NotImplemented error for coordinates with more than 2 dimens…
duncanwp Jan 20, 2019
18a563d
Minor refactoring to tidy up tests
duncanwp Jan 20, 2019
38af4b5
Split out flatten_cube tests
duncanwp Jan 20, 2019
6a4f9dc
Mergeback 2.2.x (#3256)
pp-mo Feb 1, 2019
0f519e1
Test with newest cf-units: no longer called cf_units. (#3265)
pp-mo Feb 19, 2019
a76afdc
Avoid numpy FutureWarning about indexing with sequence. (#3267)
pp-mo Feb 21, 2019
a7aa2c7
Revert "Avoid numpy FutureWarning about indexing with sequence. (#326…
lbdreyer Feb 22, 2019
129ae41
Revert "Test with newest cf-units: no longer called cf_units. (#3265)…
pp-mo Feb 22, 2019
45a18ab
Get licence header test working again. (#3272)
pp-mo Feb 25, 2019
337f6f0
corrected mistakes in contiguity checking docstring (#3291)
corinnebosley Mar 6, 2019
7bc4d5a
Avoid numpy FutureWarning about indexing with sequence. (#3276)
pp-mo Feb 22, 2019
4f26e80
Test with newest cf-units: no longer called cf_units. (#3277)
pp-mo Feb 22, 2019
bbcfae7
Fix for non-calendar datetimes. (#3259)
pp-mo Feb 27, 2019
400abd2
Fix problem with factories in iris.util.new_axis(). (#3263)
pp-mo Feb 27, 2019
3237313
Added a timeout to stop requests.get hanging on platforms with no int…
wilbertcs Mar 14, 2019
d40a3a8
Fix for small plot changes with freetype 2.10. (#3297)
pp-mo May 9, 2019
cc5017c
Attempt to fix Sphinx import. (#3310)
pp-mo May 10, 2019
c732c02
Imagehash listfile for fixbranch (#3311)
pp-mo May 10, 2019
535d763
Coord nan equal (#3283)
pp-mo May 10, 2019
859e0c5
Dask landsea masks bugfix (#3255)
pp-mo May 20, 2019
6e26263
Remove underscore in whatsnew
lbdreyer May 29, 2019
7968001
Remove note from userguide that is out of date.
lbdreyer May 30, 2019
f8e95a8
Update copyright years in license headers
lbdreyer May 29, 2019
3872614
Add explicit sphinx import (#3322)
lbdreyer Jun 3, 2019
b209642
Merge pull request #3316 from lbdreyer/221_mergeback_rebase
bjlittle Jun 4, 2019
64cb28c
Adding a utility for flattening Aux Coords (e.g. for later use in ext…
duncanwp May 24, 2018
b356cb0
Adding a NotImplemented error for coordinates with more than 2 dimens…
duncanwp Jan 20, 2019
308123c
Minor refactoring to tidy up tests
duncanwp Jan 20, 2019
24831fb
Split out flatten_cube tests
duncanwp Jan 20, 2019
1b187a3
Merge remote-tracking branch 'origin/flatten_aux_coord' into flatten_…
duncanwp Jun 7, 2019
94da0f9
Updating copyright year
duncanwp Jun 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ git:

install:
- >
export IRIS_TEST_DATA_REF="2f3a6bcf25f81bd152b3d66223394074c9069a96";
export IRIS_TEST_DATA_REF="dba47566a9147645fea586f94a138e0a8d45a48e";
export IRIS_TEST_DATA_SUFFIX=$(echo "${IRIS_TEST_DATA_REF}" | sed "s/^v//");

# Cut short doctest phase under Python 2 : now only supports Python 3
Expand Down Expand Up @@ -125,17 +125,20 @@ install:
fi

script:
- if [[ $TEST_TARGET == 'default' ]]; then
python -m iris.tests.runner --default-tests --system-tests --coding-tests --print-failed-images --num-processors=3;
# Capture install-dir: As a test command must be last for get Travis to check
# the RC, so it's best to start each operation with an absolute cd.
- INSTALL_DIR=$(pwd)

- >
if [[ $TEST_TARGET == 'default' ]]; then
export IRIS_REPO_DIR=$INSTALL_DIR;
python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=3;
fi

- if [[ $TEST_TARGET == 'example' ]]; then
python -m iris.tests.runner --example-tests --print-failed-images --num-processors=3;
fi

# Capture install-dir: As a test command must be last for get Travis to check
# the RC, so it's best to start each operation with an absolute cd.
- INSTALL_DIR=$(pwd)

- >
if [[ $TEST_TARGET == 'doctest' ]]; then
MPL_RC_DIR=$HOME/.config/matplotlib;
Expand Down
4 changes: 3 additions & 1 deletion docs/iris/src/sphinxext/custom_class_autodoc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2015, Met Office
# (C) British Crown Copyright 2010 - 2019, Met Office
#
# This file is part of Iris.
#
Expand All @@ -20,6 +20,8 @@

from sphinx.ext import autodoc
from sphinx.ext.autodoc import *
from sphinx.util import force_decode
from sphinx.util.docstrings import prepare_docstring

import inspect

Expand Down
4 changes: 0 additions & 4 deletions docs/iris/src/userguide/cube_statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ For an example of using this functionality, the
in the gallery takes a zonal mean of an ``XYT`` cube by using the
``collapsed`` method with ``latitude`` and ``iris.analysis.MEAN`` as arguments.

You cannot partially collapse a multi-dimensional coordinate. See
:ref:`cube.collapsed <partially_collapse_multi-dim_coord>` for more
information.

.. _cube-statistics-collapsing-average:

Area averaging
Expand Down
16 changes: 16 additions & 0 deletions docs/iris/src/whatsnew/2.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Iris 2.2 Features
discontiguous points in coordinates can be explicitly masked
using another new feature :func:`iris.util.mask_cube`.

* :func:`iris.util.array_equal` now has a 'withnans' keyword, which provides
a NaN-tolerant array comparison.


Iris 2.2 Dependency updates
=============================
Expand All @@ -89,8 +92,21 @@ Bugs Fixed
* "Gracefully filling..." warnings are now only issued when the coordinate or
bound data is actually masked.


Bugs fixed in v2.2.1
--------------------

* Iris can now correctly unpack a column of header objects when saving a
pandas DataFrame to a cube.

* fixed a bug in :meth:`iris.util.new_axis` : copying the resulting cube
resulted in an exception, if it contained an aux-factory.

* :class:`iris.coords.AuxCoord`'s can now test as 'equal' even when the points
or bounds arrays contain NaN values, if values are the same at all points.
Previously this would fail, as conventionally "NaN != NaN" in normal
floating-point arithmetic.



Documentation Changes
Expand Down
6 changes: 4 additions & 2 deletions lib/iris/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2018, Met Office
# (C) British Crown Copyright 2010 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -1341,7 +1341,9 @@ def interp_order(length):

# Collapse array to its final data shape.
slices = [slice(None)] * array.ndim
slices[-1] = 0
endslice = slice(0, 1) if len(slices) == 1 else 0
slices[-1] = endslice
slices = tuple(slices) # Numpy>=1.16 : index with tuple, *not* list.

if isinstance(array.dtype, np.float):
data = array[slices]
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/analysis/_interpolation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2014 - 2017, Met Office
# (C) British Crown Copyright 2014 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/analysis/calculus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2017, Met Office
# (C) British Crown Copyright 2010 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down
3 changes: 2 additions & 1 deletion lib/iris/analysis/cartography.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2018, Met Office
# (C) British Crown Copyright 2010 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -717,6 +717,7 @@ def project(cube, target_proj, nx=None, ny=None):
index = list(index)
index[xdim] = slice(None, None)
index[ydim] = slice(None, None)
index = tuple(index) # Numpy>=1.16 : index with tuple, *not* list.
new_data[index] = cartopy.img_transform.regrid(ll_slice.data,
source_x, source_y,
source_cs,
Expand Down
8 changes: 5 additions & 3 deletions lib/iris/coords.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2018, Met Office
# (C) British Crown Copyright 2010 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -817,11 +817,13 @@ def __eq__(self, other):
eq = self._as_defn() == other._as_defn()
# points comparison
if eq:
eq = iris.util.array_equal(self.points, other.points)
eq = iris.util.array_equal(self.points, other.points,
withnans=True)
# bounds comparison
if eq:
if self.has_bounds() and other.has_bounds():
eq = iris.util.array_equal(self.bounds, other.bounds)
eq = iris.util.array_equal(self.bounds, other.bounds,
withnans=True)
else:
eq = self.bounds is None and other.bounds is None

Expand Down
2 changes: 1 addition & 1 deletion lib/iris/experimental/stratify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2017, Met Office
# (C) British Crown Copyright 2017 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/fileformats/name_loaders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2013 - 2017, Met Office
# (C) British Crown Copyright 2013 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down
Loading