From cbd4d1d2b90abff7f41a3ea24e6e997e52240028 Mon Sep 17 00:00:00 2001 From: lbdreyer Date: Fri, 3 Apr 2020 11:17:50 +0100 Subject: [PATCH] Update docs CubeList.extract method --- .../docchange_2020-Apr-03_extract_clarification.txt | 1 + lib/iris/cube.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 docs/iris/src/whatsnew/contributions_3.0.0/docchange_2020-Apr-03_extract_clarification.txt diff --git a/docs/iris/src/whatsnew/contributions_3.0.0/docchange_2020-Apr-03_extract_clarification.txt b/docs/iris/src/whatsnew/contributions_3.0.0/docchange_2020-Apr-03_extract_clarification.txt new file mode 100644 index 0000000000..48e2a99e57 --- /dev/null +++ b/docs/iris/src/whatsnew/contributions_3.0.0/docchange_2020-Apr-03_extract_clarification.txt @@ -0,0 +1 @@ +* Updated the documentation for the :meth:`iris.cube.CubeList.extract` method, to specify when a single cube, as opposed to a CubeList, may be returned. diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 0fc381725d..fec68c575c 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -282,7 +282,8 @@ def extract(self, constraints, strict=False): * strict - boolean If strict is True, then there must be exactly one cube which is - filtered per constraint. + filtered per constraint. Note: if a single constraint is given, a + Cube is returned rather than a CubeList. """ return self._extract_and_merge(