Skip to content

Add a public backend fallback API #17386

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

Open
anntzer opened this issue May 12, 2020 · 2 comments
Open

Add a public backend fallback API #17386

anntzer opened this issue May 12, 2020 · 2 comments

Comments

@anntzer
Copy link
Contributor

anntzer commented May 12, 2020

Bug report

Bug summary

Back in #11600/#11896 I added backend fallback autodetection, which (by default) picks the first available backend among macosx, qt5agg, qt4agg, gtk3agg, etc. Initially the fallback order was configurable, but that got removed before the PRs were merged because of concerns about the API. I would like to revive that feature (essentially so that I can configure my envs to use module://mplcairo.qt by default, but module://mplcairo.base when no $DISPLAY is available). In itself it's not really hard, it's just a matter of what API we expose. One concern was that the initial approach was to put the list of backends to attempt in rcParams["backend"], which made that entry "active" (it's not just a plain dict entry, but something rather more complicated). One possible API (considering that this mostly just only needs to work before importing matplotlib) may be to only support configuring this in the $MPLBACKEND environment variable, which could e.g. be set to a (semi?)colon-separated list of backends to attempt.

@QuLogic
Copy link
Member

QuLogic commented May 12, 2020

Since colon goes in module://, I guess that won't work as separator. A comma or semi-colon would work, as they aren't allowed in import paths.

@tacaswell tacaswell added this to the v3.4.0 milestone May 12, 2020
@anntzer
Copy link
Contributor Author

anntzer commented May 14, 2020

Let's just use a comma, that'll save on having to quote it (and I don't see many reasons to not pick it).

@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Sep 25, 2021
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Aug 24, 2022
@QuLogic QuLogic modified the milestones: v3.7.0, future releases Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants