MCPcopy Create free account
hub / github.com/cwida/ALP / PlotMaker

Class PlotMaker

publication/plotter/plot_maker.py:17–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15warnings.filterwarnings("ignore", category=UserWarning, message="The PostScript backend does not support transparency")
16
17class PlotMaker:
18
19 matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')
20 matplotlib.rc('font', family='Droid Serif')
21
22 def __init__(self, results_directory='publication/results', out_directory='publication/figures'):
23 self.results_directory = results_directory
24 self.out_directory = out_directory
25 self.main_arch_directory = 'i4i_4xlarge'
26
27 def get_dataset_name(self, name):
28 for datasetName in DATASET_NAMES:
29 nameProcessed = '_'.join(name.split('_')[:-1])
30 if name == datasetName or nameProcessed == datasetName:
31 return DATASET_NAMES[datasetName]
32 return name
33
34 def map_encoding_name(self, name):
35 if name in ENCODINGS_MAPPING:
36 return ENCODINGS_MAPPING[name]
37 return name
38
39 def clean_end_to_end_file(self, file_path):
40 with open(file_path, 'r') as file:
41 lines = file.readlines()
42 cleaned_lines = [line.rstrip(',\n') + '\n' for line in lines]
43 cleaned_lines.append( # TODO: Nasty hack to fill 0 in PDE which cannot compress NYC
44 'nyc29_tw,4,0,PDE,1,SCAN,0.000000,0.000000,0.000000,-1.000000,0,0\n'
45 )
46 cleaned_file_path = file_path + '_cleaned'
47 with open(cleaned_file_path, 'w') as file:
48 file.writelines(cleaned_lines)
49 return cleaned_file_path
50
51
52 def get_encoding_process(self, name):
53 if 'encode' in name:
54 return 'Compression'
55 else:
56 return 'Decompression'
57
58
59 def get_fused_process(self, name):
60 if 'fused' in name:
61 return 'Fused'
62 else:
63 return 'Non-Fused'
64
65
66 def plot_speed(self):
67 architecture = self.main_arch_directory
68 basePath = self.results_directory + '/' + architecture + '/'
69
70 patas = pd.read_csv(basePath + 'patas.csv')
71 chimp = pd.read_csv(basePath + 'chimp.csv')
72 chimp128 = pd.read_csv(basePath + 'chimp128.csv')
73 pde = pd.read_csv(basePath + 'ped.csv')
74 alp1 = pd.read_csv(basePath + 'x86_64_avx512bw_intrinsic_1024_uf1_falp.csv')

Callers 1

plotter.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected