diff --git a/docs/src/developers_guide/contributing_code_formatting.rst b/docs/src/developers_guide/contributing_code_formatting.rst index 1a3573d135..5b726b41e7 100644 --- a/docs/src/developers_guide/contributing_code_formatting.rst +++ b/docs/src/developers_guide/contributing_code_formatting.rst @@ -39,7 +39,7 @@ linted according to our ``.flake8`` configuration file. Note that, for each ``.pre-commit-config.yaml`` git hook. Additionally, you may wish to enable ``black`` for your preferred -`editor/IDE `_. +`editor/IDE `_. With the ``pre-commit`` configured, the output of performing a ``git commit`` will look similar to:: diff --git a/lib/iris/coord_categorisation.py b/lib/iris/coord_categorisation.py index d299cbeaa4..1553835ae9 100644 --- a/lib/iris/coord_categorisation.py +++ b/lib/iris/coord_categorisation.py @@ -93,7 +93,7 @@ def vectorised_fn(*args): # Private "helper" function def _pt_date(coord, time): """ - Return the date of a time-coordinate point. + Return the datetime of a time-coordinate point. Args: @@ -103,14 +103,11 @@ def _pt_date(coord, time): value of a coordinate point Returns: - datetime.date + cftime.datetime """ # NOTE: All of the currently defined categorisation functions are # calendar operations on Time coordinates. - # - All these currently depend on Unit::num2date, which is deprecated (!!) - # - We will want to do better, when we sort out our own Calendars. - # - For now, just make sure these all call through this one function. - return coord.units.num2date(time) + return coord.units.num2date(time, only_use_cftime_datetimes=True) # --------------------------------------------