Ulm-IQO / qudi-core

A framework for modular measurement applications.
GNU General Public License v3.0
28 stars 21 forks source link

[Bug] cannot pass arguments to remote module's methods when proxy is active #56

Open qku opened 1 year ago

qku commented 1 year ago

Version

Release v1.4.1

What is affected by the bug?

Methods of remote qudi modules that take any kind of arguments cannot be called if the flag force_remote_calls_by_value: True is set in the client's config file. See below for the error message.

When does the bug occur?

Every time a method of a remote qudi is called which takes an argument.

How do we replicate the issue?

Configure a qudi instance to act as a server and expose e.g. a data instream dummy. Then configure a client and try calling methods of the data instream dummy. Methods that don't take arguments like start_stream() should work, while read_data() does not.

I also added a very simple test method which takes an argument and then returns it. This also doesn't work, from which I conclude that this is a qudi-core issue and not specific to the instreamer.

Expected behavior

The method of the remote module should work as if it was a local module.

Relevant log output

Traceback (most recent call last):
  File "C:\Software\qudi\qudi-env\lib\site-packages\rpyc\core\protocol.py", line 359, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "C:\Software\qudi\qudi-env\lib\site-packages\rpyc\core\protocol.py", line 853, in _handle_getattr
    return self._access_attr(obj, name, (), "_rpyc_getattr", "allow_getattr", getattr)
  File "C:\Software\qudi\qudi-env\lib\site-packages\rpyc\core\protocol.py", line 781, in _access_attr
    return accessor(obj, name, *args)
  File "C:\Software\qudi\qudi-env\lib\site-packages\qudi\core\services.py", line 245, in __getattribute__
    def wrapped(*args, **kwargs):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\functools.py", line 56, in update_wrapper
    setattr(wrapper, attr, value)
TypeError: __annotations__ must be set to a dict object

Additional Comments

I first believed this to be specific to the instreamer and therefore raised this issue in qudi-iqo-modules.

Contact Details

No response