-
Notifications
You must be signed in to change notification settings - Fork 331
Add support for Matplotlib 2.2 #1119
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
Conversation
… with nans in x and y axis
I tried running with matplotlib 2.2 in connection with qdev-dk/qdev-wrappers#88 and ran into errors with plotting. However, turned out the problem we were trying to solve was unrelated to matplotlib version. |
@ThorvaldLarsen I was referring to this one which I think depend on matplotlib version and which this fixes
|
Codecov Report
@@ Coverage Diff @@
## master #1119 +/- ##
=========================================
+ Coverage 78.79% 79% +0.21%
=========================================
Files 46 46
Lines 6564 6573 +9
=========================================
+ Hits 5172 5193 +21
+ Misses 1392 1380 -12 |
qcodes/plots/qcmatplotlib.py
Outdated
# numpy (1.14) has a deprecation warning related to shared | ||
# masks | ||
# lets silence this by making sure that this is not shared | ||
# before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 is nice and all but IMHO this indentation is worse than too long lines 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm still getting used to VSCode. That would just have been meta+q
in Emacs... sigh...
qcodes/plots/qcmatplotlib.py
Outdated
|
||
# now shift to get edges coordinates rather than center | ||
# coordinates | ||
# first Add padding on both sides equal to endpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is now wrong. Perhaps we should just use insert, That seems simpler than pad for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got mixed up a bit between reviewer and author, but I approve.
|
||
assert len(args[0]) == M + 1 | ||
assert len(args[1]) == N + 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not test that the content of x and y is as expected too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes... the test can/should be extended a lot. I just got very lazy.
Matplotlib no longer works with nans in the x and y coordinates for pcolormesh. This fills out any missing values by extrapolating based on the step size or the existing data, falling back to a default stepsize if there is only one line. IMHO this also makes the code for shifting coordinates from bin centers to edges slightly simpler.
@ThorvaldLarsen I think you saw this issue somewhere in the qdev wrappers.
@QCoDeS/core