-
Notifications
You must be signed in to change notification settings - Fork 86
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
Fix typechecking with newest qcodes and Numpy #116
Conversation
ef5bb5f
to
422d631
Compare
@jpsecher For the QDAC2 this method was typed as returning a sequence but does actually return a numpy array Unfortunately numpy arrays are currently not considered sequences see numpy/numpy#2776 Do you have a preference if the type signature should change like I have done here or we should convert the output to a list |
bd21dd8
to
7af3a32
Compare
Numpy 1.22 triggers a type checking error in the m4i driver related to from buffer. Since I don't have much context on this driver I have silenced the warning here but perhaps you want to look into a better fix? |
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
==========================================
+ Coverage 19.81% 19.85% +0.03%
==========================================
Files 121 121
Lines 14703 14709 +6
==========================================
+ Hits 2914 2920 +6
Misses 11789 11789
Continue to review full report at Codecov.
|
I will have a look at the M4i driver. This week I already worked on another fix for the driver. |
I just learned that numpy 1.22 requires Python 3.8. However Python 3.8 is not supported by the older Keysight PXI system drivers and firmware. It requires the latest drivers and firmware that have been released in December 2021. What's the policy of qcodes regarding the supported Python versions? |
@jenshnielsen thanks, the changes to QDAC2.py look fine. |
@sldesnoo-Delft this does not actually drop 3.7 support just yet but just stops type checking with 3.7. We were going to drop 3.7 exactly because numpy, pandas, xarray ipython and so on has dropped support. Could you copy your comment into microsoft/Qcodes#3889 that may be an important datapoint for delaying the dropping of 3.7 but its nice if we can collect all info there. |
With newer versions of qcodes the typing of ChannelList has improved to reflect that
__getitem__
always returns a InstrumentChannel when called with an int so this cast is now redundantNumpy has become significantly more strict uncovering a few issues