emodelrunner.GUI_utils.frames

Frame Classes for the GUI.

Functions

float_callback(input_)

Accepts only a float or '' as entry.

positive_int_callback(input_)

Accepts only digits or '' as entry.

Classes

FrameButtons(*args, **kwargs)

Frame containing buttons to (re-)start and pause simulation.

FrameConfig(*args, **kwargs)

Frame containing all inputs.

FrameConfigFig(*args, **kwargs)

Frame containing choices for figure display, such as 2d/3d or enabling toolbar.

FrameFigures(*args, **kwargs)

Frame containing the morphology and the voltage figures.

FrameHoldStimulus(*args, **kwargs)

Frame containing holding stimulus value input.

FrameMain(*args, **kwargs)

Frame containing Figures and launching button.

FrameProtocols(*args, **kwargs)

Frame containing protocol-related inputs.

FrameSetIntFromEntry(*args, **kwargs)

Frame containing an entry for input.

FrameStepProtocol(*args, **kwargs)

Frame containing step stimulus-related input.

FrameStepStimulus(*args, **kwargs)

Frame containing step stimulus value input.

FrameSynapses(*args, **kwargs)

Frame containing all inputs.

ToolbarCustom(*args, **kwargs)

Matplotlib toolbar class.

class emodelrunner.GUI_utils.frames.FrameButtons(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing buttons to (re-)start and pause simulation.

simul_ended()[source]

Disable pause & continue buttons.

simul_on_pause()[source]

Disable pause button, enable continue button.

simul_running()[source]

Disable continue button, enable pause button.

class emodelrunner.GUI_utils.frames.FrameConfig(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing all inputs.

class emodelrunner.GUI_utils.frames.FrameConfigFig(*args: Any, **kwargs: Any)[source]

Bases: LabelFrame

Frame containing choices for figure display, such as 2d/3d or enabling toolbar.

load_figsize_value(gui)[source]

Change figure size in gui and reload figure frame.

Parameters:

gui (GUI) – main class containing main frames and simulation

load_plot_3d_value(gui)[source]

Change figure display in gui and reload figure frame.

Parameters:

gui (GUI) – main class containing main frames and simulation

load_toolbar_value(gui)[source]

Change toolbar value in gui and reload figure frame.

Parameters:

gui (GUI) – main class containing main frames and simulation

class emodelrunner.GUI_utils.frames.FrameFigures(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing the morphology and the voltage figures.

check_change(root, simulation)[source]

Checks the voltage change in the cell sections.

Update display if change is significant.

Parameters:
  • root (tk.Tk) – root of the GUI

  • simulation (NeuronSimulation) – contains simulation (and cell) data

Returns:

True if the cell morphology with color-coded voltage figure has been updated

Return type:

bool

display(root, simulation, morph_lines=None)[source]

Update both figures display.

Parameters:
  • root (tk.Tk) – root of the GUI

  • simulation (NeuronSimulation) – contains simulation (and cell) data

  • morph_lines (list of matplotlib.Line2D) – list of lines to be actualized if they already have been computed, else None

static get_interactive_3d_rotation(canva, ax)[source]

Connect events to canva to enable rotative 3d plots with mouse.

Parameters:
  • canva (matplotlib.backends.backend_tkagg.FigureCanvasTkAgg) – canva

  • ax (matplotlib.axes.Axes) – axes

restart_volt()[source]

Clean the voltage figure.

set_axis(x_min=0, x_max=3000, y_min=-90, y_max=40)[source]

Set the voltage figure’s axis.

Parameters:
  • x_min (float) – min value on x axis

  • x_max (float) – max value on x axis

  • y_min (float) – min value on y axis

  • y_max (float) – max value on y axis

set_fig_morph_display(fig)[source]

Set shape figure size and adjustment.

Parameters:

fig (matplotlib.figure.Figure) – figure to adjust

set_fig_volt_display(fig)[source]

Set shape figure size and adjustment.

Parameters:

fig (matplotlib.figure.Figure) – figure to adjust

set_toolbars()[source]

Set a matplotlib toolbar for each figure.

update_syn_display(root, simulation, size_scatter=6)[source]

Update the display of the synapses on the right figure.

Parameters:
  • root (tk.Tk) – root of the GUI

  • simulation (NeuronSimulation) – contains simulation (and cell) data

  • size_scatter (int) – size of synapses for scatter plot

class emodelrunner.GUI_utils.frames.FrameHoldStimulus(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing holding stimulus value input.

get_custom_hold_stim(gui)[source]

Enable input and put input value into simulation attribute.

Parameters:

gui (GUI) – main class containing main frames and simulation

get_hold_stim(gui)[source]

Put selected holding stim value into simulation attribute.

Parameters:

gui (GUI) – main class containing main frames and simulation

class emodelrunner.GUI_utils.frames.FrameMain(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing Figures and launching button.

check_change(root, simulation)[source]

Checks the voltage change in the cell sections.

Update display if change is significant.

Parameters:
  • root (tk.Tk) – root of the GUI

  • simulation (NeuronSimulation) – contains simulation (and cell) data

Returns:

True if the cell morphology with color-coded voltage figure has been updated

Return type:

bool

display(root, simulation)[source]

Update figures display.

Parameters:
  • root (tk.Tk) – root of the GUI

  • simulation (NeuronSimulation) – contains simulation (and cell) data

restart_volt()[source]

Clean voltage figure.

simul_ended()[source]

Disable pause & continue buttons.

simul_on_pause()[source]

Disable pause button, enable continue button.

simul_running()[source]

Disable continue button, enable pause button.

update_syn_display(root, simulation)[source]

Update the display of the synapses on the right figure.

Parameters:
  • Args

  • root (tk.Tk) – root of the GUI

  • simulation (NeuronSimulation) – contains simulation (and cell) data

class emodelrunner.GUI_utils.frames.FrameProtocols(*args: Any, **kwargs: Any)[source]

Bases: LabelFrame

Frame containing protocol-related inputs.

class emodelrunner.GUI_utils.frames.FrameSetIntFromEntry(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing an entry for input.

disable()[source]

Set entry state to disabled.

enable()[source]

Set entry state to not disabled.

get_value(gui, attr_name)[source]

Put input value in simulation attribute.

Parameters:
  • gui (GUI) – main class containing main frames and simulation

  • attr_name (str) – attribute of gui.simulation that can be changed with the entry

class emodelrunner.GUI_utils.frames.FrameStepProtocol(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing step stimulus-related input.

class emodelrunner.GUI_utils.frames.FrameStepStimulus(*args: Any, **kwargs: Any)[source]

Bases: Frame

Frame containing step stimulus value input.

get_custom_step_stim(gui)[source]

Enable input and put input value into simulation attribute.

Parameters:

gui (GUI) – main class containing main frames and simulation

get_step_stim(gui)[source]

Put selected step stim value into simulation attribute.

Parameters:

gui (GUI) – main class containing main frames and simulation

class emodelrunner.GUI_utils.frames.FrameSynapses(*args: Any, **kwargs: Any)[source]

Bases: LabelFrame

Frame containing all inputs.

static check_variable(x)[source]

Returns the variable if it is a positive int. Returns 0 if not.

Parameters:

x (str) – variable to check

Returns:

the variable if it is a positive int

Return type:

int

load_current_mtype_list(gui)[source]

Load current mtype list and netstim params.

Parameters:

gui (GUI) – main class containing main frames and simulation

set_svs(gui, i)[source]

Returns the entry and the variable associated.

Parameters:
  • gui (GUI) – main class containing main frames and simulation

  • i (int) – mtype index

toggle_button()[source]

Enable/disable entries depending on the button status.

class emodelrunner.GUI_utils.frames.ToolbarCustom(*args: Any, **kwargs: Any)[source]

Bases: NavigationToolbar2TkAgg

Matplotlib toolbar class.

set_message(msg)[source]

Do not show message. This is unstable.

Parameters:

msg (str) – message

emodelrunner.GUI_utils.frames.float_callback(input_)[source]

Accepts only a float or ‘’ as entry.

Parameters:

input (str) – input to check

Returns:

True if input is a float or an empty string, False otherwise

Return type:

bool

emodelrunner.GUI_utils.frames.positive_int_callback(input_)[source]

Accepts only digits or ‘’ as entry.

Parameters:

input (str) – input to check

Returns:

True if input is an int or an empty string, False otherwise

Return type:

bool