def test_qtable_column_conversion():
 qtab = table.QTable([[1, 2], [3, 4.2]], names=['i', 'f'])
 assert isinstance(qtab['i'], table.column.Column)
 assert isinstance(qtab['f'], table.column.Column)
 qtab['i'].unit = 'km/s'
 assert isinstance(qtab['i'], u.Quantity)
 assert isinstance(qtab['f'], table.column.Column)
 assert isinstance(qtab['i'][0], u.Quantity)
 assert isinstance(qtab[0]['i'], u.Quantity)
 assert (not isinstance(qtab['f'][0], u.Quantity))
 assert (not isinstance(qtab[0]['f'], u.Quantity))
 qtab['f'].unit = u.dex((u.cm / (u.s ** 2)))
 assert isinstance(qtab['f'], u.Dex)

def test_qtable_column_conversion ( ) : qtab = table . QTable ( [ [ 1 , 2 ] , [ 3 , 4.2 ] ] , names = [ 'i' , 'f' ] ) assert isinstance ( qtab [ 'i' ] , table . column . Column ) assert isinstance ( qtab [ 'f' ] , table . column . Column ) qtab [ 'i' ] . unit = 'km/s' assert isinstance ( qtab [ 'i' ] , u . Quantity ) assert isinstance ( qtab [ 'f' ] , table . column . Column ) assert isinstance ( qtab [ 'i' ] [ 0 ] , u . Quantity ) assert isinstance ( qtab [ 0 ] [ 'i' ] , u . Quantity ) assert ( not isinstance ( qtab [ 'f' ] [ 0 ] , u . Quantity ) ) assert ( not isinstance ( qtab [ 0 ] [ 'f' ] , u . Quantity ) ) qtab [ 'f' ] . unit = u . dex ( ( u . cm / ( u . s ** 2 ) ) ) assert isinstance ( qtab [ 'f' ] , u . Dex )
ensures that a qtable that gets assigned a unit switches to be quantity-y .