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
fix incorrect return value in M4i driver for ACDC_offs_compensation_x #1585
fix incorrect return value in M4i driver for ACDC_offs_compensation_x #1585
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1585 +/- ##
=======================================
Coverage 72.33% 72.33%
=======================================
Files 116 116
Lines 12388 12388
=======================================
Hits 8961 8961
Misses 3427 3427 |
i don't think it is an "ok" solution. hiding the issue is not acceptable. but what happens when HF is disabled and generally, if existence and/or meaning of some parameters depends on whether HF is enabled or not, then the driver should've been implemented in such a way that these parameters only appear when HF is enabled. Perhaps, HF-related things should've been encapsulated in its own submodule/InstrumentChannel/whatever. But since it's not the case, and we seem to want a quick solution, i'd prefer to know first why the "if" statement is needed. And if it is indeed, needed, then i'd suggest to add some sort of "UNDEFINED" value to the list of allowed values of that parameter, such that the value of this parameter is UNDEFINED when HF is disabled. another "work around" that i can suggest (although it's also not good) is to set "snapshot_get" of the parameter to True when HF is enabled and to False when HF is disabled. This will avoid re-getting the parameter value from the instrument upon snapshotting with update=True when HF is disabled. |
are you planning to fix the "warning issue" in this same PR? If so, after pushing the fix, please update the name and the description of the PR so that it's clear what is being changed and why. The PR descriptions are crucial when looking for something in the history, and for writing changelogs upon a new release. |
@astafan8 I don't think the original authors of the driver used these options, and neither do I so I don't know any reasons by the current code is the way it is. I would say that converting the warning to info in the |
magic numbers are never a good idea ;)
ok, but i then need to ask - if there is no warning on get, and HF is disabled, the "parameter get" will return |
@astafan8 To be honest, I don't even know what this parameter is. But each time a user connects to the M4i (with default values) we get a warning with the get statement, which doesn't make sense. The current behaviour of the get (e.g. always return It is the responsbility of the user to make sure the correct settings are used in HF mode. I am fine with adding a docstring and a |
@astafan8 I updated the PR and the description |
( thanks for the updated description! ) |
The
ACDC_offs_compensation_x
parameters did not return any value. This PR fixes this by returning the correct valueAlso the warning that is generated when the card is in HF mode is reduced, since the card is by default not in HF mode and therefore the warning is invalid.
The warning is converted to
info
level and the docstring of the parameter is updated.