xray-pydata/xray — pull request #128 by shoyer (2014-05-14 06:05:53+00:00)
Title: Expose more information in DataArray.__repr__

This PR changes the `DataArray` representation so that it displays more of the information associated with a data array:

- "Coordinates" are indicated by their name and the `repr` of the
corresponding pandas.Index object (to indicate how they are used as
indices).
- "Linked" dataset variables are also listed.
* These are other variables in the dataset associated with a DataArray
which are also indexed along with the DataArray.
* They accessible from the `dataset` attribute or by indexing the data
array with a string.
* Perhaps their most convenient aspect is that they enable [`groupby`
operations by
name](http://xray.readthedocs.org/en/latest/tutorial.html#apply) for
DataArray objets.
* This is an admitedly somewhat confusing (though convenient) notion that I
am considering [removing](https://github.com/xray-
pydata/xray/issues/117), but we if we don't remove them we should
certainly expose their existence more clearly, given the potential
benefits in expressiveness and costs in performance.

Questions to resolve:

- Is "Linked dataset variables" the best name for these?
- Perhaps it would be useful to show more information about these linked
variables, such as their dimensions and/or shape?

Examples of the new repr are on nbviewer:
http://nbviewer.ipython.org/gist/shoyer/94936e5b71613683d95a