glue-viz/glue — pull request #109 by astrofrog (2012-10-04 03:18:37+00:00)
Title: Use OrderedDict for component list to preserve order

When making scatter plots, it was bugging me that the order of components was different from the original catalog (for example, fluxes/magnitudes were no longer in the original order in which they were stored - e.g. HJK instead of JHK). I think the reason they were sorted was because the order was random anyway due to using a dict, so this PR switches that to an OrderedDict and includes a backport of this class for Python 2.6. Now the order of components matches that of the input.

One remaining issue - the 'Pixel Axis 0' and 'World 0' components are near the start - I think the way around that is to not store these special components in ``self._components``, but instead to store those special components in another attribute, and add them dynamically when accessing the Data.components property. What do you think?