astropy/astropy — pull request #2963 by mhvk (2014-09-19 19:52:30+00:00)
Title: Ensure Column-ness is stripped for boolean ufuncs; faster copy

In current master, comparisons of columns, like `t['a'] > 0.` correctly return an `ndarray` rather than a `Column` instance (see #1446 and #1685). However, this is not true for ufuncs like `np.isfinite` (see example below). This PR fixes that oversight, by checking at the end of `__array_wrap__` whether the function that was used should return an array or a column.

At the same time, it includes a small rewrite of `copy` that avoids unnecessarily running through `Column` instantiation.

I'll add a changelog entry once we agree where it should go.

Note that both are part of #1839; I'm splitting them out here as I think this is a bug that is easier to review separately (and yes, I'll take the rebase hit...).

```
In [1]: from astropy.table import Column; import numpy as np

In [2]: a = Column([0., np.inf, 1.], name='a')

In [3]: a
Out[3]:

array([ 0., inf, 1.])

In [4]: np.isinf(a)
Out[4]:

array([False, True, False], dtype=bool)
```