def write_section(outfile, section, settings):
    """Writes a scoring function specific section to the final.ini file"""
    outfile.write('\n[%s]\n' % section)
    for setting, param in settings.items():
        if setting == 'scaling':
            if param[0] == 'scaling_const':
                outfile.write('scaling_const = %f\n' % param[1])
            elif param[0] == 'scaling_rvec':
                outfile.write('scaling_rvec = %s\n' % param[1])
        else:
            outfile.write('%s = %s\n' % (setting, str(param)))
