Skip to content

Commit 35c75f5

Browse files
jthielenmax-sixty
authored andcommitted
Update Terminology page to account for multidimensional coordinates (#3410)
* Update Terminology page to account for multidimensional coordinates * Update xarray-docs conda environment file * Add change to whats-new.rst * Modify example description for multidimensional coords based on suggestion
1 parent 9c6b457 commit 35c75f5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

doc/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,12 @@ How to build the *xarray* documentation
286286
Requirements
287287
~~~~~~~~~~~~
288288
Make sure to follow the instructions on :ref:`creating a development environment above <contributing.dev_env>`, but
289-
to build the docs you need to use the environment file ``doc/environment.yml``.
289+
to build the docs you need to use the environment file ``ci/requirements/doc.yml``.
290290

291291
.. code-block:: none
292292
293293
# Create and activate the docs environment
294-
conda env create -f doc/environment.yml
294+
conda env create -f ci/requirements/doc.yml
295295
conda activate xarray-docs
296296
297297
# or with older versions of Anaconda:

doc/terminology.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ Terminology
2727

2828
----
2929

30-
**Coordinate:** An array that labels a dimension of another ``DataArray``. Loosely, the coordinate array's values can be thought of as tick labels along a dimension. There are two types of coordinate arrays: *dimension coordinates* and *non-dimension coordinates* (see below). A coordinate named ``x`` can be retrieved from ``arr.coords[x]``. A ``DataArray`` can have more coordinates than dimensions because a single dimension can be assigned multiple coordinate arrays. However, only one coordinate array can be a assigned as a particular dimension's dimension coordinate array. As a consequence, ``len(arr.dims) <= len(arr.coords)`` in general.
30+
**Coordinate:** An array that labels a dimension or set of dimensions of another ``DataArray``. In the usual one-dimensional case, the coordinate array's values can loosely be thought of as tick labels along a dimension. There are two types of coordinate arrays: *dimension coordinates* and *non-dimension coordinates* (see below). A coordinate named ``x`` can be retrieved from ``arr.coords[x]``. A ``DataArray`` can have more coordinates than dimensions because a single dimension can be labeled by multiple coordinate arrays. However, only one coordinate array can be a assigned as a particular dimension's dimension coordinate array. As a consequence, ``len(arr.dims) <= len(arr.coords)`` in general.
3131

3232
----
3333

34-
**Dimension coordinate:** A coordinate array assigned to ``arr`` with both a name and dimension name in ``arr.dims``. Dimension coordinates are used for label-based indexing and alignment, like the index found on a :py:class:`pandas.DataFrame` or :py:class:`pandas.Series`. In fact, dimension coordinates use :py:class:`pandas.Index` objects under the hood for efficient computation. Dimension coordinates are marked by ``*`` when printing a ``DataArray`` or ``Dataset``.
34+
**Dimension coordinate:** A one-dimensional coordinate array assigned to ``arr`` with both a name and dimension name in ``arr.dims``. Dimension coordinates are used for label-based indexing and alignment, like the index found on a :py:class:`pandas.DataFrame` or :py:class:`pandas.Series`. In fact, dimension coordinates use :py:class:`pandas.Index` objects under the hood for efficient computation. Dimension coordinates are marked by ``*`` when printing a ``DataArray`` or ``Dataset``.
3535

3636
----
3737

38-
**Non-dimension coordinate:** A coordinate array assigned to ``arr`` with a name in ``arr.dims`` but a dimension name *not* in ``arr.dims``. These coordinate arrays are useful for auxiliary labeling. However, non-dimension coordinates are not indexed, and any operation on non-dimension coordinates that leverages indexing will fail. Printing ``arr.coords`` will print all of ``arr``'s coordinate names, with the assigned dimensions in parentheses. For example, ``coord_name (dim_name) 1 2 3 ...``.
38+
**Non-dimension coordinate:** A coordinate array assigned to ``arr`` with a name in ``arr.coords`` but *not* in ``arr.dims``. These coordinates arrays can be one-dimensional or multidimensional, and they are useful for auxiliary labeling. As an example, multidimensional coordinates are often used in geoscience datasets when :doc:`the data's physical coordinates (such as latitude and longitude) differ from their logical coordinates <examples/multidimensional-coords>`. However, non-dimension coordinates are not indexed, and any operation on non-dimension coordinates that leverages indexing will fail. Printing ``arr.coords`` will print all of ``arr``'s coordinate names, with the corresponding dimension(s) in parentheses. For example, ``coord_name (dim_name) 1 2 3 ...``.
3939

4040
----
4141

doc/whats-new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Documentation
5252
:py:meth:`Dataset.resample` and explicitly state that a
5353
datetime-like dimension is required. (:pull:`3400`)
5454
By `Justus Magin <https://github.com/keewis>`_.
55+
- Update the terminology page to address multidimensional coordinates. (:pull:`3410`)
56+
By `Jon Thielen <https://github.com/jthielen>`_.
5557

5658
Internal Changes
5759
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)