From 7aec09239896619183033ec8cc32b0f0903c07be Mon Sep 17 00:00:00 2001 From: James Frost Date: Mon, 27 Oct 2025 16:27:51 +0000 Subject: [PATCH] Remove custom __deepcopy__ for DimCoord It causes a RecursionError under python 3.14 as the super() proxy object is now copied, instead of its copy implementation being used. This change does lose the read-only latching on copy that DimCoords currently have. Fixes #6762 --- lib/iris/coords.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index d6d0262760..fbf1b85ee4 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -2794,19 +2794,6 @@ 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. - - 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: - new_coord._bounds_dm.data.flags.writeable = False - return new_coord - @property def circular(self): return self._metadata_manager.circular