1414CALC_NAMES = ['Vanilla' , 'Improved' , 'Overhead' ]
1515
1616propertyShortNames = {
17- "TestSmartByteSerializer#canRoundTripBytes" : 'byte' ,
18- "TestSmartIntegerSerializer#canRoundTripIntegers" : 'int' ,
1917 "TestSmartListSerializer#canRoundTripSerializableLists" : 'list' ,
20- "TestSmartLongSerializer#canRoundTripLongs" : 'long' ,
21- "TestSmartOptionalSerializer#canRoundTripPresentOptionals" : 'optionals' ,
22- "TestSmartPairSerializer#canRoundTripPairs" : 'pair' ,
23- "TestSmartShortSerializer#canRoundTripShort" : 'short' ,
24- "TestSmartStringSerializer#canRoundTripStrings" : 'string' ,
2518 "TestSmartListSerializer#canRoundTripSerializableListsWithGenerator" : 'list*' ,
2619 "GenTestFormat#dataRoundTrip" : 'data' ,
2720 "GenTestFormat#messageRoundTrip" : 'message' ,
4134 "X509ResourceCertificateParentChildValidatorTest#validParentChildOverClaimingLooseValidation" : 'loose'
4235}
4336
44- row_count = 1
4537
4638def obtain_stats_directories (results_directory : str ) -> list [str ]:
4739 directory_tree = [x for x in os .walk (results_directory )] # os.walk returns a tuple with structure (directory, subdirectories, files)
@@ -71,17 +63,27 @@ def evaluate_directories(project_name: str, results_directory: str, directories:
7163 directory_path = results_directory + directory + "/"
7264 directory_tree = [x [2 ] for x in os .walk (directory_path )]
7365 valid_htmls = [x for x in directory_tree [0 ] if 'html' in x ]
74- directory_stats = retrieve_time_elapsed (directory_path = directory_path , valid_htmls = valid_htmls )
66+ directory_stats = retrieve_time_elapsed (project_name = project_name , directory_path = directory_path , valid_htmls = valid_htmls )
7567 project_iteration = project_name + " - " + str (iteration )
7668 final_stats [project_iteration ] = directory_stats
7769 iteration += 1
7870 return final_stats
7971
80- def retrieve_time_elapsed (directory_path : str , valid_htmls : list [str ]) -> dict [str , str ]:
72+
73+ def retrieve_time_elapsed (project_name : str , directory_path : str , valid_htmls : list [str ]) -> dict [str , str ]:
8174 times_elapsed_dict = {}
8275 for html_file in valid_htmls :
8376 property_name = html_file .replace (".html" , "" )
77+ if property_name not in propertyShortNames :
78+ continue
8479 property_short_name = propertyShortNames [property_name ]
80+ if property_short_name == 'list*' and project_name == 'mph-table-fixed' :
81+ property_short_name = 'list'
82+ elif property_short_name == 'list' and project_name == 'mph-table-fixed' :
83+ continue
84+ elif property_short_name == 'list*' :
85+ print (project_name )
86+ continue
8587 file_path = directory_path + html_file
8688 with open (file_path ) as f :
8789 contents = f .read ()
@@ -122,7 +124,7 @@ def generate_project_report(project_name: str, final_stats: dict[str, str], fina
122124 return final_report_dict
123125
124126
125- def generate_project_df (final_stats : dict [str , str ], final_fixed_stats : dict [str , str ]) -> pd .DataFrame ():
127+ def generate_project_df (final_stats : dict [str , str ], final_fixed_stats : dict [str , str ], row_count : int ) -> ( pd .DataFrame (), int ):
126128 vanilla_df = pd .DataFrame ()
127129 vanilla_df ['Property' ] = [key for key in final_stats .keys ()]
128130 vanilla_df ['Vanilla' ] = [val for val in final_stats .values ()]
@@ -133,13 +135,14 @@ def generate_project_df(final_stats: dict[str, str], final_fixed_stats: dict[str
133135
134136 merged_df = pd .merge (vanilla_df , improved_df , how = 'outer' , on = 'Property' )
135137 merged_df ['N' ] = pd .RangeIndex (start = row_count , stop = len (merged_df .index ) + row_count )
136-
138+ row_count += len ( merged_df . index )
137139 final_df = merged_df [['N' , 'Property' , 'Vanilla' , 'Improved' ]]
138- return final_df
140+ return final_df , row_count
139141
140142
141143def main ():
142144 final_dataset = {}
145+ row_count = 1
143146 for project_name in PROJECTS :
144147 fixed_project_name = project_name + "-fixed"
145148 results_directory = BASE_RESULT_DIR + project_name + "/"
@@ -157,7 +160,7 @@ def main():
157160 # obtain mean/st dev
158161 final_stats = generate_report_stats (stat_values = raw_stats )
159162 final_fixed_stats = generate_report_stats (stat_values = fixed_raw_stats )
160- project_df = generate_project_df (final_stats = final_stats , final_fixed_stats = final_fixed_stats )
163+ project_df , row_count = generate_project_df (final_stats = final_stats , final_fixed_stats = final_fixed_stats , row_count = row_count )
161164 final_dataset [project_name ] = project_df
162165
163166
0 commit comments