This is mostly a reminder that it would be good to have a ColumnAttribute class for mixin columns, which would allow classes that can be used as Table columns to override some aspects. E.g., Quantity could override __str__ if it were a column such that the unit would not be displayed on every line. Similarly, Time and SkyCoord might define to_pandas methods which do some standard conversion that pandas can deal with (see #3504; a bit trickier would be to make this round-trip... some way to store the class used in the pandas dtype?).
From #3011 (comment), the logic internal to Table might be something like:
- There is an attribute and it is a subclass of
ColumnAttribute[Base]: initialise _col_info using it.
- It is present but
None: use default ColumnAttribute for initalisation.
- It is not present: either try using default, or let user explicitly do it (and take responsibiiity, say with
create_mixin_column(s), which might do some tests and then just set that attribute).
This is mostly a reminder that it would be good to have a
ColumnAttributeclass for mixin columns, which would allow classes that can be used asTablecolumns to override some aspects. E.g.,Quantitycould override__str__if it were a column such that the unit would not be displayed on every line. Similarly,TimeandSkyCoordmight defineto_pandasmethods which do some standard conversion thatpandascan deal with (see #3504; a bit trickier would be to make this round-trip... some way to store the class used in the pandas dtype?).From #3011 (comment), the logic internal to
Tablemight be something like:ColumnAttribute[Base]: initialise_col_infousing it.None: use defaultColumnAttributefor initalisation.create_mixin_column(s), which might do some tests and then just set that attribute).