Skip to content

Commit

Permalink
rename vars to remove need for property, update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dylansdaniels committed Nov 22, 2024
1 parent 1853da0 commit 8bb85b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 2 additions & 7 deletions hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,10 @@ class _VizManager:
A dict of external simulation data object
"""

def __init__(self, gui_data, viz_layout, fig_defaults):
def __init__(self, gui_data, viz_layout, fig_default_params):
plt.close("all")
self.viz_layout = viz_layout
self.fig_defaults = fig_defaults
self.fig_default_params = fig_default_params
self.use_ipympl = 'ipympl' in matplotlib.get_backend()

self.axes_config_output = Output()
Expand Down Expand Up @@ -941,11 +941,6 @@ def data(self):
"figs": self.figs
}

@property
def fig_default_params(self):
"""Expose default visualization parameters for figures"""
return self.fig_defaults

def reset_fig_config_tabs(self, template_name=None):
"""Reset the figure config tabs with most recent simulation data."""
simulation_names = tuple(self.data['simulations'].keys())
Expand Down
8 changes: 5 additions & 3 deletions hnn_core/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1973,12 +1973,14 @@ def run_button_clicked(widget_simulation_name, log_out, drive_widgets,
simulations_list_widget.value = sim_names[0]

viz_manager.reset_fig_config_tabs()
# set default_smoothing in fig_default_params
display(widget_default_smoothing.value)

# update default_smoothing in gui based on widget
fig_default_params['default_smoothing'] = widget_default_smoothing.value
# change default smoothing in viz_manager

# change default smoothing in viz_manager to mirror gui
new_default_smoothing = fig_default_params['default_smoothing']
viz_manager.fig_default_params['default_smoothing'] = new_default_smoothing

viz_manager.add_figure()
fig_name = _idx2figname(viz_manager.data['fig_idx']['idx'] - 1)
ax_plots = [("ax0", "input histogram"), ("ax1", "current dipole")]
Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ def test_default_smoothing(setup_gui):
# update simulation name
gui.widget_simulation_name.value = 'no_smoothing'

# change value of default smoothing via the widget
# change value of default smoothing in the widget
new_smoothing = 0
gui.widget_default_smoothing.value = new_smoothing

Expand Down

0 comments on commit 8bb85b1

Please sign in to comment.