Fix hidden=True still generating plots in Jupyter notebooks#32
Open
weisscharlesj wants to merge 7 commits into
Open
Fix hidden=True still generating plots in Jupyter notebooks#32weisscharlesj wants to merge 7 commits into
weisscharlesj wants to merge 7 commits into
Conversation
Moved all matpllotlib code in the mplplot() function into the if statement controlled by the hidden= parameter. This fixes the issues that hidden=True does not prevent plots from appearing in Jupyter notebooks.
Moved all matplotlib code into the if not hidden condition so that the plot doesn't show in a Jupyter notebook when hidden=True. This fixes an issue that the user cannot turn of plotting in the mplplot() function to use their own plotting library. Removed the deprecated and removed use_line_collection= argument from the plt.stem() function.
Updated .gitignore with *i.ni and *.bak.
Updated the qm_explanation.ipynb notebooks (both) imports by changing from IPython.core.display to IPython.display.
Added .ipynb_checkpoints to the exclude list for flake8 in the setup.cfg file.
The sphinxcontrib-napoleon package breaks in newer version of Python. Updated conf.py to use the version that comes with Sphinx.
Moved the rest of the plotting code inside the if not hidden conditions in mplplot(), mplplot_stick(), and mplplot_lineshape() functions. Removed print(lines) debugging code and removed the note about suppressing a warning until matplotlib 3.3 because this is now updated in the code.
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.
Fixed the issue where the mplplot(), mplplot_stem(), and mplplot_lineshape() functions still generate plots in Jupyter notebooks by moving all matplotlib code in these functions inside the if not hidden condition. Also cleaned up some code to account for newer versions of dependencies.
use_line_collectionkeyword argument fromax.stem()call inmplplot_stick(), which caused aTypeErrorin matplotlib 3.3+if not hidden:blocks inmplplot(),mplplot_stick(), andmplplot_lineshape()to prevent figures from rendering in Jupyter whenhidden=Truelinesvariable andprint(lines)) frommplplot()use_line_collectionwarning and updated stem() function calls by removing this deprecated and removed parameterAll pytest and flake8 tests pass with these changes.