-
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
ZI UHF-LI: fix scope_mode
and scope_average_weight
parameters
#1597
ZI UHF-LI: fix scope_mode
and scope_average_weight
parameters
#1597
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1597 +/- ##
=======================================
Coverage 72.17% 72.17%
=======================================
Files 116 116
Lines 12416 12416
=======================================
Hits 8961 8961
Misses 3455 3455 |
@@ -2265,7 +2278,7 @@ def getduration(): | |||
returndict = self.scope.get(querystr) | |||
# The dict may have different 'depths' depending on the parameter. | |||
# The depth is encoded in the setting string (number of '/') | |||
keys = setting.split('/')[1:] |
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.
Is this change the change responsible for making the getters for scope_mode
and scope_average_weight
work?
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.
yes
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.
as the setting
for scope_mode
is just mode
and for scope_average_weight
is averager/weight
then omitting the first part before a /
of the setting leaves an empty list for the mode
and a key error for the weight
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 see. And the _scope_getter
is only used for the scope_mode
, scope_average_weight
, and scope_duration
parameters, the latter of which is handled explicitly by the _scope_getter
function.
The changes look correct. I just wonder why the [1:]
was put in to begin with. Perhaps the setting nesting level changed in some firmware upgrade? If you can somehow check that, that would be fantastic. But since these changes make your version work, let's get them in.
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 went over the commit history of the original PR, and it seems that in commit 1066df6b01d6016da8ff7f34ccdfe201aea0fcfd
when the special case for duration
was added this bug was introduced. Before that commit, rawvalue = returndict
was outside and after the while loop while keys != []
and then it should have worked.
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.
Wow, good job! Thank you.
scope_mode
and scope_average_weight
parametersscope_mode
and scope_average_weight
parameters
Changes proposed in this pull request:
sweeper_sweeptime
insnapshot(update=True)
if_sweeper_signals
is an empty listscope_mode
andscope_average_weight
should workWhen taking a snapshot of the ZIUHFLI driver with update=True the following warnings are generated:
This should no longer be the case.
@WilliamHPNielsen