Skip to content

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

@ksunden

Description

@ksunden

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions