1111def read_metrics (filename ):
1212 return pd .read_csv (filename )
1313
14- def scatter_algos (data , output_file ):
15-
1614
15+ def scatter_algos (data , output_file ):
1716 # Create a figure for subplots
1817 fig , axs = plt .subplots (1 , len (data ["algo" ].unique ()), figsize = (15 , 15 ))
1918 fig .tight_layout (pad = 2.0 )
@@ -22,13 +21,13 @@ def scatter_algos(data, output_file):
2221 for i , category in enumerate (data ["algo" ].unique ()):
2322 ax = axs [i ]
2423 for type_ in data ["options" ].unique ():
25-
24+
2625 # Filter the data based on category and type
2726 filtered_data = data [(data ["options" ] == type_ ) & (data ["algo" ] == category )]
28-
27+
2928 # Plot the scatter plot for this category and type
3029 ax .scatter (filtered_data ['threads' ], filtered_data ['time' ], label = f'{ type_ [1 :]} ' )
31-
30+
3231 # Set labels and title
3332 ax .set_xlabel ('Threads' )
3433 ax .set_ylabel ('Time' )
@@ -39,16 +38,17 @@ def scatter_algos(data, output_file):
3938 plt .savefig (output_file )
4039 plt .close (fig )
4140
41+
4242def scatter_options (data , output_file ):
4343 fig , axs = plt .subplots (1 , len (data ["options" ].unique ()), figsize = (15 , 15 ))
4444 fig .tight_layout (pad = 2.0 )
4545 for i , type_ in enumerate (data ["options" ].unique ()):
4646 ax = axs [i ]
4747 for category in data ["algo" ].unique ():
48-
48+
4949 # Filter the data based on category and type
5050 filtered_data = data [(data ["options" ] == type_ ) & (data ["algo" ] == category )]
51-
51+
5252 # Plot the scatter plot for this category and type
5353 ax .scatter (filtered_data ['threads' ], filtered_data ['time' ], label = f'{ category } ' )
5454
@@ -61,7 +61,7 @@ def scatter_options(data, output_file):
6161
6262 plt .savefig (output_file )
6363 plt .close (fig )
64-
64+
6565
6666def boxplots (data , output_file ):
6767 num_threads = data ["threads" ].unique ()
@@ -71,7 +71,7 @@ def boxplots(data, output_file):
7171 fig .tight_layout (pad = 5.0 )
7272 for x , algo in enumerate (algos ):
7373 for y , option in enumerate (options ):
74- ax = axs [x ,y ]
74+ ax = axs [x , y ]
7575 filtered_data = []
7676 for num_thread in num_threads :
7777 filtered_data .append (data [(data ["algo" ] == algo ) & (data ["options" ] == option ) & (data ["threads" ] == num_thread )]["time" ])
@@ -86,7 +86,6 @@ def boxplots(data, output_file):
8686 plt .close (fig )
8787
8888
89-
9089# Plot performance vs threads
9190def plot_performance (data , output_file ):
9291 plt .figure (figsize = (10 , 6 ))
@@ -179,8 +178,7 @@ def plot_efficiency(data, output_file):
179178 if not os .path .exists (args .output_dir ):
180179 os .makedirs (args .output_dir )
181180
182-
183- data [['algo' , 'options' ]] = data ['file' ].str .rsplit ('_' , n = 1 , expand = True )
181+ data [['algo' , 'options' ]] = data ['file' ].str .rsplit ('_' , n = 1 , expand = True )
184182
185183 # Create graphs
186184 plot_performance (
0 commit comments