Convert "osx" gui framework to/from "macosx" in Matplotlib #14420
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.
This is a correction to the code that moves backend handling to Matplotlib, which came to light during the review of matplotlib/matplotlib#27948. The GUI framework of macOSX is called
osx
in IPython butmacosx
in Matplotlib.It would be possible to allow passing a GUI framework of
osx
to Matplotlib and internally converting it tomacosx
, but the reverse direction is problematic as we would like the answer to beosx
if we are using IPython andmacosx
if using pure Matplotlib. Therefore the simplest solution is to do the translation in IPython. It is not ideal as we want to minimise such Matplotlib-related implementation details in IPython, but the changes here are small and simple and hence I think they are acceptable.There are two new private functions
_convert_gui_to_matplotlib
and_convert_gui_from_matplotlib
to do the required checking and conversion, and these are called whenever a GUI framework name is passed to or from Matplotlib. There are only 3 places in the code where this is currently required.Inevitably this comes to light just after the release of IPython 8.24.0! But it is not a problem for end users until the next Matplotlib release which contains matplotlib/matplotlib#27948. If that occurs really quickly (sometime in May?) perhaps we could release an IPython 8.24.1 just beforehand, otherwise the usual planned release at the end of next month would be fine.