GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MNT: Remove internal usage of the 'backend' key in rcParams by timhoffm · Pull Request #32495 · matplotlib/matplotlib

Conversation

@timhoffm

@timhoffm timhoffm commented Oct 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR summary

Working towards #31791.

This removes most internal usages of the 'backend' key (some usage in tests is still in place because I have to decide there whether we still want to test the key API).

It's conceptually a schematic replacement

  • rcParams._get('backend') -> rcParams._backend - obtain raw backend value
  • x = rcParams['backend'] -> x = rcParams._get_backend_resolved() - obtain resoved backend
  • rcParams['backend'] = x -> rcParams._set_backend(x) - store the value. Note that this write has no specific logic attatched. It's only be used to store the new backend value. We nevertheless use the class method becuase in some existing contexts we have an rcParams instance, in some we only have the RcParams class. The method can be called on both.

Note: There have been some places writing rcParamsDefault['backend'] and rcParamsOrig['backend']. These were needed to synchronize and persist backend information even after resetting rcParams. That's not needed anymore and thus removed now that the backend information only exists once as class attribute on RcParams.

Note2: In theory it would even be better to use RcParams._backend rather than access via instance rcParams._backend backend. I've not done that for now, because it would complicate the PR. We may do this in a followup.

AI Disclosure

No AI.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • N/A Plotting related features are demonstrated in an example
  • N/A New features and API changes have release notes
  • N/A Documentation complies with general and docstring guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the topic: pyplot API label Oct 17, 2026
@timhoffm
timhoffm force-pushed the rcparams-remove-backend-key-usage branch 3 times, most recently from 271de55 to 9409506 Compare October 17, 2026 08:36
@timhoffm
timhoffm marked this pull request as draft October 18, 2026 02:29
@timhoffm
timhoffm force-pushed the rcparams-remove-backend-key-usage branch from 9409506 to 16b40f1 Compare October 18, 2026 20:17
@timhoffm
timhoffm force-pushed the rcparams-remove-backend-key-usage branch 3 times, most recently from e6dad3d to e9a85a1 Compare November 5, 2026 00:51
@timhoffm
MNT: Remove internal usage of the 'backend' key in rcParams
01976cc
We use an internal helper class method RcParams._set_backend()
to make it easy to set backends in contexts where we do and
do not have an rcParams instance at hand.
@timhoffm
timhoffm force-pushed the rcparams-remove-backend-key-usage branch from e9a85a1 to 01976cc Compare November 5, 2026 07:50
@timhoffm
timhoffm marked this pull request as ready for review November 5, 2026 08:48
@timhoffm timhoffm mentioned this pull request Nov 5, 2026
[MNT]: Remove backend state handling from rcParams #31791
Open
1 of 4 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic: pyplot API

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@timhoffm
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.