Exemplo n.º 1
0
def store_results_csv(list_of_results, filename):
    logging.debug("Store evaluation results to csv file: " + filename)
    [path, filename] = gdo.check_filepath(filename)

    with open(path + filename + ".csv", 'w') as csvfile:
        csvwriter = csv.DictWriter(
            csvfile, fieldnames=list_of_results[0].to_dict().keys())
        csvwriter.writeheader()
        for r in list_of_results:
            csvwriter.writerow(r.to_dict())
Exemplo n.º 2
0
def load_stats_from_file(datadir):
    [path, filename] = gdo.check_filepath(datadir + "/stats.json")

    if not os.path.isdir(path):
        ## TO DO: raise error
        return

    if not ".json" in filename:
        filename += ".json"

    with open(path + filename) as jsonfile:
        data = json.load(jsonfile)

    return data
Exemplo n.º 3
0
def store_results_json(list_of_results, filename):
    logging.debug("Store evaluation results to json file: " + filename)
    [path, filename] = gdo.check_filepath(filename)

    with open(path + filename + ".json", 'w') as jsonfile:
        json.dump(list_of_results, jsonfile, cls=meta.My_JSON_Encoder)