Exemplo n.º 1
0
def get_all_graphs(in_dir):
    '''Scans input folder for all files and determine which graphs to create.'''

    all_files = [
        path for path in utils._scandir_rec(in_dir)
        if TIMES_SUBSTRING in path[-1]
    ]
    all_graphs = [
        path.split("/")
        for path in set(["/".join(path[:-2]) for path in all_files])
    ]
    all_graphs = [(path, function_type) for function_type in function_types
                  for path in all_graphs]

    return all_graphs, all_files
Exemplo n.º 2
0
        for j in range(len(mat1[i])):
            if round_sf(mat1[i][j], sf) != round_sf(mat2[i][j], sf):
                return False

    return True


# Folders
adbench_dir = os.path.dirname(os.path.realpath(__file__))
ad_root_dir = os.path.dirname(adbench_dir)
in_dir = f"{ad_root_dir}/tmp"

# Scan folder for all files, and determine which graphs to create
all_files = [
    path for path in utils._scandir_rec(in_dir) if "times" in path[-1]
]
all_graphs = [
    path.split("/")
    for path in list(set(["/".join(path[:-2]) for path in all_files]))
]

for graph_path in all_graphs:
    print("Finding files for graph:", "/".join(graph_path))
    tools = os.listdir("/".join([in_dir] + graph_path))
    all_tests = {}
    for tool in tools:
        tool_files = os.listdir("/".join([in_dir] + graph_path + [tool]))
        time_files = [fn for fn in tool_files if "_times_" in fn]
        files = [fn for fn in tool_files if "_J_" in fn]
Exemplo n.º 3
0
    "Zygote": ("y", "v", "Julia, Zygote")
}

# Folders
adbench_dir = os.path.dirname(os.path.realpath(__file__))
ad_root_dir = os.path.dirname(adbench_dir)
in_dir = os.path.join(ad_root_dir, "tmp")
out_dir = os.path.join(in_dir, "graphs")
static_out_dir_rel = "static"
plotly_out_dir_rel = "plotly"
static_out_dir = os.path.join(out_dir, static_out_dir_rel)
plotly_out_dir = os.path.join(out_dir, plotly_out_dir_rel)

# Scan folder for all files, and determine which graphs to create
all_files = [
    path for path in utils._scandir_rec(in_dir) if TIMES_SUBSTRING in path[-1]
]
all_graphs = [
    path.split("/")
    for path in set(["/".join(path[:-2]) for path in all_files])
]
function_types = [
    "objective ÷ Manual", "objective", "jacobian", "jacobian ÷ objective"
]
all_graphs = [(path, function_type) for function_type in function_types
              for path in all_graphs]
all_graph_dict = {}


def graph_data(build_type, objective, maybe_test_size, function_type):
    '''Creates graph name and graph saving location.'''