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

Update CryogenicSMS driver #1346

Merged

Conversation

lukabavdaz
Copy link
Contributor

Changes proposed in this pull request:

  • Remove typos
  • Hardcode terminator, because the magnet exclusively uses this terminator (note that the changed function signature is the only breaking change in this commit)
  • Properly raise an exception when attempting to measure the field in 'AMPS' mode instead of raising a less helpful exception due to unexpected query results
  • Make the driver compatible with SMS60C by removing an incorrect value at the start of some replies

@jenshnielsen

Remove typos, hardcode terminator, properly raise exceptions when attempting to measure the field in 'AMPS' mode. The commit also makes the driver compatible with SMS60C by removing an incorrect value at the start of some replies.
@codecov
Copy link

codecov bot commented Oct 28, 2018

Codecov Report

Merging #1346 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1346   +/-   ##
=======================================
  Coverage   73.34%   73.34%           
=======================================
  Files          79       79           
  Lines        9098     9098           
=======================================
  Hits         6673     6673           
  Misses       2425     2425

Copy link
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I left a few suggestions inline

qcodes/instrument_drivers/cryogenic/CryogenicSMS120C.py Outdated Show resolved Hide resolved

This magnet PS driver has been tested with:
FTDI chip drivers (USB to serial), D2XX version installed.
Cryogenic SMS120C and SMS60C (though the default init arguments are not correct for the latter)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you document what needs to change?


log.debug('Initializing instrument')
super().__init__(name, address, terminator=terminator, **kwargs)
super().__init__(name, address, terminator='\r\n', **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly dangerous. Even if you were passing the default value this will now result in a TypeError: __init__() got multiple values for keyword argument 'terminator'

I would add some lines like the following to the start of the function above

if 'terminator' in kwargs.keys():
    kwargs.pop('terminator')
    warnings.warn('Passing terminator to CryogenicSMS is no longer supported and has no effect')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great way of retaining backwards compatibility (when named arguments are used)!

jenshnielsen and others added 2 commits October 30, 2018 01:13
Co-Authored-By: lukabavdaz <lukabavdaz@gmail.com>
Also makes terminator more backwards compatible (when named arguments are used).
@jenshnielsen jenshnielsen merged commit 85d458f into microsoft:master Nov 2, 2018
giulioungaretti pushed a commit that referenced this pull request Nov 2, 2018
Merge: 94acf12 a0185fd
Author: Jens Hedegaard Nielsen <jenshnielsen@gmail.com>

    Merge pull request #1346 from lukabavdaz/feature/CryogenicSMS-update
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

Successfully merging this pull request may close these issues.

None yet

2 participants