diff --git a/docs/src/whatsnew/3.14.rst b/docs/src/whatsnew/3.14.rst index 7822c900a9..823a3249c4 100644 --- a/docs/src/whatsnew/3.14.rst +++ b/docs/src/whatsnew/3.14.rst @@ -60,6 +60,9 @@ 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 +169,8 @@ v3.14.1 (Date TBD) exceed the optimum chunksize set in dask. (:pull:`6730`) +.. _3_14_dependencies: + 🔗 Dependencies =============== @@ -174,10 +179,16 @@ v3.14.1 (Date TBD) handles additional shapefile types and projections. (:issue:`6126`, :pull:`6129`) #. `@pp-mo`_ added a temporary dependency pins for Python<3.14, dask<2025.10.0 and - netCDF4<1.7.3. All of these introduce problems that won't necessarily be fixed soon, - so we anticipate that these pins will be wanted for the v3.14 release. + netCDF4<1.7.3. Edit 2025-12-03: the Python pin has now been removed in + :pull:`6817`. (: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 ================ 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 diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 8b7b30f334..1013353759 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -2798,13 +2798,15 @@ def __init__( #: Whether the coordinate wraps by ``coord.units.modulus``. self.circular = circular - def __deepcopy__(self, memo): # numpydoc ignore=SS02 - """coord.__deepcopy__() -> Deep copy of coordinate. + def __deepcopy__(self, memo): + """Return a deep copy of the DimCoord, with read-only points and bounds.""" + # 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)) - Used if copy.deepcopy is called on a coordinate. - - """ - new_coord = copy.deepcopy(super(), 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: diff --git a/pyproject.toml b/pyproject.toml index 02036fb046..ae99aaa554 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,9 +50,7 @@ keywords = [ license = "BSD-3-Clause" license-files = ["LICENSE"] name = "scitools-iris" -# NOTE: currently pinning to avoid Python 3.14 -# see : https://github.com/SciTools/iris/issues/6775 -requires-python = ">=3.11,<3.14" +requires-python = ">=3.11" [project.urls] Code = "https://github.com/SciTools/iris"