From 7747aa1b3cf4e252045f043c0cf94e5c9a2bd3ff Mon Sep 17 00:00:00 2001 From: George Dang <53052793+gtdang@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:13:03 -0400 Subject: [PATCH] refactor: Changed if condition to use drive type instead of name because it standardized and consistent. --- hnn_core/gui/gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hnn_core/gui/gui.py b/hnn_core/gui/gui.py index cea5480b6..051f9cdb7 100644 --- a/hnn_core/gui/gui.py +++ b/hnn_core/gui/gui.py @@ -1397,7 +1397,7 @@ def add_drive_widget(drive_type, drive_boxes, drive_widgets, drives_out, for idx, drive in enumerate(drive_widgets): tab_name = drive['name'] - if "tonic" not in tab_name.lower(): + if drive['type'] != 'Tonic': tab_name += f" ({drive['location']})" accordion.set_title(idx, tab_name) @@ -2117,7 +2117,7 @@ def handle_backend_change(backend_type, backend_config, mpi_cmd, n_jobs): def _is_valid_add_tonic_input(drive_widgets): for drive in drive_widgets: - if "Tonic" in drive['name']: + if drive['type'] == 'Tonic': return False return True