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
5 changes: 5 additions & 0 deletions docs/iris/src/whatsnew/3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ This document explains the changes made to Iris for this release
Previously, the first tick label would occasionally be duplicated. This also
removes the use of Matplotlib's deprecated ``IndexFormatter``. (:pull:`3857`)

* `@znicholls`_ fixed :meth:`~iris.quickplot._title` to only check ``units.is_time_reference`` if the ``units`` symbol is not used. (:pull:`3902`)

.. _whatsnew 3.0 changes:

Expand Down Expand Up @@ -417,6 +418,9 @@ This document explains the changes made to Iris for this release
* `@owena11`_ identified and optimised a bottleneck in ``FieldsFile`` header
loading due to the use of :func:`numpy.fromfile`. (:pull:`3791`)

* `@znicholls`_ added a test for plotting with the label being taken from the unit's symbol, see :meth:`~iris.tests.test_quickplot.TestLabels.test_pcolormesh_str_symbol` (:pull:`3902`).

* `@znicholls`_ made :func:`~iris.tests.idiff.step_over_diffs` robust to hyphens (``-``) in the input path (i.e. the ``result_dir`` argument) (:pull:`3902`).

.. _Read the Docs: https://scitools-iris.readthedocs.io/en/latest/
.. _Matplotlib: https://matplotlib.org/
Expand Down Expand Up @@ -450,6 +454,7 @@ This document explains the changes made to Iris for this release
.. _@rcomer: https://github.com/rcomer
.. _@jvegasbsc: https://github.com/jvegasbsc
.. _@zklaus: https://github.com/zklaus
.. _@znicholls: https://github.com/znicholls
.. _ESMValTool: https://github.com/ESMValGroup/ESMValTool
.. _v75: https://cfconventions.org/Data/cf-standard-names/75/build/cf-standard-name-table.html
.. _sphinx-panels: https://sphinx-panels.readthedocs.io/en/latest/
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/quickplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _title(cube_or_coord, with_units):

if _use_symbol(units):
units = units.symbol
if units.is_time_reference():
elif units.is_time_reference():
# iris.plot uses matplotlib.dates.date2num, which is fixed to the below unit.
if version.parse(_mpl_version) >= version.parse("3.3"):
days_since = "1970-01-01"
Expand Down
4 changes: 3 additions & 1 deletion lib/iris/tests/idiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ def step_over_diffs(result_dir, action, display=True):
count = len(results)

for count_index, result_fname in enumerate(results):
key = os.path.splitext("-".join(result_fname.split("-")[1:]))[0]
key = os.path.splitext(
"-".join(result_fname.split("result-")[1:])
)[0]
try:
# Calculate the test result perceptual image hash.
phash = imagehash.phash(
Expand Down
3 changes: 3 additions & 0 deletions lib/iris/tests/results/imagerepo.json
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,9 @@
"https://scitools.github.io/test-iris-imagehash/images/v4/bb433d4e94a4c6b9c15adaadc1fb6a469c8de43a3e07904e5f016b57984e1ea1.png",
"https://scitools.github.io/test-iris-imagehash/images/v4/eea16affc05ab500956e974ac53f3d80925ac03f3f81c07e3fa12da1c27e3f80.png"
],
"iris.tests.test_quickplot.TestLabels.test_pcolormesh_str_symbol.0": [
"https://scitools.github.io/test-iris-imagehash/images/v4/eea16affc05ab500956e974ac53f3d80925ac03f3f80c07e3fa12da1c27f3f80.png"
],
"iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_non_cube_coordinate.0": [
"https://scitools.github.io/test-iris-imagehash/images/v4/fa816a85857a955ae17e957ec57e7a81855fc17e3a81c57e1a813a85c57a1a05.png",
"https://scitools.github.io/test-iris-imagehash/images/v4/fe816a85857a957ac07f957ac07f3e80956ac07f3e80c07f3e813e85c07e3f80.png"
Expand Down
7 changes: 7 additions & 0 deletions lib/iris/tests/test_quickplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ def test_pcolormesh(self):

self.check_graphic()

def test_pcolormesh_str_symbol(self):
pcube = self._small().copy()
pcube.coords("level_height")[0].units = "centimeters"
qplt.pcolormesh(pcube)

self.check_graphic()

def test_map(self):
cube = self._slice(["grid_latitude", "grid_longitude"])
qplt.contour(cube)
Expand Down