Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ This document explains the changes made to Iris for this release
as well as some long-standing bugs with vertical coordinates and number
formats. (:pull:`4411`)

#. `@rcomer`_ fixed :meth:`~iris.cube.Cube.subset` to alway return ``None`` if
#. `@rcomer`_ fixed :meth:`~iris.cube.Cube.subset` to alway return ``None`` if
no value match is found. (:pull:`4417`)

#. `@wjbenfold`_ resolved an issue that previously caused regridding with lazy
Expand Down Expand Up @@ -209,10 +209,16 @@ This document explains the changes made to Iris for this release
#. `@rcomer`_ modified a NetCDF saver test to prevent it triggering a numpy
deprecation warning. (:issue:`4374`, :pull:`4376`)

#. `@akuhnregnier`_ removed addition of period from
:func:`~iris.analysis.cartography.wrap_lons` and updated affected tests
using assertArrayAllClose following :issue:`3993`.
(:pull:`4421`)

.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
core dev names are automatically included by the common_links.inc:

.. _@akuhnregnier: https://github.com/akuhnregnier
.. _@bsherratt: https://github.com/bsherratt
.. _@larsbarring: https://github.com/larsbarring
.. _@pdearnshaw: https://github.com/pdearnshaw
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/analysis/cartography.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def wrap_lons(lons, base, period):
# It is important to use 64bit floating precision when changing a floats
# numbers range.
lons = lons.astype(np.float64)
return ((lons - base + period * 2) % period) + base
return ((lons - base) % period) + base


def unrotate_pole(rotated_lons, rotated_lats, pole_lon, pole_lat):
Expand Down
7 changes: 2 additions & 5 deletions lib/iris/tests/unit/cube/test_Cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1662,11 +1662,8 @@ def test_wrap_radians(self):
cube = create_cube(0, 360)
cube.coord("longitude").convert_units("radians")
result = cube.intersection(longitude=(-1, 0.5))
self.assertEqual(
result.coord("longitude").points[0], -0.99483767363676634
)
self.assertEqual(
result.coord("longitude").points[-1], 0.48869219055841207
self.assertArrayAllClose(
result.coord("longitude").points, np.arange(-57, 29) * np.pi / 180
)
self.assertEqual(result.data[0, 0, 0], 303)
self.assertEqual(result.data[0, 0, -1], 28)
Expand Down