Skip to content

Commit

Permalink
Added link to UDUNITS-2 database to convert_units docstrings (#5388)
Browse files Browse the repository at this point in the history
Co-authored-by: alex.chamberlain-clay <[email protected]>
  • Loading branch information
acchamber and alex.chamberlain-clay authored Jul 26, 2023
1 parent 66ecb4c commit 3c1b3e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ This document explains the changes made to Iris for this release
section into the user guide, containing advice and use cases to help users
get the best out of Dask with Iris.

#. `@acchamber`_ improved documentation for :meth:`~iris.cube.Cube.convert_units`
and :meth:`~iris.coords.Coord.convert_units` by including a link to the UDUNITS-2
documentation which contains lists of compatible units and aliases for them.

💼 Internal
===========
Expand All @@ -95,5 +98,6 @@ This document explains the changes made to Iris for this release
.. _@acchamber: https://github.com/acchamber



.. comment
Whatsnew resources in alphabetical order:
2 changes: 2 additions & 0 deletions lib/iris/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,8 @@ def convert_units(self, unit):
multiply each value in :attr:`~iris.coords.Coord.points` and
:attr:`~iris.coords.Coord.bounds` by 180.0/:math:`\pi`.
Full list of supported units can be found in the UDUNITS-2 documentation
https://docs.unidata.ucar.edu/udunits/current/#Database
"""
super().convert_units(unit=unit)

Expand Down
3 changes: 3 additions & 0 deletions lib/iris/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@ def convert_units(self, unit):
celsius and subtract 273.15 from each value in
:attr:`~iris.cube.Cube.data`.
Full list of supported units can be found in the UDUNITS-2 documentation
https://docs.unidata.ucar.edu/udunits/current/#Database
This operation preserves lazy data.
"""
Expand Down

0 comments on commit 3c1b3e6

Please sign in to comment.