More type safe ways of gettting channel attributes#7486
Merged
Conversation
8686990 to
6b6c99a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7486 +/- ##
=======================================
Coverage 59.73% 59.73%
=======================================
Files 347 347
Lines 31242 31249 +7
=======================================
+ Hits 18661 18666 +5
- Misses 12581 12583 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces more type-safe ways of getting channel attributes by improving type hints and adding a new deprecation warning for the get_channel_by_name method when used with multiple names.
Key changes:
- Adds explicit type annotations for parameters in mock instrument classes
- Introduces a new
get_channels_by_namemethod as a replacement for multi-name usage ofget_channel_by_name - Improves type safety by adding runtime type assertions in test code
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/test_channels.py | Adds type annotations, creates dedicated test class for channel lists, adds type assertions for better runtime type safety |
| src/qcodes/instrument_drivers/mock_instruments/init.py | Adds explicit type annotations for all parameter attributes in mock instrument classes |
| src/qcodes/instrument/channel.py | Implements new get_channels_by_name method and deprecation warning for multi-name usage of get_channel_by_name |
| docs/changes/newsfragments/7486.breaking | Documents the breaking change and deprecation |
astafan8
approved these changes
Sep 22, 2025
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
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.
No description provided.