Skip to content

Table with mixin column with SkyCoords can't be sorted #9536

@hamogu

Description

@hamogu

Description

A table that contains a mixin Column with Coordinates cannot be sorted.
I suspect that the underlying reason is the same as in #5745, but that issue is are least
listed as a caveat in the docs: http://docs.astropy.org/en/latest/table/mixin_columns.html#details-and-caveats

Unless there is work on SkyCoord under way, I suggest we add this issue to the caveats.
A related Feature request is: #6348

Expected behavior

Sort the table.

Actual behavior

TypeError: 'SkyCoord' object does not support item assignment

Steps to Reproduce

from astropy.coordinates import SkyCoord
from astropy.table import Table
import astropy.units as u

t = Table({'a':[2,1], 'b':SkyCoord(["1:12:43.2 +1:12:43", "1 12 43.2 +1 12 43"], unit=(u.deg, u.hourangle))})
t.sort('a')

System Details

Linux-3.10.0-1062.1.2.el7.x86_64-x86_64-with-centos-7.7.1908-Core
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0]
Numpy 1.16.4
SciPy not installed
astropy 4.0.dev26779

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions