-
Notifications
You must be signed in to change notification settings - Fork 301
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
val_mapping creator function to solve on/off/true/false issue #1413
Conversation
… SGS100A with this
…really maps to bools
…mpairments and pulsemod_state which used to use get/set parsers
Codecov Report
@@ Coverage Diff @@
## master #1413 +/- ##
==========================================
+ Coverage 73.86% 73.88% +0.02%
==========================================
Files 92 92
Lines 10411 10420 +9
==========================================
+ Hits 7690 7699 +9
Misses 2721 2721 |
This is needed to test create_on_off_val_mapping against inversion
I've refactored the code, and added tests. Questions:
|
|
@QCoDeS/core ready for review. Question: shall i also go through all drivers quickly and use this new function in cases where it makes sense and does not break instrument-driver's API? |
@nataliejpg as the original author of the PR and the main feature requester, could you also have a look? :) |
looks good to me @astafan8, thanks for the work. I didn't understand your question:
|
I also don't really remember :( I think it was about parameters which have enabled/disabled meaning which might probably be different from on/off meaning in some cases (definitely not in this PR's rhode schwarz driver), if we need a But now i think we don't, and also this question of mine is a bit "stupid" :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I this PR is sensible, clean, and good to go
Fixes #924
I made a function which given the instrument values for 'on' and 'off' maps all the obvious inputs (1, True, 'On', 'on', 'ON') to on and off. The inverse always maps back to booleans which I chose relatively arbitrarily as 'the most sensible' to be the convention. Happy to extend it if more are voted for.
Also, Implemented in the rhode schwarz SGS100A for now but I imagine other drivers would also benefit from it.
TODO:
@WilliamHPNielsen @jenshnielsen