Skip to content

Commit

Permalink
Clarify the return type of iris.load (AVD-1899) (#4462)
Browse files Browse the repository at this point in the history
* Clarify the return type of iris.load

* Update docs/src/userguide/loading_iris_cubes.rst

Clarify wording to avoid overloaded term

Co-authored-by: Ruth Comer <[email protected]>

Co-authored-by: Ruth Comer <[email protected]>
  • Loading branch information
wjbenfold and rcomer authored Jan 4, 2022
1 parent c1bf6d8 commit b22940c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/src/userguide/loading_iris_cubes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ The ``air_potential_temperature`` cubes were 4 dimensional with:

.. note::

The result of :func:`iris.load` is **always** a
:class:`list of cubes <iris.cube.CubeList>`.
Anything that can be done with a Python :class:`list` can be done
with the resultant list of cubes. It is worth noting, however, that
there is no inherent order to this
:class:`list of cubes <iris.cube.CubeList>`.
Because of this, indexing may be inconsistent. A more consistent way to
extract a cube is by using the :class:`iris.Constraint` class as
described in :ref:`constrained-loading`.
The result of :func:`iris.load` is **always** a :class:`iris.cube.CubeList`
(even if it only contains one :class:`iris.cube.Cube` - see
:ref:`strict-loading`). Anything that can be done with a Python
:class:`list` can be done with an :class:`iris.cube.CubeList`.

The order of this list should not be relied upon. Ways of loading a
specific cube or cubes are covered in :ref:`constrained-loading` and
:ref:`strict-loading`.

.. hint::

Expand Down Expand Up @@ -414,6 +413,7 @@ PartialDateTime this becomes simple:
Notice how the dates printed are between the range specified in the ``st_swithuns_daterange``
and that they span multiple years.

.. _strict-loading:

Strict Loading
--------------
Expand Down

0 comments on commit b22940c

Please sign in to comment.