# Path: visual/visual_util.py
# def interpolate_curve(orig_x, orig_y, new_x):
# def read_csv(filepath, skipfirst=True, convert2num=True):
# def read_topo(filepath, window=40):
# def hms_to_seconds(time_format):
# def examine_log_time(task, experiment):
# def examine_brute_force(task, experiment):
# def plot_curves(line_x, line_y, xlabel, ylabel, 
#                 title, legends=None, filename=None,
#                 fontsize=14,
#                 line_color=None,
#                 line_style=None,
#                 line_w=3.0,
#                 figsize=(8, 6)
#                ):
# def plot_curves_shaded(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def smooth_curve(x, y, window):
# def plot_curves_shadedV2(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_fish_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_walker_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# 
# Path: visual/visual_info.py
# USE_TIME_AS_X = 2
# BF_EVOLUTION = 1
# SINGLE_TOPO_FILE = 3


import init_path
import os
import glob
import argparse
import numpy as np
from copy import deepcopy
from visual import visual_util
from visual import visual_info
    # iterate through the result file
    task_data = {}
    for experiment_file in glob.glob(task_path + '/*'):
        if experiment_file.endswith('.pdf'): continue
        if 'ignore' in experiment_file: continue
        if os.path.isdir(experiment_file): continue

        experiment_name = experiment_file.split('/')[-1].split('.')[0]
        experiment_name = experiment_name.replace('NTE', 'NGE')
        print('\t', experiment_name)
        
        if experiment_file.endswith('.csv'):
            data = visual_util.read_csv(experiment_file)
        elif experiment_file.endswith('.npy'):
            data = visual_util.read_topo(experiment_file)
        else:
            raise RuntimeError('Found a file type that is not supported')

        experiment_data = {}

        experiment_data['generation'] = [x[0] for x in data]


        if visual_info.special_requirement[task_name][experiment_name] == \
               visual_info.BF_EVOLUTION:
            print('Start to retrieve brute force evolution process')
            experiment_data2 = \
                visual_util.examine_brute_force(task_name, experiment_name)
            experiment_data = {**experiment_data, **experiment_data2}
        elif visual_info.special_requirement[task_name][experiment_name] == \

# Path: visual/visual_util.py
# def interpolate_curve(orig_x, orig_y, new_x):
# def read_csv(filepath, skipfirst=True, convert2num=True):
# def read_topo(filepath, window=40):
# def hms_to_seconds(time_format):
# def examine_log_time(task, experiment):
# def examine_brute_force(task, experiment):
# def plot_curves(line_x, line_y, xlabel, ylabel, 
#                 title, legends=None, filename=None,
#                 fontsize=14,
#                 line_color=None,
#                 line_style=None,
#                 line_w=3.0,
#                 figsize=(8, 6)
#                ):
# def plot_curves_shaded(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def smooth_curve(x, y, window):
# def plot_curves_shadedV2(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_fish_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_walker_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# 
# Path: visual/visual_info.py
# USE_TIME_AS_X = 2
# BF_EVOLUTION = 1
# SINGLE_TOPO_FILE = 3


# Path: visual/vis_data.py
import init_path
import os
import glob
import argparse
import numpy as np
from copy import deepcopy
from visual import visual_util
from visual import visual_info

    # iterate through the result file
    task_data = {}
    for experiment_file in glob.glob(task_path + '/*'):
        if experiment_file.endswith('.pdf'): continue
        if 'ignore' in experiment_file: continue
        if os.path.isdir(experiment_file): continue

        experiment_name = experiment_file.split('/')[-1].split('.')[0]
        experiment_name = experiment_name.replace('NTE', 'NGE')
        print('\t', experiment_name)
        
        if experiment_file.endswith('.csv'):
            data = visual_util.read_csv(experiment_file)
        elif experiment_file.endswith('.npy'):
            data = visual_util.read_topo(experiment_file)
        else:
            raise RuntimeError('Found a file type that is not supported')

        experiment_data = {}

        experiment_data['generation'] = [x[0] for x in data]


        if visual_info.special_requirement[task_name][experiment_name] == \
               visual_info.BF_EVOLUTION:
            print('Start to retrieve brute force evolution process')
            experiment_data2 = \
                visual_util.examine_brute_force(task_name, experiment_name)
            experiment_data = {**experiment_data, **experiment_data2}
        elif visual_info.special_requirement[task_name][experiment_name] == \

                visual_info.USE_TIME_AS_X: