From 80a0bc1df7d39db77b72359ceeb0e5565a7c6c56 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:03:11 +0200 Subject: [PATCH 1/5] Update bennchplot.py --- bennchplot/bennchplot.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bennchplot/bennchplot.py b/bennchplot/bennchplot.py index c9b8985..4eede0d 100644 --- a/bennchplot/bennchplot.py +++ b/bennchplot/bennchplot.py @@ -244,9 +244,9 @@ def plot_fractions(self, axis, fill_variables, fill_height = 0 for fill in fill_variables: - axis.fill_between(np.squeeze(self.df[self.x_axis]), + axis.fill_between(np.squeeze(self.df[self.x_axis].to_numpy(), axis=1), fill_height, - np.squeeze(self.df[fill]) + fill_height, + self.df[fill].to_numpy() + fill_height, label=self.label_params[fill], facecolor=self.color_params[fill], interpolate=interpolate, @@ -255,18 +255,17 @@ def plot_fractions(self, axis, fill_variables, linewidth=0.5, edgecolor='#444444') if error: - axis.errorbar(np.squeeze(self.df[self.x_axis]), - np.squeeze(self.df[fill]) + fill_height, - yerr=np.squeeze(self.df[fill + '_std']), + axis.errorbar(np.squeeze(self.df[self.x_axis].to_numpy(), axis=1), + self.df[fill].to_numpy() + fill_height, + yerr=self.df[fill + '_std'].to_numpy(), capsize=3, capthick=1, color='k', - fmt='none' - ) + fmt='none') fill_height += self.df[fill].to_numpy() if self.x_ticks == 'data': - axis.set_xticks(np.squeeze(self.df[self.x_axis])) + axis.set_xticks(np.squeeze(self.df[self.x_axis].to_numpy(), axis=1)) else: axis.set_xticks(self.x_ticks) From 2258358d3a6c1f7f55b6a238d024f9773230d9af Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:32:40 +0200 Subject: [PATCH 2/5] Update bennchplot.py --- bennchplot/bennchplot.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bennchplot/bennchplot.py b/bennchplot/bennchplot.py index 4eede0d..900920f 100644 --- a/bennchplot/bennchplot.py +++ b/bennchplot/bennchplot.py @@ -244,7 +244,7 @@ def plot_fractions(self, axis, fill_variables, fill_height = 0 for fill in fill_variables: - axis.fill_between(np.squeeze(self.df[self.x_axis].to_numpy(), axis=1), + axis.fill_between(self.df[self.x_axis].to_numpy().squeeze(axis=1), fill_height, self.df[fill].to_numpy() + fill_height, label=self.label_params[fill], @@ -255,7 +255,7 @@ def plot_fractions(self, axis, fill_variables, linewidth=0.5, edgecolor='#444444') if error: - axis.errorbar(np.squeeze(self.df[self.x_axis].to_numpy(), axis=1), + axis.errorbar(self.df[self.x_axis].to_numpy().squeeze(axis=1), self.df[fill].to_numpy() + fill_height, yerr=self.df[fill + '_std'].to_numpy(), capsize=3, @@ -265,7 +265,7 @@ def plot_fractions(self, axis, fill_variables, fill_height += self.df[fill].to_numpy() if self.x_ticks == 'data': - axis.set_xticks(np.squeeze(self.df[self.x_axis].to_numpy(), axis=1)) + axis.set_xticks(self.df[self.x_axis].to_numpy().squeeze(axis=1)) else: axis.set_xticks(self.x_ticks) @@ -296,17 +296,17 @@ def plot_main(self, quantities, axis, log=(False, False), for y in quantities: if not error: - axis.plot(self.df[self.x_axis], - self.df[y], + axis.plot(self.df[self.x_axis].to_numpy(), + self.df[y].to_numpy(), marker=None, label=self.label_params[y], color=self.color_params[y], linewidth=2) else: axis.errorbar( - self.df[self.x_axis].values, - self.df[y].values, - yerr=self.df[y + '_std'].values, + self.df[self.x_axis].to_numpy(), + self.df[y].to_numpy(), + yerr=self.df[y + '_std'].to_numpy(), marker=None, capsize=3, capthick=1, @@ -315,7 +315,7 @@ def plot_main(self, quantities, axis, log=(False, False), fmt=fmt) if self.x_ticks == 'data': - axis.set_xticks(self.df[self.x_axis].values) + axis.set_xticks(self.df[self.x_axis].to_numpy()) else: axis.set_xticks(self.x_ticks) From 5a413ef1f9e6a8a1f03d21c9c311514a6e2895da Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Wed, 12 Apr 2023 02:41:18 +0200 Subject: [PATCH 3/5] Update bennchplot.py --- bennchplot/bennchplot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bennchplot/bennchplot.py b/bennchplot/bennchplot.py index 900920f..8fef188 100644 --- a/bennchplot/bennchplot.py +++ b/bennchplot/bennchplot.py @@ -296,7 +296,7 @@ def plot_main(self, quantities, axis, log=(False, False), for y in quantities: if not error: - axis.plot(self.df[self.x_axis].to_numpy(), + axis.plot(self.df[self.x_axis].to_numpy().squeeze(axis=1), self.df[y].to_numpy(), marker=None, label=self.label_params[y], @@ -304,7 +304,7 @@ def plot_main(self, quantities, axis, log=(False, False), linewidth=2) else: axis.errorbar( - self.df[self.x_axis].to_numpy(), + self.df[self.x_axis].to_numpy().squeeze(axis=1), self.df[y].to_numpy(), yerr=self.df[y + '_std'].to_numpy(), marker=None, @@ -315,7 +315,7 @@ def plot_main(self, quantities, axis, log=(False, False), fmt=fmt) if self.x_ticks == 'data': - axis.set_xticks(self.df[self.x_axis].to_numpy()) + axis.set_xticks(self.df[self.x_axis].to_numpy().squeeze(axis=1)) else: axis.set_xticks(self.x_ticks) From 102937591ac898d2d6f2222e35d8b166d782b340 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Mon, 22 May 2023 00:55:24 +0200 Subject: [PATCH 4/5] Update bennchplot.py --- bennchplot/bennchplot.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/bennchplot/bennchplot.py b/bennchplot/bennchplot.py index 8fef188..b1ae703 100644 --- a/bennchplot/bennchplot.py +++ b/bennchplot/bennchplot.py @@ -107,17 +107,17 @@ def load_data(self, data_file): 'threads_per_task': 'first', 'tasks_per_node': 'first', 'model_time_sim': 'first', - 'wall_time_create': ['mean', 'std'], - 'wall_time_connect': ['mean', 'std'], - 'wall_time_sim': ['mean', 'std'], - 'wall_time_phase_collocate': ['mean', 'std'], - 'wall_time_phase_communicate': ['mean', 'std'], - 'wall_time_phase_deliver': ['mean', 'std'], - 'wall_time_phase_update': ['mean', 'std'], - 'wall_time_communicate_target_data': ['mean', 'std'], - 'wall_time_gather_spike_data': ['mean', 'std'], - 'wall_time_gather_target_data': ['mean', 'std'], - 'wall_time_communicate_prepare': ['mean', 'std'], + 'time_construction_create': ['mean', 'std'], + 'time_construction_connect': ['mean', 'std'], + 'time_simulate': ['mean', 'std'], + 'time_collocate_spike_data': ['mean', 'std'], + 'time_communicate_spike_data': ['mean', 'std'], + 'time_deliver_spike_data': ['mean', 'std'], + 'time_update': ['mean', 'std'], + 'time_communicate_target_data': ['mean', 'std'], + 'time_gather_spike_data': ['mean', 'std'], + 'time_gather_target_data': ['mean', 'std'], + 'time_communicate_prepare': ['mean', 'std'], 'py_time_create': ['mean', 'std'], 'py_time_connect': ['mean', 'std'], 'base_memory': ['mean', 'std'], @@ -125,9 +125,7 @@ def load_data(self, data_file): 'init_memory': ['mean', 'std'], 'total_memory': ['mean', 'std'], 'num_connections': ['mean', 'std'], - 'local_spike_counter': ['mean', 'std'], - - } + 'local_spike_counter': ['mean', 'std']} col = ['num_nodes', 'threads_per_task', 'tasks_per_node', 'model_time_sim', 'wall_time_create', From 4334156d77bd914ba3bde54f945a6c0408d523ef Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Mon, 29 May 2023 18:38:29 +0200 Subject: [PATCH 5/5] Update bennchplot.py --- bennchplot/bennchplot.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bennchplot/bennchplot.py b/bennchplot/bennchplot.py index b1ae703..d1b6bf3 100644 --- a/bennchplot/bennchplot.py +++ b/bennchplot/bennchplot.py @@ -62,7 +62,8 @@ def __init__(self, x_axis, color_params=pp.color_params, additional_params=pp.additional_params, label_params=pp.label_params, - time_scaling=1): + time_scaling=1, + df=None): self.x_axis = x_axis self.x_ticks = x_ticks @@ -71,7 +72,8 @@ def __init__(self, x_axis, self.color_params = color_params self.label_params = label_params self.time_scaling = time_scaling - + + self.df = df self.load_data(data_file) self.compute_derived_quantities() @@ -90,11 +92,12 @@ def load_data(self, data_file): ------ ValueError """ - try: - self.df = pd.read_csv(data_file, delimiter=',') - except FileNotFoundError: - print('File could not be found') - quit() + if self.df is None: + try: + self.df = pd.read_csv(data_file, delimiter=',') + except FileNotFoundError: + print('File could not be found') + quit() for py_timer in ['py_time_create', 'py_time_connect']: if py_timer not in self.df: