def test_rename_mixin_columns(mixin_cols):
 t = QTable(mixin_cols)
 tc = t.copy()
 t.rename_column('m', 'mm')
 assert (t.colnames == ['i', 'a', 'b', 'mm'])
 if isinstance(t['mm'], table_helpers.ArrayWrapper):
  assert np.all((t['mm'].data == tc['m'].data))
 elif isinstance(t['mm'], coordinates.SkyCoord):
  assert np.all((t['mm'].ra == tc['m'].ra))
  assert np.all((t['mm'].dec == tc['m'].dec))
 else:
  assert np.all((t['mm'] == tc['m']))

def test_rename_mixin_columns ( mixin_cols ) : t = QTable ( mixin_cols ) tc = t . copy ( ) t . rename_column ( 'm' , 'mm' ) assert ( t . colnames == [ 'i' , 'a' , 'b' , 'mm' ] ) if isinstance ( t [ 'mm' ] , table_helpers . ArrayWrapper ) : assert np . all ( ( t [ 'mm' ] . data == tc [ 'm' ] . data ) ) elif isinstance ( t [ 'mm' ] , coordinates . SkyCoord ) : assert np . all ( ( t [ 'mm' ] . ra == tc [ 'm' ] . ra ) ) assert np . all ( ( t [ 'mm' ] . dec == tc [ 'm' ] . dec ) ) else : assert np . all ( ( t [ 'mm' ] == tc [ 'm' ] ) )
rename a mixin column .