astropy/astropy — pull request #1472 by eteq (2013-09-20 18:49:03+00:00)
Title: Distance to quantity

This is a replacement for #794, which had to be completely re-done with the Quantity -> array change.

Aside from making `Distance` into a `Quantity` subclass, this also adds a `distmod` for the distance modulus. Note that it actually returns a `Quantity` with units of `mag` - it could also easily enough return a float/raw array if that's desired. Probably in the near future we'll have a class for magnitudes and fluxes, though, at which time we should switch to that. And I suspect it will be `Quantity`-based...

One item of note: I had to manually put in properties for `pc`, `kpc`, `Mpc`, `lyr`, and `km`, because these are not "short" unit names, so the automatic attribute conversions don't work. My feeling is that this is really confusing - why are the most common names not included here despite being short? But perhaps that should be a separate PR.

@mdboom, you may want to look over this specifically to check if I violated `six` rules anywhere...

cc @adrn @astrofrog