-
Notifications
You must be signed in to change notification settings - Fork 320
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
Use typeddicts for better kwargs typing in Instrument classes #6012
Merged
Conversation
This file contains 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
jenshnielsen
commented
Apr 27, 2024
jenshnielsen
commented
Apr 27, 2024
jenshnielsen
commented
Apr 29, 2024
jenshnielsen
force-pushed
the
typed_kwargs
branch
3 times, most recently
from
April 30, 2024 08:03
3ab2245
to
1972632
Compare
jenshnielsen
changed the title
[WIP] Use typeddicts for better kwargs typing in Instrument classes
Use typeddicts for better kwargs typing in Instrument classes
May 1, 2024
jenshnielsen
force-pushed
the
typed_kwargs
branch
3 times, most recently
from
May 13, 2024 08:12
8d37784
to
b5d6476
Compare
astafan8
approved these changes
May 13, 2024
jenshnielsen
force-pushed
the
typed_kwargs
branch
from
May 17, 2024 10:41
1fe9835
to
144c51b
Compare
This is equivalent to just float
This was referenced May 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This means that the **kwargs of a Instrument class will exactly match the super class while transparently keeping the ability to add another kwarg to the instrument class when required.
The one downside of this is that it is not possible to override the default value of a kwarg in a subclass since that results in an error about overlapping kwargs. We use this pattern fairly frequently in visa instruments to change the default value of the terminator. In this code we therefor do not add the terminator kwarg to the TypedDict
In a separate pr