def unregister_instrument(self, instrument: typing.Any) -> None:
probe_view = self.__m.get(instrument, dict()).pop("probe_view")
if probe_view:
probe_view.close()
subscan_view = self.__m.get(instrument, dict()).pop("subscan_view")
if subscan_view:
subscan_view.close()
line_scan_view = self.__m.get(instrument, dict()).pop("line_scan_view")
if line_scan_view:
line_scan_view.close()
drift_view = self.__m.get(instrument, dict()).pop("drift_view")
if drift_view:
drift_view.close()
A KeyError rises when self.__m.get(instrument, dict()) returns dict(), as there is nothing to pop($key). This happens with my instruments classes non_derived from stem_controller.STEMController, which is the case for my EELS spectrometer, lenses, etc.
Hi guys, how you doing?
In this chunk of code:
A KeyError rises when self.__m.get(instrument, dict()) returns dict(), as there is nothing to pop($key). This happens with my instruments classes non_derived from stem_controller.STEMController, which is the case for my EELS spectrometer, lenses, etc.
best,