Skip to content
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

get_samples and get_shots raise unintuitive errors if called before a measurment #12

Open
ksunden opened this issue Aug 10, 2022 · 0 comments

Comments

@ksunden
Copy link
Member

ksunden commented Aug 10, 2022

Namely they raise AttributeError since _samples and _shots are not set in __init__ and so are only ever filled by a measurement.

(base) C:\Windows\system32>yaqc-qtpy
Traceback (most recent call last):
  File "C:\Users\john\Miniconda3\lib\site-packages\yaqc_qtpy\_qthread.py", line 18, in run
    self.result = self._function(*self._args, **self._kwargs)
  File "C:\Users\john\Miniconda3\lib\site-packages\yaqc\_client.py", line 61, in inner
    return self.send(comm, *ba.args[1:], **ba.kwargs)
  File "C:\Users\john\Miniconda3\lib\site-packages\yaqc\_client.py", line 28, in inner
    return fun(self, *args, **kwargs)
  File "C:\Users\john\Miniconda3\lib\site-packages\yaqc\_client.py", line 101, in send
    return self._socket.message(
  File "C:\Users\john\Miniconda3\lib\site-packages\yaqc\_socket.py", line 92, in message
    raise Exception(self._read(["string"]))
Exception: AttributeError("'NiDaqmxTmux' object has no attribute '_samples'")

I'm not sure if we wish to raise an error, but one more informative or to return empty data (like we do for measure), but there probably is at least some change on the daemon side to be had.

If it raises an error, the qtpy plugin should also be updated to ignore this error, as it is meaningless to try to plot it in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant