Repository navigation
Improve Ami430 safety and type annotations #8679
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
Merged
Jens Hedegaard Nielsen (jenshnielsen)
merged 11 commits into
microsoft:main
from
jenshnielsen:ami430_annotations
Oct 30, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c5b585a
Split AMI430 3D component and vector getters
jenshnielsen f4556da
Remove placeholder unit from AMI430 vector set points
jenshnielsen 33555c9
Annotate remaining AMI430 3D parameters
jenshnielsen 67d89a2
Use magnet field units for AMI430 3D field parameters
jenshnielsen adf024e
Add newsfragment for AMI430 unit fixes
jenshnielsen 2921adc
Rename newsfragments to PR 8679
jenshnielsen 0940ead
Detach AMI430 magnets when closing the 3D driver
jenshnielsen cc6bbfe
Block AMI430 field unit changes in a 3D driver
jenshnielsen dc8b9e6
Annotate AMI430 vector set points
jenshnielsen d1fea62
Return tuples from AMI430 coordinate vectors
jenshnielsen d69d1d5
Return named tuples from AMI430 coordinate vectors
jenshnielsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| The field units of an ``AMIModel430`` can no longer be changed while it is part of an | ||
| ``AMIModel4303D``, and doing so now raises a ``RuntimeError``. The set point and field limit of | ||
| the 3D driver are in the field units of the magnets, so changing them silently changed their | ||
| meaning by a factor of 10. Set the field units before creating the 3D driver, or close the 3D | ||
| driver first. | ||
|
|
||
| The coordinate vectors of ``AMIModel4303D`` (``cartesian``, ``spherical``, ``cylindrical`` and | ||
| their ``*_measured`` versions) now return a named tuple (``CartesianVector``, | ||
| ``SphericalVector`` or ``CylindricalVector`` from ``qcodes.math_utils``) instead of a list, so | ||
| the components can also be accessed by name, e.g. ``cartesian_measured().z``. Code that compares | ||
| the result to a list, or modifies it, needs updating. Setting these parameters still accepts | ||
| lists, tuples and numpy arrays. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| The field parameters of ``AMIModel4303D``, such as ``cartesian``, ``x`` and ``field_measured``, | ||
| now use the field units of the individual magnets, tesla or kilogauss, instead of always | ||
| reporting tesla. A warning is logged if the magnets use different field units. Also removed the | ||
| placeholder unit ``tuple?`` of ``AMIModel4303D.spherical`` and ``cylindrical``, whose components | ||
| have different units, which are now described in their docstrings. Closing an | ||
| ``AMIModel4303D`` now detaches its magnets, so ``set_field``, ``zero`` and changing the units of | ||
| a magnet that is still open no longer fail. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Added the named tuples ``CartesianVector`` (``x``, ``y``, ``z``), ``SphericalVector`` | ||
| (``field``, ``theta``, ``phi``) and ``CylindricalVector`` (``rho``, ``phi``, ``z``) to | ||
| ``qcodes.math_utils``, for the components of a field vector in a given coordinate system. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.