hnn_core.gui.HNNGUI#

class hnn_core.gui.HNNGUI(total_height=800, total_width=1300, header_height=42, status_height=30, param_window_width_prop=0.45, log_window_height_prop=0.22, dpi=96, network_configuration=PosixPath('/home/circleci/miniconda/envs/testenv/lib/python3.11/site-packages/hnn_core/param/jones2009_base.json'))[source]#

HNN GUI class

Parameters:
total_heightint

The height of the GUI in pixels. For an explanation of the various layout windows and how they relate, see the comments in HNNGUI.__init__.

total_widthint

The width of the GUI in pixels

header_heightint

The height of the header in pixels

status_heightint

The height of status bar in pixels

param_window_width_propfloat

The proportion of the width reserved for the “parameters-window” container; the proportion reserved for the visualization-window is then defined as (1 - param_window_width_prop)

log_window_height_propfloat

The proportion of the height reserved for the “log-window” container. The height of the parameters-window grows to fill the remaining space and is thus not specified directly

dpiint

The pixel density specified in dots per inch

network configurationstr

The relative path to the hierarchical json file defining the network and drives to be used, typically “jones2009_base.json”

Attributes:
layoutdict

The styling configuration of GUI.

paramsdict

The parameters to use for constructing the network.

simulation_datadict

Simulation related objects, such as net and dpls.

widget_tstopWidget

Simulation stop time widget.

widget_dtWidget

Simulation step size widget.

widget_ntrialsWidget

Widget that controls the number of trials in a single simulation.

widget_backend_selectionWidget

Widget that selects the backend used in simulations.

widget_viz_layout_selectionWidget

Widget that selects the layout of visualization window.

widget_mpi_cmdWidget

Widget that specify the mpi command to use when the backend is MPIBackend.

widget_n_jobsWidget

Widget that specify the cores in multi-trial simulations.

widget_drive_type_selectionWidget

Widget that is used to select the drive to be added to the network.

widget_location_selectionWidget.

Widget that specifies the location of network drives. Could be proximal or distal.

add_drive_buttonWidget

Clickable widget that is used to add a drive to the network.

run_buttonWidget

Clickable widget that triggers simulation.

load_buttonWidget

Clickable widget that receives uploaded parameter files.

delete_drive_buttonWidget

Clickable widget that clear all existing network drives.

plot_outputs_dictlist

A list of visualization panel outputs.

plot_dropdown_types_dictlist

A list of dropdown menus that control the plot types in plot_outputs_dict.

drive_widgetslist

A list of network drive widgets added by add_drive_button.

drive_boxeslist

A list of network drive layouts.

connectivity_textfieldslist

A list of boxes that control the weight and probability of connections in the network.

Methods

add_drive_widget(drive_type, location[, ...])

Add a widget for a new drive.

build_drive_tab_contents()

build the External Drives tab contents

build_network_tab_contents()

build the Network tab contents

build_parameters_window()

build parameters-window (to occupy AppLayout's left_sidebar)

build_sim_tab_contents()

Build the Simulation tab contents

capture([width, height, extra_margin, render])

Take a screenshot of the current GUI.

compose([return_layout])

Build the GUI and its widgets

get_cell_parameters_dict()

Returns the number of elements in the cell_parameters_dict dictionary.

load_custom_gui_styling()

Load custom CSS and JS for styling the GUI

load_drive_and_connectivity()

Add drive and connectivity ipywidgets from params.

load_parameters(params_fname)

Read parameters from file.

run_notebook_cells()

Run all but the last cells sequentially in a Jupyter notebook.

add_drive_tab

add_logging_window_logger

on_upload_params_change

show

add_drive_widget(drive_type, location, prespecified_drive_name=None, prespecified_drive_data=None, prespecified_weights_ampa=None, prespecified_weights_nmda=None, prespecified_delays=None, prespecified_n_drive_cells=None, prespecified_cell_specific=None, render=True, expand_last_drive=True, event_seed=14)[source]#

Add a widget for a new drive.

property analysis_config#

Provides everything viz window needs except for the data.

build_drive_tab_contents()[source]#

build the External Drives tab contents

build_network_tab_contents()[source]#

build the Network tab contents

build_parameters_window()[source]#

build parameters-window (to occupy AppLayout’s left_sidebar)

build_sim_tab_contents()[source]#

Build the Simulation tab contents

capture(width=None, height=None, extra_margin=100, render=True)[source]#

Take a screenshot of the current GUI.

Parameters:
widthint | None

The width of iframe window use to show the snapshot.

heightint | None

The height of iframe window use to show the snapshot.

extra_margin: int

Extra margin in pixel for the GUI.

renderbool

Will return an IFrame object if False

Returns:
snapshotAn iframe snapshot object that can be rendered in notebooks.
compose(return_layout=True)[source]#

Build the GUI and its widgets

Parameters:
return_layoutbool

If the method returns the layout object which can be rendered by IPython.display.display() method.

property data#

Provides easy access to simulation-related data.

get_cell_parameters_dict()[source]#

Returns the number of elements in the cell_parameters_dict dictionary. This is for testing purposes

load_custom_gui_styling()[source]#

Load custom CSS and JS for styling the GUI

load_drive_and_connectivity()[source]#

Add drive and connectivity ipywidgets from params.

static load_parameters(params_fname)[source]#

Read parameters from file.

run_notebook_cells()[source]#

Run all but the last cells sequentially in a Jupyter notebook.

To properly use this function:
  1. Put this into the penultimate cell.

  2. init the HNNGUI in a single cell.

  3. Hit ‘run all’ button to run the whole notebook and it will selectively run twice.