-
Notifications
You must be signed in to change notification settings - Fork 16
Bugfix MCS2 drivers: removed separate import MoveMode #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ErikMaris
I just tried out running LabExT on my Mac (without the smaract package installed!) locally with these changes - however it does not start and outputs the error below. Would you mind checking if LabExT starts if you install it afresh on your computer?
Since these are type annotations anyhow that produce errors, we could just get rid of all of the type annotations that refer to the ctl
module.
Thanks
Exception in thread Thread-1 (setup_runner):
Traceback (most recent call last):
File "/opt/miniconda3/envs/labext310/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/opt/miniconda3/envs/labext310/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/Users/meppenberger/gitroot/LabExT/LabExT/ExperimentManager.py", line 215, in setup_runner
self.mover.import_stage_classes()
File "/Users/meppenberger/gitroot/LabExT/LabExT/Movement/MoverNew.py", line 193, in import_stage_classes
imported_stage_classes = self._plugin_loader.load_plugins(
File "/Users/meppenberger/gitroot/LabExT/LabExT/PluginLoader.py", line 65, in load_plugins
plugins = self.__load(path,
File "/Users/meppenberger/gitroot/LabExT/LabExT/PluginLoader.py", line 101, in __load
imported_module = import_module(".".join([package_name, name]))
File "/opt/miniconda3/envs/labext310/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/meppenberger/gitroot/LabExT/LabExT/Movement/Stages/ChannelMCS2.py", line 8, in <module>
class ChannelMCS2:
File "/Users/meppenberger/gitroot/LabExT/LabExT/Movement/Stages/ChannelMCS2.py", line 134, in ChannelMCS2
def movement_mode(self) -> ctl.MoveMode:
AttributeError: 'NoneType' object has no attribute 'MoveMode'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ErikMaris,
I added some suggested changes to remove all the type hints. Let me know if this works with your SmarAct MCS2 stage and I'll test locally again :)
Co-authored-by: Marco <github@mebg.ch>
Co-authored-by: Marco <github@mebg.ch>
Co-authored-by: Marco <github@mebg.ch>
Co-authored-by: Marco <github@mebg.ch>
Co-authored-by: Marco <github@mebg.ch>
Hi @marcoep Thanks for the suggestions--I have accepted them, and they work on my system :-). |
After using the MCS2 drivers on a fresh install, the drivers failed without giving an error message. I traced this back to a failed import of
in LabExT/Movement/Stages/ChannelMCS2.py. Following the example from SmartAct, I removed the separate import of ModeMode, and called it directly from ctl as ctl.MoveMode. This fixed the problem in my test environment and on a fresh instal 8000 l from LabExt/dev.