What’s New in Iris#
v3.3 (18 Aug 2022) [release candidate]#
This document explains the changes made to Iris for this release (View all changes.)
v3.3.0 Release Highlights
The highlights for this minor release of Iris include:
We’ve added support for datums, loading them from NetCDF when the
iris.FUTURE.datum_support
flag is set.We’ve greatly improved the speed of linear interpolation.
We’ve added the function
iris.pandas.as_cubes()
for richer conversion from Pandas.We’ve improved the functionality of
iris.util.mask_cube()
.We’ve improved the functionality and performance of the
iris.analysis.PERCENTILE
aggregator.We’ve completed implementation of our Benchmarking infrastructure.
And finally, get in touch with us on GitHub if you have any issues or feature requests for improving Iris. Enjoy!
📢 Announcements#
Welcome to @krikru who made their first contribution to Iris 🎉
✨ Features#
@schlunma added weighted aggregation over “group coordinates”:
aggregated_by()
now accepts the keyword weights if aWeightedAggregator
is used. (Issue #4581, PR #4589)@wjbenfold added support for
false_easting
andfalse_northing
toMercator
. (Issue #3107, PR #4524)@rcomer and @wjbenfold (reviewer) implemented lazy aggregation for the
iris.analysis.PERCENTILE
aggregator. (PR #3901)@pp-mo fixed cube arithmetic operation for cubes with meshes. (Issue #4454, PR #4651)
@wjbenfold added support for CF-compliant treatment of
standard_parallel
andscale_factor_at_projection_origin
toMercator
. (Issue #3844, PR #4609)@wjbenfold added support datums associated with coordinate systems (e.g.
GeogCS
other subclasses ofCoordSystem
). Loading of datum information from a netCDF file only happens when theiris.FUTURE.datum_support
flag is set. (Issue #4619, PR #4704)@wjbenfold and @stephenworsley (reviewer) added a maximum run length aggregator (
MAX_RUN
). (PR #4676)@wjbenfold and @rcomer (reviewer) added a
climatological
keyword toaggregated_by()
that causes the climatological flag to be set and the point for each cell to equal its first bound, thereby preserving the time of year. (Issue #1422, Issue #4098, Issue #4665, PR #4723)@wjbenfold and @pp-mo (reviewer) implemented the
PolarStereographic
CRS. (Issue #4770, PR #4773)@rcomer and @wjbenfold (reviewer) enabled passing of the
numpy.percentile()
keywords through thePERCENTILE
aggregator. (PR #4791)@wjbenfold and @bjlittle (reviewer) implemented
iris.plot.fill_between()
andiris.quickplot.fill_between()
. (Issue #3493, PR #4647)@rcomer and @bjlittle (reviewer) re-wrote
iris.util.mask_cube()
to provide lazy evaluation and greater flexibility with respect to input types. (Issue #3936, PR #4889)@stephenworsley and @lbdreyer added a new kwarg
expand_extras
toiris.util.new_axis()
which can be used to specify instances ofAuxCoord
,CellMeasure
andAncillaryVariable
which should also be expanded to map to the new axis. (PR #4896)@stephenworsley updated to the latest CF Standard Names Table
v79
(19 March 2022). (PR #4910)@trexfeathers and @lbdreyer (reviewer) added
iris.pandas.as_cubes()
, which provides richer conversion from PandasSeries
/DataFrame
s to one or moreCube
s. This includes: n-dimensional datasets,AuxCoord
s,CellMeasure
s,AncillaryVariable
s, and multi-dimensional coordinates. (PR #4890)
🐛 Bugs Fixed#
@rcomer reverted part of the change from PR #3906 so that
iris.plot.plot()
no longer defaults to placing a “Y” coordinate (e.g. latitude) on the y-axis of the plot. (Issue #4493, PR #4601)@rcomer enabled passing of scalar objects to
plot()
andscatter()
. (PR #4616)@rcomer fixed
aggregated_by()
with mdtol for 1D cubes where an aggregated section is entirely masked, reported at Issue #3190. (PR #4246)@rcomer ensured that a
matplotlib.axes.Axes
’s position is preserved when Iris replaces it with acartopy.mpl.geoaxes.GeoAxes
, fixing Issue #1157. (PR #4273)@rcomer fixed
nearest_neighbour_index()
for edge cases where the requested point is float and the coordinate has integer bounds, reported at Issue #2969. (PR #4245)@rcomer modified bounds setting on
DimCoord
instances so that the order of the cell bounds is automatically reversed to match the coordinate’s direction if necessary. This is consistent with the Bounds for 1-D coordinate variables subsection of the Cell Boundaries section of the CF Conventions and ensures that contiguity is preserved if a coordinate’s direction is reversed. (Issue #3249, Issue #423, Issue #4078, Issue #3756, PR #4466)@wjbenfold and @evertrol prevented an
AttributeError
being logged tostderr
when aCFReader
that fails to initialise is garbage collected. (Issue #3312, PR #4646)@wjbenfold fixed plotting of circular coordinates to extend kwarg arrays as well as the data. (Issue #466, PR #4649)
@wjbenfold and @rcomer (reviewer) corrected the axis on which masking is applied when an aggregator adds a trailing dimension. (PR #4755)
@rcomer and @pp-mo ensured that all methods to create or modify a
iris.cube.CubeList
check that it only contains cubes. According to code comments, this was supposedly already the case, but there were several bugs and loopholes. (Issue #1897, PR #4767)@rcomer modified cube arithmetic to handle mismatches in the cube’s data array type. This prevents masks being lost in some cases and therefore resolves Issue #2987. (PR #3790)
@krikru and @rcomer updated
iris.quickplot
such that the colorbar is added to the correctaxes
when specified as a keyword argument to a plotting routine. Otherwise, by default the colorbar will be added to the current axes of the current figure. (PR #4894)@rcomer and @bjlittle (reviewer) modified
iris.util.mask_cube()
so it either works in place or returns a new cube (Issue #3717, PR #4889)
💣 Incompatible Changes#
@rcomer and @bjlittle (reviewer) updated Iris’s calendar handling to be consistent with
cf-units
version 3.1. In line with the Calendar section in version 1.9 of the CF Conventions, we now use “standard” rather than the deprecated “gregorian” label for the default calendar. Units may still be instantiated withcalendar="gregorian"
but their calendar attribute will be silently changed to “standard”. This may cause failures in code that explicitly checks the calendar attribute. (PR #4847)
🚀 Performance#
@wjbenfold added caching to the calculation of the points array in a
DimCoord
created usingfrom_regular()
. (PR #4698)@wjbenfold introduced caching in
_lazy_data._optimum_chunksize()
andiris.fileformats.pp_load_rules._epoch_date_hours()
to reduce time spent repeating calculations. (PR #4716)@pp-mo made
add_aux_factory()
faster. (PR #4718)@wjbenfold and @rcomer (reviewer) permitted the fast percentile aggregation method to be used on masked data when the missing data tolerance is set to 0. (Issue #4735, PR #4755)
@wjbenfold improved the speed of linear interpolation using
iris.analysis.trajectory.interpolate()
(PR #4366)NumPy
v1.23
behaviour changes mean thatiris.experimental.ugrid.utils.recombine_submeshes()
now uses ~3x as much memory; testing shows a ~16-million point mesh will now use ~600MB. Investigated by @pp-mo and @trexfeathers. (Issue #4845)
🔥 Deprecations#
@trexfeathers and @lbdreyer (reviewer) deprecated
iris.pandas.as_cube()
in favour of the newiris.pandas.as_cubes()
- see ✨ Features for more details. (PR #4890)
🔗 Dependencies#
@rcomer introduced the
nc-time-axis >=1.4
minimum pin, reflecting that we no longer use the deprecatednc_time_axis.CalendarDateTime
when plotting against time coordinates. (PR #4584)@wjbenfold and @bjlittle (reviewer) unpinned
pillow
. (PR #4826)@rcomer introduced the
cf-units >=3.1
minimum pin, reflecting the alignment of calendar behaviour in the two packages (see Incompatible Changes). (PR #4847)@bjlittle introduced the
sphinx-gallery >=0.11.0
minimum pin. (PR #4885)@trexfeathers updated the install process to work with setuptools
>=v64
, makingv64
the minimum compatible version. (PR #4903)@stephenworsley and @trexfeathers introduced the
shapely !=1.8.3
pin, avoiding a bug caused by its interaction with cartopy. (PR #4911, PR #4917)
📚 Documentation#
@tkknight added a page to show the issues that have been voted for. See Voted Issues. (Issue #3307, PR #4617)
@wjbenfold added a note about fixing proxy URLs in lockfiles generated because dependencies have changed. (PR #4666)
@lbdreyer moved most of the User Guide’s
iris.Constraint
examples from Loading Iris Cubes to Cube Extraction and added an example of constraining on bounded time. (PR #4656)@tkknight adopted the PyData Sphinx Theme for the documentation. (Discussion #4344, PR #4661)
@tkknight updated our developers guidance to show our intent to adopt numpydoc strings and fixed some API documentation rendering. See Docstrings. (Issue #4657, PR #4689)
@trexfeathers and @lbdreyer added a page with examples of converting various mesh formats into the Iris Mesh Data Model. (PR #4739)
@rcomer updated the “Load a Time Series of Data From the NEMO Model” gallery example. (PR #4741)
@wjbenfold added developer documentation to highlight some of the utilities offered by
iris.IrisTest
and how to update CML and other output files. (Issue #4544, PR #4600)@trexfeathers and @abooton modernised the Iris logo to be SVG format. (PR #3935)
💼 Internal#
@trexfeathers and @pp-mo finished implementing a mature benchmarking infrastructure (see Benchmarking), building on 2 hard years of lessons learned 🎉. (PR #4477, PR #4562, PR #4571, PR #4583, PR #4621)
@wjbenfold used the aforementioned benchmarking infrastructure to introduce deep (large 3rd dimension) loading and realisation benchmarks. (PR #4654)
@wjbenfold made
iris.tests.stock.simple_1d()
respect thewith_bounds
argument. (PR #4658)@lbdreyer replaced nose with pytest as Iris’ test runner. (PR #4734)
@bjlittle and @trexfeathers (reviewer) migrated to GitHub Actions for Continuous-Integration. (PR #4503)
@pp-mo made tests run certain linux executables from the Python env, specifically ncdump and ncgen. These could otherwise fail when run in IDEs such as PyCharm and Eclipse, which don’t automatically include the Python env bin in the system PATH. (PR #4794)
@trexfeathers and @pp-mo improved generation of stock NetCDF files. (PR #4827, PR #4836)
@rcomer removed some now redundant testing functions. (PR #4838, PR #4878)
@bjlittle and @jamesp (reviewer) and @lbdreyer (reviewer) extended the GitHub Continuous-Integration to cover testing on
py38
,py39
, andpy310
. (PR #4840)@bjlittle and @trexfeathers (reviewer) adopted setuptools-scm for automated
iris
package versioning. (PR #4841)@bjlittle and @trexfeathers (reviewer) added building, testing and publishing of
iris
PyPIsdist
and binarywheels
as part of our GitHub Continuous-Integration. (PR #4849)@rcomer and @wjbenfold (reviewer) used
pytest
parametrization to streamline the gallery test code. (PR #4792)@trexfeathers improved settings to better working with
setuptools_scm
. (PR #4925)