optimato / lab-control-lib

Laboratory Control Library
1 stars 2 forks source link

Error starting the manager #11

Open lfqpi opened 3 hours ago

lfqpi commented 3 hours ago

Hi,

I am testing lab-control-lib on a computer running Windows 11 with python 3.12.0. I have a problem when I try to start the manager from ipython. After importing dummylab, I give the following command, based on the tutorial.

 manager = dummylab.lclib.manager.ManagerBase.Server()

The difference, with respect to the tutorial, is that I had to replace Manager with ManagerBase.

The output is the following:

TypeError                                 Traceback (most recent call last)
Cell In[10], line 1
----> 1 manager = dummylab.lclib.manager.ManagerBase.Server()

File ~\Software\LabControlSystem\lab-control-lib\lclib\proxydevice.py:749, in ProxyServerBase.__init__(self, instantiate, instance_args, instance_kwargs)
    746 self.service = self._create_service()
    748 # Start serving
--> 749 self.activate()

File ~\Software\LabControlSystem\lab-control-lib\lclib\proxydevice.py:758, in ProxyServerBase.activate(self)
    752 """
    753 Start serving
    754 """
    755 # Create rpyc threaded server
    756 self.rpyc_server = ThreadedServer(
    757     service=self.service,
--> 758     port=self.ADDRESS[1],
    759     protocol_config={
    760         "allow_all_attrs": True,
    761         "allow_setattr": True,
    762         "allow_delattr": True,
    763     },
    764     disconnect_callback=self.del_client,
    765 )
    767 # Replace print and input
    768 self.logger.info("Rerouting 'print' and 'input'")

TypeError: 'NoneType' object is not subscriptable

Is it the correct way of starting the manager?

Thank you

pierrethibault commented 3 hours ago

I'm sorry, I didn't update the documentation. It should just be

dummylab.Manager.Server()

(or from the command line: python -m lclib dummylab start manager)