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
UserWarning thrown when importing hypertools in jupyter notebook #145
Comments
@jeremymanning hmmm i'm having trouble replicating this warning. can you verify that you are running version 0.3.0? |
also, which matplotlib and jupyter version? |
here's the version info (all of this is from the MIND Docker Container
|
got it, thanks. I was able to replicate this by importing hypertools and seaborn in the same notebook. They both rely on matplotlib and both attempt to change the default matplotlib backend. I can suppress the warning, but it also may be informative to throw a different error that says that hypertools couldn't switch the matplotlib backend, so it may not work properly. Currently, we switch the backend from |
But don't we import seaborn from within hypertools? And if so, what's the purpose of the warning? |
The purpose of the warning is to let the user know that the matplotlib backend was not switched. hmm, yea we do import seaborn, but we import matplotlib before anything else, and I think seaborn supresses the warning. This is in our top level init.py script:
In the jupyter notebook you tried, do you import seaborn or anything else relying on matplotlib before hypertools? |
Ah-- it seems like this could be it. I get the warning when importing one or both of However, if both seaborn and nilearn mess with the matplotlib backend (but don't output warnings when they are imported together), I think hypertools should follow that behavior as well (by suppressing this warning). Basically, my thinking is that I don't see the warning being useful, but it makes hypertools look slightly messier. Side question: was the |
Another note: it doesn't seem to matter if hypertools is imported first or last. |
Sounds good. this is the line to get fonts to export correctly:
|
this is fixed on 9de0a51. i added:
|
🍾 |
ill push this to pip as 0.3.1 |
thanks! |
When importing hypertools in a jupyter notebook (
import hypertools as hyp
), the following warning is thrown:Proposed fix: suppress this warning within hypertools (more info here)
The text was updated successfully, but these errors were encountered: