astropy/astropy — pull request #793 by eteq (2013-02-19 02:24:35+00:00)
Title: Distance setting twice bug

This fixes a couple of bugs I just noticed relating to the `coordinates` `Distance` class and its interaction with coordinate classes.

The first two commits deal with a genuine bug - the cached cartesian representation of the coordinate was not properly being cleared, so setting the distance twice lead to the second distance not being updated. This is a pretty trivial fix, and I added a regression test for it.

The last 3 commits are arguable "features", although I consider them bugs in that they were supposed to be done and were forgotten about (and are also pretty trivial). They deal with integrating `Quantity` with the `Distance` class. Previously, you could not do ``somecoordinate.distance = 2 * u.kpc`` because `Distance` wasn't set up to accept `Quantity`, and this fixes that. This also changes `Distance` to be a subclass of `Quantity`. That was actually the intended behavior, but it was forgotten about until just now.

I realize we're right against the wire for 0.2, but I don't see any reason why we wouldn't include this. The first two commits certainly should go in, as it's unambiguously a bug. If anyone has complaints about the others, I can just move them to a separate PR for 0.2.1/0./3, but as I said before, I think they're actually bugs in that this just adjusts to the originally intended behavior.