astropy/astropy — pull request #1776 by mhvk (2013-11-12 18:49:34+00:00)
Title: Quantity float default

This follows on the discussion in #1759, where there seemed general support for making `Quantity` contain float by default, i.e., if no explicit `dtype` is given, the input is converted to `float` if it cannot safely represent float (hence, `int` and `bool` get converted).

Note that this PR does *not* disable the internal checks for integer quantities, i.e., `iq *= 0.1` will still raise a `TypeError` if the result cannot stored as an integer. This is unlike is the case for numpy, but I'm still not convinced we should allow the automatic truncation.

p.s the PR uses #1775; the first commit is from that. The critical addition to `Quantity.__new__` is:
```
if dtype is None and not np.can_cast(np.float, value.dtype,
'same_kind'):
value = value.astype(np.float)
```