def convert_all_files(): all_files = get_files(os.getcwd()) single_files = [f for f in all_files if f.split('.')[-1][0] is 'o'] GTP.convert(single_files) wildcard_files = [(os.path.dirname(f) + '/' + os.path.basename(f).split('.')[-2] + '*') for f in single_files] for wildcard in set(wildcard_files): matching_files = [] for file in single_files: if fnmatch.fnmatch(file, wildcard): matching_files.append(file) GTP_m.convert(matching_files) create_bubble_chart(get_files(os.getcwd()))
def convert(filename): the_key = "" # CPU0" the_interval = 0.8 # millisecs all_frames = [] for files in filename: frame = gtp.get_frame(files, the_key, 'DEBUG') [index, nth] = get_index(frame) frame.Time_end[frame.index[np.cumsum(nth) - 1]] = frame.Time.max() frame = frame.reset_index(drop=True) temp = pd.DataFrame(np.array(frame.Time_end - frame.Time), columns=['Time_diff']) temp['Key'] = frame.Key temp['index'] = [item for sublist in index for item in sublist] temp = temp.pivot(index='index', columns='Key', values='Time_diff') all_frames.append(temp) avg_duration = get_average_duration(all_frames) stats = output_stats(all_frames, filename) frame.Time_end = avg_duration frame.Time = frame.Time_end.shift(1) frame.Time.iloc[0] = 0 render_template(frame, the_interval, set_file_name(filename), get_links(filename), stats) return frame
def get_links(filename): [dir_path, fname] = get_base_path(filename) name = [gtp.set_file_name(file) for file in fname] links = [(dir_path + n) for n in name] return links
def convert(filename): the_key = "" # CPU0" the_interval = 0.8 # millisecs all_frames = [] for files in filename: frame = gtp.get_frame(files, the_key) [index, nth] = get_index(frame) frame.Time_end[frame.index[np.cumsum(nth)-1]] = frame.Time.max() frame = frame.reset_index(drop=True) temp = pd.DataFrame(np.array(frame.Time_end - frame.Time), columns=['Time_diff']) temp['Key'] = frame.Key temp['index'] = [item for sublist in index for item in sublist] temp = temp.pivot(index='index', columns='Key', values='Time_diff') all_frames.append(temp) avg_duration = get_average_duration(all_frames) stats = output_stats(all_frames, filename) frame.Time_end = avg_duration frame.Time = frame.Time_end.shift(1) frame.Time.iloc[0] = 0 render_template(frame, the_interval, set_file_name(filename), get_links(filename), stats) return frame
def convert_all_files(): all_files = get_files(os.getcwd()) single_files = [f for f in all_files if f.split('.')[-1][0] is 'o'] GTP.convert(single_files) wildcard_files = [ (os.path.dirname(f) + '/' + os.path.basename(f).split('.')[-2] + '*') for f in single_files ] for wildcard in set(wildcard_files): matching_files = [] for file in single_files: if fnmatch.fnmatch(file, wildcard): matching_files.append(file) GTP_m.convert(matching_files) create_bubble_chart(get_files(os.getcwd()))