From d90d6c308f0d94af90670d4b46cb12e01e454082 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Tue, 25 Nov 2025 17:30:21 +0000 Subject: [PATCH 1/4] matplotlib/matplotlib#30198: Python 3.14 compatible deepcopy. --- lib/iris/coords.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 8b7b30f334..ee497154cb 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -2804,7 +2804,13 @@ def __deepcopy__(self, memo): # numpydoc ignore=SS02 Used if copy.deepcopy is called on a coordinate. """ - new_coord = copy.deepcopy(super(), memo) + # Inspired by matplotlib#30198. + # Replicates the default copy behaviour, which can then be modified below. + cls = self.__class__ + memo[id(self)] = new_coord = cls.__new__(cls) + for key, val in self.__dict__.items(): + setattr(new_coord, key, copy.deepcopy(val, memo)) + # Ensure points and bounds arrays are read-only. new_coord._values_dm.data.flags.writeable = False if new_coord._bounds_dm is not None: From 5562e9907fd18c2939005a60c6e16b660c5fdec3 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Tue, 25 Nov 2025 19:22:57 +0000 Subject: [PATCH 2/4] What's New entry. --- docs/src/whatsnew/3.14.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/whatsnew/3.14.rst b/docs/src/whatsnew/3.14.rst index 7822c900a9..c6bf1fcaf9 100644 --- a/docs/src/whatsnew/3.14.rst +++ b/docs/src/whatsnew/3.14.rst @@ -59,6 +59,8 @@ v3.14.1 (Date TBD) #. Fixed compatibility with NumPy v2 for :meth:`~iris.coords.Coord.guess_bounds` :ref:`See the full entry for more<3_14_1_guess_bounds>`. + #. Tentative compatibility with Python 3.14, pending full CI support later. + :ref:`See Dependencies for more<3_14_dependencies>`. ✨ Features =========== @@ -166,6 +168,8 @@ v3.14.1 (Date TBD) exceed the optimum chunksize set in dask. (:pull:`6730`) +.. _3_14_dependencies: + 🔗 Dependencies =============== @@ -178,6 +182,12 @@ v3.14.1 (Date TBD) so we anticipate that these pins will be wanted for the v3.14 release. (:issue:`6775`, :issue:`6776`, :issue:`6777`, :pull:`6773`) +#. `@trexfeathers`_ provided tentative compatibility with Python 3.14 by fixing + :class:`~iris.coords.DimCoord` ``deepcopy`` behaviour. Note that CI coverage + for Python 3.14 is not yet possible due to problems in some fringe + dependencies, but the relevant tests have been shown to pass in :pull:`6816`. + (:issue:`6775`, :pull:`6817`) + 📚 Documentation ================ From b24219dc94916afcfb91ccb6bc1e5828dd545fd5 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Tue, 25 Nov 2025 20:48:40 +0000 Subject: [PATCH 3/4] What's new line break. --- docs/src/whatsnew/3.14.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/whatsnew/3.14.rst b/docs/src/whatsnew/3.14.rst index c6bf1fcaf9..2ccbb63540 100644 --- a/docs/src/whatsnew/3.14.rst +++ b/docs/src/whatsnew/3.14.rst @@ -59,6 +59,7 @@ v3.14.1 (Date TBD) #. Fixed compatibility with NumPy v2 for :meth:`~iris.coords.Coord.guess_bounds` :ref:`See the full entry for more<3_14_1_guess_bounds>`. + #. Tentative compatibility with Python 3.14, pending full CI support later. :ref:`See Dependencies for more<3_14_dependencies>`. From 43cf6ccd50bfa26557fc6123a157f7507d32a99f Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Tue, 25 Nov 2025 20:49:36 +0000 Subject: [PATCH 4/4] Fix Sphinx bug with duplicated labels. --- docs/src/whatsnew/index.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/whatsnew/index.rst b/docs/src/whatsnew/index.rst index 56eca8c11b..ba9548c467 100644 --- a/docs/src/whatsnew/index.rst +++ b/docs/src/whatsnew/index.rst @@ -6,11 +6,15 @@ What's New in Iris ------------------ -.. include:: 3.14.rst +.. Commented out temporarily because Sphinx can't cope with a file that includes + labels being referenced twice. + include:: 3.14.rst + toctree:: + :maxdepth: 1 + :hidden: .. toctree:: :maxdepth: 1 - :hidden: 3.14.rst 3.13.rst