Skip to content

Commit

Permalink
fix TupleGui-Test
Browse files Browse the repository at this point in the history
  • Loading branch information
marsipu committed Nov 26, 2023
1 parent c393add commit 666da83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions mne_pipeline_hd/gui/parameter_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,11 @@ def set_value(self, value):
# Signal valueChanged is already emitted after first setValue,
# which leads to second param_value being 0 without being
# preserved in self.loaded_value
self._external_set = True
self.param_widget1.setValue(value[0])
self.param_widget2.setValue(value[1])
self._external_set = False
if len(value) == 2:
self._external_set = True
self.param_widget1.setValue(value[0])
self.param_widget2.setValue(value[1])
self._external_set = False

def _get_param(self):
if not self._external_set:
Expand Down
3 changes: 1 addition & 2 deletions mne_pipeline_hd/tests/test_parameter_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ def test_basic_param_guis(qtbot, gui_name):
}
kwargs["type_kwargs"][type_gui_name] = t_kwargs
gui = gui_class(data=parameters, name=gui_name, **kwargs)
for gui_type, type_gui_name in gui.gui_types.items():
type_idx = gui.types.index(gui_type)
for type_idx, (gui_type, type_gui_name) in enumerate(gui.gui_types.items()):
gui.change_type(type_idx)
gui.set_param(parameters[type_gui_name])
assert gui.get_value() == parameters[type_gui_name]
Expand Down

0 comments on commit 666da83

Please sign in to comment.