astropy/astropy — pull request #2014 by eteq (2014-01-28 21:26:39+00:00)
Title: Add `shape` to coordinates

This was triggered by some of the discussion in #2005, which linked back to #1917 (which in turn was a fix to #1761).

This adds a `shape` property to coordinates. I should have mentioned this in @mwcraig's #1917 or #1761, but I missed that those issues came up. For some background, the lack of `len` was not *entirely* an oversight - it was actually intended initially, when there was some discussion about having "mixed" coordinates (e.g. array RA/Dec, but scalar distance), but since then, it has been changed to look pretty much array-like, in which case `len` makes sense. But if `len` is present, then `shape` should be too. So this PR adds this.

Note that right now I have it marked for 0.3.1 because I'm thinking that if the missing `len` was a bug, then this is too. But if @astrofrog and/or @embray think that's pushing the "bug" definition too much, I can back this out to just the commit that clarifies the exception (which is just a minor change to #1917, essentially). It will all change with APE5 in detail, but what we decide here probably makes sense to carry over to the objects APE5 introduces.