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

feat: add kwarg to instrument constructor on server #303

Closed
wants to merge 2 commits into from

Conversation

damazter
Copy link
Contributor

Changes proposed in this pull request:
Add a kwarg to the constructor of instrument that contains a reference to the instrumentserver that created the instruments.
This will enable that all instruments on the same server can find each other via the instrument server and can talk to eachother

@giulioungaretti

add a reference to the instrument server that created the instrument

add a reference to the instrument server that created the instrument
damazter added a commit that referenced this pull request Aug 11, 2016
use the change proposed in #303 to make this driver work with loops
The extra kwarg added in this pull request breaks qcodes unless the
base instrument class is updated as well to accomodate for this
extra kwarg
@damazter damazter mentioned this pull request Aug 11, 2016
@damazter
Copy link
Contributor Author

A usecase for this new kwarg can be found in #66

@qcodes-bot
Copy link

Current coverage is 82.82% (diff: 100%)

Merging #303 into master will not change coverage

@@             master       #303   diff @@
==========================================
  Files            34         34          
  Lines          3615       3615          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           2994       2994          
  Misses          621        621          
  Partials          0          0          

Powered by Codecov. Last update b8ecc75...c3924d9

@AdriaanRol
Copy link
Contributor

@damazter, Do I understand correctly that this means that an instrument (A) can find any other instrument (B) that lives on the same server (by its name) without the need for ins B to have existed at creation time (of ins A)?

If so I think this is a great addition as it removes the need for using shared kwargs as long as one ensures that the required instruments exist on the same server.

@damazter
Copy link
Contributor Author

@AdriaanRol
To your first point: with this change you're exactly right except for the fact that the lookup cannot be done by name (as far as I know) but only by ID_number, not by name. This would be a really nice addition though.

Your second comment is correct as well, but this doesn't mean that the entire shared_kwargs framework becomes irrelevant, because you would still need that to communicate between different servers. (see http://qdev-dk.github.io/Qcodes/user/tutorial.html# at meta instrument)

@damazter
Copy link
Contributor Author

@AdriaanRol

(by its name)

Looking at this again, I think it is possible to do it by name as well by doing something like

reference = none
for inst in server.instruments:
    if inst.name == the_name_you_want:
        reference = inst

@damazter
Copy link
Contributor Author

superseded by #323

@damazter damazter closed this Sep 21, 2016
@giulioungaretti giulioungaretti deleted the suggest/add_instrumentserver_reference branch October 31, 2016 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants