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: fix coil_constant-related bugs of current- and field- parameters #1527

Merged
merged 14 commits into from
May 21, 2019

Conversation

astafan8
Copy link
Contributor

@astafan8 astafan8 commented Mar 21, 2019

Fixes:

  • has_current_rating argument/attribute should only matter for field_rating parameter, not for field_ramp_limit parameter.
  • Update scale of field_limit parameter when a coil_constant is set
  • Add tests for field* and current* parameters so that they are proportional via coil_constant
  • Add tests reducing ramp_rate if new current_ramp_limit or field_ramp_limit is lower than ramp_rate
  • Apply PEP8
  • Fix AMI430 simulation yaml file

This PR might end up resolving #1525.

has_current_rating argument should only matter for field_rating,
not for field_ramp_limit.
@astafan8 astafan8 changed the title AMI430: fixing coil constant issues and perhaps more AMI430: fix coil_constant-related bugs of current- and field- parameters Mar 22, 2019
This parameter is linked to current_limit paramater via
coil_constant as a scale, so when
coil_constant changes, the scale also needs to be updated.
This is more useful for tests.
Ensure that inter-dependent parameters (like coil-field-current) are all
updated correctly when one of them gets updated.
@astafan8
Copy link
Contributor Author

@damazter Could you see if this PR fixes the coil-constant issue #1525 ?

@astafan8 astafan8 marked this pull request as ready for review March 22, 2019 16:39
@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #1527 into master will increase coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1527      +/-   ##
==========================================
+ Coverage   72.03%   72.12%   +0.09%     
==========================================
  Files         105      105              
  Lines       12304    12305       +1     
==========================================
+ Hits         8863     8875      +12     
+ Misses       3441     3430      -11

@jenshnielsen
Copy link
Collaborator

Did we ever figure out why this difference exists. Afaik it had something todo with the driver/docs version on AMIs webpage being out of date and the new versions only being on bitbucket? It would be good to at least update the comments about this.

@astafan8
Copy link
Contributor Author

astafan8 commented Apr 1, 2019

@jenshnielsen with the "difference" you mean the has_current_rating attribute? and with "update comment" you mean to update the following one?:
https://github.com/QCoDeS/Qcodes/blob/4c4f8f5edd9cd94fabf3ceb07cb4df556d347ece/qcodes/instrument_drivers/american_magnetics/AMI430.py#L177-L180

@WilliamHPNielsen
Copy link
Contributor

That comment still reflects my knowledge, unfortunately. But I have not compared firmware versions of different models, so there is still the possibility that we'll be able to figure out roughly in what firmware version that feature was added/removed.

@astafan8
Copy link
Contributor Author

astafan8 commented May 6, 2019

This PR will hopefully be tested next week with @damazter2 in Delft.

@astafan8
Copy link
Contributor Author

Thanks to @damazter @damazter2 rigorous testing of this change, we now confirm that the coil-constant related bugs are solved. By request of Damaz, two tests were added: one that runs the coil-constant/field/current-limit tests with arbitrary values and a number of times, and one new test for the fact that ramp_rate is reduced when ramp_limit is made lower than the current (now) ramp_rate.

After CI shows green, I am going to merge this. @QCoDeS/core any objections?

warnings.simplefilter('ignore', category=AMI430Warning)

test_current_and_field_params_interlink_at_init(ami430)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to make this a bit more DRY by looping over 3 tuples or pytest parametrize ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. i can probably hard-code some values and use permutations from itertools or smth.

but only if you insist :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer but I don't insist. That's why its a question :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok :)

@astafan8 astafan8 merged commit a2fc580 into microsoft:master May 21, 2019
@astafan8 astafan8 deleted the ami-coil-constant-fixes branch May 21, 2019 17:20
giulioungaretti pushed a commit that referenced this pull request May 21, 2019
Merge: 3f92a67 700ba9a
Author: Mikhail Astafev <astafan8@gmail.com>

    Merge pull request #1527 from astafan8/ami-coil-constant-fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants