-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: get_backend return None if no backend set #12592
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
Umm, hmmm. Not sure why CI is not running here |
Github is having issues with hooks I think... |
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.
See #12362 (comment) for my preferred solution. Returning yet another fake value and adding another parameter to say "nah, I want the real value" from get_backend() seems worse. (Plus, that doesn't help those who read rcParams["backend"] directly.)
I’m actually pretty strongly against having rcParams do things or having it store the current state of things. It should be a list of things the user would like to set and defaults and we should read it when we need to but we shouldn’t write to it and we shouldn’t trigger code from it’s getitem. That is really unexpected behaviour. |
As noted in the linked comment, it doesn't actually "do" things, except for the arbitraryish constraint we have that use() cannot be called once the backend is resolved. Again, that constraint is self-imposed; nothing magical happens upon backend resolution, it's only when the event loop starts (much later) that backend switching actually becomes impossible. |
I understand and agree that ...and I agree and understand that this would fix this issue. I'm still not comfortable with |
I am also 👎 on breaking type-stability of |
No, I'm returning a string.... But @anntzer and I discussed another possible fix... |
Ah, I did read too fast (and missed |
The title of the PR wasn't very clear ;-) But, I'll try and work on this a bit tonight and make it work, particularly now that the MacOSX stuff is merged (and hopefully works) |
PR Summary
Closes #12362
Allows the following to run if rcParams['backend'] is not already set.
Before
After
PR Checklist