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

default Instrument get_idn returns a warning #517

Closed
peendebak opened this issue Mar 9, 2017 · 5 comments
Closed

default Instrument get_idn returns a warning #517

peendebak opened this issue Mar 9, 2017 · 5 comments

Comments

@peendebak
Copy link
Contributor

For any Instrument that does not have a self.ask('*IDN?') a warning is generated. This is inconvenient for all derived classes that do not have a VISA interface.

The warning is generated here:

https://github.com/QCoDeS/Qcodes/blob/master/qcodes/instrument/base.py#L130

A minimal example:

from qcodes import Instrument

class dummy(Instrument):
    pass

d=dummy(name='test')
idn=d.get_idn()

Can we remove the warning (or change it into a logging.info)?

@giulioungaretti

@AdriaanRol
Copy link
Contributor

I agree with this. I think that the connect message (that raises this warning) can be very useful.
I would propose that we solve this problem by implementing a default .get_idn() that returns self.name (in the format that works with the message).

@giulioungaretti
Copy link
Contributor

@peendebak @AdriaanRol, yes agree. I guess this was written with the assumption that all instruments have the arcane visa IDN command.

Not sure what's best:

  • 1 move it to VISA base class
  • 2 change to info (but it's kind of meant to be a warning ?)
  • 3 change to info, but return a sane default instead

I would go for 1, but we have to check how many instruments inherit from IP and speak visa !

@AdriaanRol
Copy link
Contributor

@giulioungaretti , Another quite common use case for us is to have virtual or meta instruments. These talk to lower level instruments and generally do not have an IDN command (as they only exist in python). I think a sane default would make most sense.

That would still be consistent with -1 but would also require a sane connect message.

@peendebak
Copy link
Contributor Author

@giulioungaretti @AdriaanRol Shall I create a PR with option 3). A default that we use right now is:

        IDN = {'vendor': None, 'model': self.name,
               'serial': None, 'firmware': None}

@giulioungaretti
Copy link
Contributor

@peendebak that would be really awesome!

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

No branches or pull requests

3 participants