-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate checkdep_ps_distiller. #14046
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Deprecations | ||
```````````` | ||
|
||
``matplotlib.checkdep_ps_distiller`` is deprecated. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,12 @@ | |
""" | ||
from collections.abc import Iterable, Mapping | ||
from functools import reduce | ||
import logging | ||
import operator | ||
import os | ||
import re | ||
|
||
import matplotlib as mpl | ||
from matplotlib import cbook | ||
from matplotlib.cbook import ls_mapper | ||
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern | ||
|
@@ -28,6 +30,7 @@ | |
from cycler import Cycler, cycler as ccycler | ||
|
||
|
||
_log = logging.getLogger(__name__) | ||
# The capitalized forms are needed for ipython at present; this may | ||
# change for later versions. | ||
interactive_bk = ['GTK3Agg', 'GTK3Cairo', | ||
|
@@ -534,11 +537,22 @@ def update_savefig_format(value): | |
def validate_ps_distiller(s): | ||
if isinstance(s, str): | ||
s = s.lower() | ||
if s in ('none', None): | ||
if s in ('none', None, 'false', False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (these values are treated the same) |
||
return None | ||
elif s in ('false', False): | ||
return False | ||
elif s in ('ghostscript', 'xpdf'): | ||
try: | ||
mpl._get_executable_info("gs") | ||
except FileNotFoundError: | ||
_log.warning("Setting rcParams['ps.usedistiller'] requires " | ||
"ghostscript.") | ||
return None | ||
if s == "xpdf": | ||
try: | ||
mpl._get_executable_info("pdftops") | ||
except FileNotFoundError: | ||
_log.warning("Setting rcParams['ps.usedistiller'] to 'xpdf' " | ||
"requires xpdf.") | ||
return None | ||
return s | ||
else: | ||
raise ValueError('matplotlibrc ps.usedistiller must either be none, ' | ||
|
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.
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.
Why is it deprecated? Is it useless, or is there an alternative to use instead?
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.
It is useless and undocumented.
Well of course you could be trying to use this to figure out whether a ps distiller that happens to match the ones that matplotlib supports is installed. In which case they can now just try to assign to
rcParams["ps.usedistiller"]
and see whether the setter complains. But frankly I just don't think it's a realistic use case and adding this to the changelog is essentially noise, I would say.