eteq/astropy — pull request #28 by eteq (2014-05-09 06:59:33+00:00)
Title: added lookup_name to frames

This adds a way for frame objects to figure out what their aliases are in a particular transform graph. This was triggered by discussion in astropy/astropy#2422 with @taldcroft about how to make frames visible on `SkyCoord`.

The plan there was to just add `name` property to the frame classes. The problem with that is this: these names (or perhaps "aliases") are *not* unique to the class. They instead are unique to the *transform graph*. The idea is that this might allow similar frames to be used with different names in different contexts (e.g., you might want FK5 to just be 'fk5' in the current coordinates framework, but in gWCS, it might be better named something like 'fk5_spatial_coordinate' or whatever). But that's impossible if you force the "short" name to live on the class itself.

So this PR is a modification of that idea to instead add a `lookup_name` class method. For `SkyCoord`, this just means where originally we had been thinking ``self.frame.name``, after this PR it could be ``self.frame.lookup_name(frame_transform_graph)``. Let me know what you think, @taldcroft.