Skip to content

Commit ed8a3e1

Browse files
committed
Use simpler criterion for deleting info['class']; fix docstring fail
1 parent 9ae9c69 commit ed8a3e1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

astropy/table/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ def table_info(tbl, option='attributes', out=''):
9595

9696
if 'class' in info.colnames:
9797
# Remove 'class' info column if all table columns are the same class
98-
# and they are not mixin columns.
98+
# and they are the default column class for that table.
9999
uniq_types = set(type(col) for col in cols)
100-
if len(uniq_types) == 1 and not tbl._is_mixin_column(cols[0]):
100+
if len(uniq_types) == 1 and isinstance(cols[0], tbl.ColumnClass):
101101
del info['class']
102102

103103
if 'n_bad' in info.colnames and np.all(info['n_bad'] == 0):

astropy/utils/data_info.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,14 @@ def __call__(self, option='attributes', out=''):
230230
>>> c.info()
231231
dtype = int32
232232
unit = m
233+
class = Column
233234
n_bad = 0
234235
length = 2
235236
236237
>>> c.info(['attributes', 'stats'])
237238
dtype = int32
238239
unit = m
240+
class = Column
239241
mean = 1.5
240242
std = 0.5
241243
min = 1

0 commit comments

Comments
 (0)