Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the return type of iris.load (AVD-1899) #4462

Merged
merged 2 commits into from
Jan 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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