From 7f23e9abc2ceeedd4229e520650fd314cbad77ee Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Tue, 6 Feb 2018 12:19:56 +0000 Subject: [PATCH 1/2] DOC: lazy data docstring made clearer --- lib/iris/cube.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 57dd4078f8..e99bd61956 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -1588,17 +1588,21 @@ def ndim(self): def lazy_data(self): """ - Return a lazy array representing the Cube data. + Return a "lazy array" representing the Cube data. A lazy array + describes an array whose data values have not been loaded into memory + from disk. - Accessing this method will never cause the data to be loaded. + Accessing this method will never cause the Cube data to be loaded. Similarly, calling methods on, or indexing, the returned Array - will not cause the Cube to have loaded data. + will not cause the Cube data to be loaded. - If the data have already been loaded for the Cube, the returned - Array will be a new lazy array wrapper. + If the Cube data have already been loaded (for example by calling + :meth:`~iris.cube.Cube.data`), the returned Array will be the loaded + cube data represented as a lazy array object. Note that this does _not_ + make the Cube data lazy again; the Cube data remains loaded in memory. Returns: - A lazy array, representing the Cube data array. + A lazy array, representing the Cube data. """ return self._data_manager.lazy_data() From 7d45dc9cc6c5d5b82ad58f2e6ae72ffba7e469ad Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Wed, 7 Feb 2018 09:58:26 +0000 Subject: [PATCH 2/2] Clarify "view" --- lib/iris/cube.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/iris/cube.py b/lib/iris/cube.py index e99bd61956..063f860406 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -1597,9 +1597,10 @@ def lazy_data(self): will not cause the Cube data to be loaded. If the Cube data have already been loaded (for example by calling - :meth:`~iris.cube.Cube.data`), the returned Array will be the loaded - cube data represented as a lazy array object. Note that this does _not_ - make the Cube data lazy again; the Cube data remains loaded in memory. + :meth:`~iris.cube.Cube.data`), the returned Array will be a view of the + loaded cube data represented as a lazy array object. Note that this + does _not_ make the Cube data lazy again; the Cube data remains loaded + in memory. Returns: A lazy array, representing the Cube data.