astropy/astropy — pull request #2559 by mdboom (2014-06-06 14:27:51+00:00)
Title: Unit compose and equivalencies

In #2544, it was noted that the following does not work in master (nor is resolved by that PR):
```
u.Unit("rad/s").compose(units=(u.day,), equivalencies=u.dimensionless_angles())
ERROR: UnitsError: Cannot represent unit rad / s in terms of the given units [astropy.units.core]
```
(even though `(1*u.Unit("rad/s")).to(u.day**-1, equivalencies=u.dimensionless_angles())` works fine)

Looking at this further, there seems to be a general problem with using equivalencies in `compose`; e.g., to me at least, in the following, the first and last are surprising:
```
In [3]: u.Unit("arcsec").compose(units=(u.pc,), equivalencies=u.parallax())
Out[3]: [Unit("pc")]

In [4]: u.Unit("arcsec").compose(units=(u.degree,), equivalencies=u.parallax())
Out[4]: [Unit("0.000277778 deg")]

In [5]: u.Unit("degree").compose(units=(u.pc,), equivalencies=u.parallax())
Out[5]: [Unit("pc")]
```

One question this brings up is whether for `compose` we need equivalencies at all? They would seem to make sense only for quantities, not units (in particular for ones that include an offset, like the various `doppler_*`).