astropy/astropy — pull request #1422 by mhvk (2013-09-07 03:36:48+00:00)
Title: Make q[:,np.newaxis] work by using __quantity_view__ for __getitem__

The addition of `copy=False` caused an error in `__getitem__` when one expands an axis (as in `q[:, np.newaxis]`; as this is done in matplotlib for 1D arrays, this is painful...) This is because `__getitem__` used `__quantity_instance__` when really it should have been using a view, `__quantity_view__`. This is corrected in this PR (plus test to ensure it doesn't recur).