Closed jluethi closed 2 years ago
If a user closes the current classifier widget window and initializes a fresh classifier, that doesn't work. Multiple issues:
File ~/opt/miniconda3/envs/napari-classifier/lib/python3.9/site-packages/napari/utils/key_bindings.py:277, in bind_key(keymap={'0': <function ClassifierWidget.create_selector_widget.<locals>.set_class_0>, '1': <function ClassifierWidget.create_selector_widget.<locals>.set_class_1>, '2': <function ClassifierWidget.create_selector_widget.<locals>.set_class_2>, '3': <function ClassifierWidget.create_selector_widget.<locals>.set_class_3>, '4': <function ClassifierWidget.create_selector_widget.<locals>.set_class_4>, 'O': <function ClassifierWidget.create_selector_widget.<locals>.toggle_selection>, 'P': <function ClassifierWidget.create_selector_widget.<locals>.toggle_selection>, 'T': <function ClassifierWidget.create_selector_widget.<locals>.run_classifier>, 'V': <function ClassifierWidget.create_selector_widget.<locals>.toggle_selection>}, key='T', func=<function ClassifierWidget.create_selector_widget.<locals>.run_classifier>, overwrite=False) 274 key = normalize_key_combo(key) 276 if func is not None and key in keymap and not overwrite: --> 277 raise ValueError( trans = <napari.utils.translations.TranslationBundle object at 0x7fc860917d60> key = 'T' 278 trans._( 279 'key combination {key} already used! specify \'overwrite=True\' to bypass this check', 280 deferred=True, 281 key=key, 282 ) 283 ) 285 unbound = keymap.pop(key, None) 287 if func is not None:
ValueError: key combination T already used! specify 'overwrite=True' to bypass this check
Added 'overwrite=True', seems to fix the issue. Pre-existing selection & prediciton layers are overwritten with a blank one again
If a user closes the current classifier widget window and initializes a fresh classifier, that doesn't work. Multiple issues:
ValueError: key combination T already used! specify 'overwrite=True' to bypass this check