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

AMI430 driver setting set point despite being outside safe region #1162

Merged
merged 8 commits into from
Jul 17, 2018

Conversation

sohailc
Copy link
Member

@sohailc sohailc commented Jun 26, 2018

Solves issue #1143

The problem was that the set point vector was adjusted before testing that the set point was safe.

…ments and then update _set_point.

2) get rid of "_set_x", "_set_y", etc. Instead have a single "_set_setpoints" method
3) Make the "test_ramp_down_first" more robust by not checking time stamps any more
4) In the test which tests field limits assert that the set point is not set when an error is raised.
@sohailc sohailc changed the title 1) the routine setting set points will first adjust individual instru… AMI430 driver setting set point despite being outside safe region Jun 27, 2018
@codecov
Copy link

codecov bot commented Jun 27, 2018

Codecov Report

Merging #1162 into master will increase coverage by 0.06%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##           master    #1162      +/-   ##
==========================================
+ Coverage   79.71%   79.78%   +0.06%     
==========================================
  Files          48       48              
  Lines        6686     6662      -24     
==========================================
- Hits         5330     5315      -15     
+ Misses       1356     1347       -9

@@ -570,90 +570,88 @@ def __init__(self, name, instrument_x, instrument_y,
# Get and set parameters for the set points of the coordinates
self.add_parameter(
'cartesian',
get_cmd=partial(self._get_setpoints, 'x', 'y', 'z'),
set_cmd=self._set_cartesian,
get_cmd=partial(self._get_setpoints, ['x', 'y', 'z']),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mutable default arguments to functions always makes me slightly nervous. These are never modified so you could make them tuples right?

Copy link
Member Author

Choose a reason for hiding this comment

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

mutable defaults? Where do you see that? I guess I can change that to a tuple without problems

Copy link
Member Author

Choose a reason for hiding this comment

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

Or will partial create a function with a list as default arguments? I did not think of that... :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sohailc yes that's my thinking, It's a small issue for sure since this never modified the input arg

@sohailc sohailc merged commit ed9b6fe into microsoft:master Jul 17, 2018
giulioungaretti pushed a commit that referenced this pull request Jul 17, 2018
Merge: 16568f4 73306cf
Author: sohail chatoor <schatoor@gmail.com>

    Merge pull request #1162 from sohailc/fix/ami_invalid_field_limits_set
@sohailc sohailc deleted the fix/ami_invalid_field_limits_set branch October 3, 2018 18:42
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

3 participants