def main():
    # Init.
    logging.basicConfig(
        level=logging.DEBUG)  # TODO(alessio): INFO once debugged.
    parser = collect_data.InstanceArgumentsParser()
    parser.add_argument('-f',
                        '--filename_suffix',
                        help=('suffix of the exported file'))
    parser.description = ('Exports pre-computed APM module quality assessment '
                          'results into HTML tables')
    args = parser.parse_args()

    # Get the scores.
    src_path = collect_data.ConstructSrcPath(args)
    logging.debug(src_path)
    scores_data_frame = collect_data.FindScores(src_path, args)

    # Export.
    output_filepath = os.path.join(args.output_dir,
                                   _BuildOutputFilename(args.filename_suffix))
    exporter = export.HtmlExport(output_filepath)
    exporter.Export(scores_data_frame)

    logging.info('output file successfully written in %s', output_filepath)
    sys.exit(0)
Пример #2
0
def main():
    # Init.
    # TODO(alessiob): INFO once debugged.
    logging.basicConfig(level=logging.DEBUG)
    parser = InstanceArgumentsParser()
    args = parser.parse_args()

    # Get the scores.
    src_path = collect_data.ConstructSrcPath(args)
    logging.debug(src_path)
    scores_data_frame = collect_data.FindScores(src_path, args)

    # Filter the data by `args.params_to_plot`
    scores_filtered = FilterScoresByParams(scores_data_frame,
                                           args.params_to_plot,
                                           args.eval_score, args.config_dir)

    data_list = sorted(scores_filtered.items())
    data_values = [_FlattenToScoresList(x) for (_, x) in data_list]
    data_labels = [x for (x, _) in data_list]

    _, axes = plt.subplots(nrows=1, ncols=1, figsize=(6, 6))
    axes.boxplot(data_values, labels=data_labels)
    axes.set_ylabel(args.eval_score)
    axes.set_xlabel('/'.join(args.params_to_plot))
    plt.show()
def main():
    # Init.
    # TODO(alessiob): INFO once debugged.
    logging.basicConfig(level=logging.DEBUG)
    parser = _InstanceArgumentsParser()
    args = parser.parse_args()

    # Get the scores.
    src_path = collect_data.ConstructSrcPath(args)
    logging.debug('Src path <%s>', src_path)
    scores_data_frame = collect_data.FindScores(src_path, args)
    all_scores = _ConfigurationAndScores(scores_data_frame, args.params,
                                         args.params_not_to_optimize,
                                         args.config_dir)

    opt_param = _FindOptimalParameter(all_scores, _ExampleWeighting)

    logging.info('Optimal parameter combination: <%s>', opt_param)
    logging.info('It\'s score values: <%s>', all_scores[opt_param])