File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ This document explains the changes made to Iris for this release
5252 printing these objects skips metadata elements that are set to None or an
5353 empty string or dictionary. (:pull: `4040 `)
5454
55+ #. `@Badboy-16 `_ implemented a ``CubeList.copy() `` method to return a
56+ ``CubeList `` object instead of a ``list ``. (:pull: `4094 `)
57+
5558
5659🐛 Bugs Fixed
5760=============
@@ -170,6 +173,7 @@ This document explains the changes made to Iris for this release
170173 core dev names are automatically included by the common_links.inc:
171174
172175 .. _@akuhnregnier : https://github.com/akuhnregnier
176+ .. _@Badboy-16 : https://github.com/Badboy-16
173177.. _@gcaria : https://github.com/gcaria
174178.. _@MHBalsmeier : https://github.com/MHBalsmeier
175179
@@ -189,4 +193,4 @@ This document explains the changes made to Iris for this release
189193.. _Python 3.8 : https://www.python.org/downloads/release/python-380/
190194.. _README.md : https://github.com/SciTools/iris#-----
191195.. _xxhash : http://cyan4973.github.io/xxHash/
192- .. _conda-lock : https://github.com/conda-incubator/conda-lock
196+ .. _conda-lock : https://github.com/conda-incubator/conda-lock
Original file line number Diff line number Diff line change @@ -707,6 +707,13 @@ def realise_data(self):
707707 """
708708 _lazy .co_realise_cubes (* self )
709709
710+ def copy (self ):
711+ """
712+ Return a CubeList when CubeList.copy() is called.
713+ """
714+ if type (self ) == CubeList :
715+ return deepcopy (self )
716+
710717
711718def _is_single_item (testee ):
712719 """
Original file line number Diff line number Diff line change @@ -602,5 +602,14 @@ def test_realise_data(self):
602602 )
603603
604604
605+ class Test_CubeList_copy (tests .IrisTest ):
606+ def setUp (self ):
607+ self .cube_list = iris .cube .CubeList ()
608+ self .copied_cube_list = self .cube_list .copy ()
609+
610+ def test_copy (self ):
611+ self .assertIsInstance (self .copied_cube_list , iris .cube .CubeList )
612+
613+
605614if __name__ == "__main__" :
606615 tests .main ()
You can’t perform that action at this time.
0 commit comments