akleeman/xray — pull request #70 by shoyer (2014-03-16 06:00:58+00:00)
Title: Improved __repr__/__str__ for xray objects

The new `__repr__` for xray.Dataset is inspired by the representation
for iris.Cube:

Coordinates: (time: 20, dim1: 100, dim2: 50, dim3: 10)
Non-coordinates:
var1 - X X -
var2 - X X -
var3 - X - X
Attributes:
Empty

The new `__repr__` for xray.XArray and xray.DatasetArray shows the actual data
as summarized by `repr(array.data)`, as long as the data is an ndarray or
has fewer than 10^5 elements (~400 KB):

array([[1, 2, 3],
[4, 5, 6]])
Attributes:
foo: bar

`__repr__` not showing the data was a complaint I heard about the prior
representation.

I removed the separate `__str__` implementation so we can have one canonical
string representation (both implementations showed equivalent information).

I am definitely open to suggestions for improving either of these!