-
-
Notifications
You must be signed in to change notification settings - Fork 33
[Bug]: Figure manager is gone - AttributeError: 'NoneType' object has no attribute 'canvas' #18
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
Comments
Sorry, that return should have been a |
Thanks a lot, I have done as you have proposed! |
Return manager instead of None - fixes #18. Will release quickly a 0.1.6 with this fix.
@fperez thanks for the fast reaction and no worries. I just checked the repository and I was wondering whether there are any automated checks in place for the code? For example, unittests or Python type hints in combination with code linting might have helped to spot such an issue before release. I am just saying this because many, many people rely on this package. |
The issues should eb solved in ipython/matplotlib-inline#18
The issues has been solved in ipython/matplotlib-inline#18
No, there aren't - yesterday I was very pressed for time and basically had to decide "do I spend the window I have adding some CI/tests to this, or do I finish this release quickly so the manual fix is out?" And I went for the latter, but given all my preaching about good testing, I felt bad about it :) This package is tiny and moves very rarely, so in the past it hasn't been too terrible, but I 100% agree we should. Even putting in a few high-level tests in a notebook would be useful. I'll try to find the time for that now that 0.1.6 is out and we're back where we needed to, but feel free to beat me to it! |
I completely feel you! Some aspects can be tested better, such as "does this throw an exception in situations it should not", and some worse, such as "does it look beautiful". I have seen projects where they started a pixel-wise comparison of the expected and intended output. I believe humans are better in that task and it might be over the top for this project. But it is one important step to make the decision where to draw the line. I guess unittesting might be helpful but time-consuming as well. If there is some testing infrastructure in place that the leading maintainers are all happy with, I could add one or two automated tests as well - probably some nbconvert invocations or something similar. |
Inside my Jupyter Notebooks, I want to create several plots with matplotlib. Since the release of v0.1.5, my CI for my docs and unittests is failing now.
The error message goes like this:
I have checked the changes with git blame and saw that there is this line where the figure manager can turn None:
https://github.com/ipython/matplotlib-inline/blob/master/matplotlib_inline/backend_inline.py#L55 which has changed with commit 6380cd9.
Is it possible that this causes my issue? In my unittests, I use nbformat/nbconvert and for the docs I use nbsphinx. I am no expert in these tools myself but in each case just image files are generated and included in the output. They are in that sense not interactive. However, I still need the figure manager not to be None! A bit of discussion regarding this can be found at matplotlib/matplotlib#23648. There, it was mentioned that when the figure manager is None, something fishy is going on.
I am no expert in either tool. My first guess work, however, is that in 6380cd9 and later commits possibly some edge cases were not covered? I would love if you could have a look! Thank you!
The text was updated successfully, but these errors were encountered: