nxbench.viz package

Submodules

nxbench.viz.app module

nxbench.viz.app.make_parallel_categories_figure(df, df_agg, group_columns, selected_algorithm, color_by, selected_dimensions)[source]

Generate the Parallel Categories figure for a given algorithm and coloring metric.

Parameters:
  • df (pandas.DataFrame) – The original dataframe containing raw benchmark information (e.g., ‘execution_time’, ‘memory_used’, etc.).

  • df_agg (pandas.DataFrame) – An aggregated dataframe (e.g., grouped by algorithm) containing mean execution time, memory usage, and sample counts. Indexed by (‘algorithm’, …).

  • group_columns (list of str) – The list of columns used to group and aggregate df into df_agg.

  • selected_algorithm (str) – The name of the selected algorithm (e.g., “bfs”, “dfs”, etc.).

  • color_by (str) – The metric by which to color the parallel categories. Possible values include: “execution_time”, “execution_time_with_preloading”, or “memory_used”.

  • selected_dimensions (list of str) – Columns (from the dataframe index) to include as dimensions in the parallel categories diagram.

Returns:

  • fig (plotly.graph_objects.Figure) – The Plotly Figure object representing the parallel categories chart.

  • store_data (dict) – A dictionary containing arrays of “mean_values” and “counts”. Used for hover data replacement on the client side.

nxbench.viz.app.make_violin_figure(df, df_agg, selected_algorithm, color_by, selected_dimensions)[source]

Generate the Violin Plot figure for a given algorithm and coloring metric.

Parameters:
  • df (pandas.DataFrame) – The original dataframe containing raw benchmark information (e.g., ‘execution_time’, ‘memory_used’, etc.).

  • df_agg (pandas.DataFrame) – An aggregated dataframe containing mean execution time, memory usage, and sample counts. Indexed by (‘algorithm’, …).

  • selected_algorithm (str) – The name of the selected algorithm (e.g., “bfs”, “dfs”, etc.).

  • color_by (str) – The metric by which to color the violin plot on the y-axis. Possible values are “execution_time”, “execution_time_with_preloading”, or “memory_used”.

  • selected_dimensions (list of str) – Columns that might be used for the X-axis dimension (e.g., “backend”).

Returns:

fig – The Plotly Figure object representing the violin chart.

Return type:

plotly.graph_objects.Figure

nxbench.viz.app.run_server(port=8050, debug=False, run=True)[source]

Create and configure the Dash app, optionally running the server.

This function loads benchmark data, constructs the Dash app, and wires up all callbacks. The run parameter allows for skipping the server startup, which is convenient when testing.

Parameters:
  • port (int, optional) – The port on which to run the Dash server. Default is 8050.

  • debug (bool, optional) – Whether to run the server in debug mode. Default is False.

  • run (bool, optional) – If True, the app.run_server method is called. If False, the app is returned without starting the server. This is useful for testing. Default is True.

Returns:

The Dash application instance.

Return type:

dash.Dash

nxbench.viz.utils module

nxbench.viz.utils.aggregate_data(df)[source]

Aggregate the preprocessed DataFrame by computing the mean execution time, mean memory usage, etc., grouping by relevant columns.

Return type:

tuple[DataFrame, list, list]

Parameters:

df (DataFrame)

nxbench.viz.utils.load_and_prepare_data(file_path, logger)[source]

Orchestrate data loading, preprocessing, and aggregation. Returns the final aggregated data, along with any metadata needed for downstream visualization.

Parameters:
nxbench.viz.utils.load_data(file_path='results/results.csv')[source]

Load the raw CSV data into a Pandas DataFrame.

Return type:

DataFrame

nxbench.viz.utils.preprocess_data(df)[source]

Clean and transform the raw DataFrame

Return type:

DataFrame

Parameters:

df (DataFrame)

Module contents