'Save Layout to disk.
Parameters
fname : str
The file name (e.g. \'my_layout.lout\').
See Also
read_layout'

def save(self, fname):

    x = self.pos[:, 0]
    y = self.pos[:, 1]
    width = self.pos[:, 2]
    height = self.pos[:, 3]
    if fname.endswith('.lout'):
        out_str = ('%8.2f    %8.2f    %8.2f    %8.2f\n' % self.box)
    elif fname.endswith('.lay'):
        out_str = ''
    else:
        raise ValueError('Unknown    layout    type.    Should    be    of    type    .lout    or    .lay.')
    for ii in range(x.shape[0]):
        out_str += ('%03d    %8.2f    %8.2f    %8.2f    %8.2f    %s\n' % (self.ids[ii], x[ii], y[ii], width[ii], height[ii], self.names[ii]))
    f = open(fname, 'w')
    f.write(out_str)
    f.close()
