Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/api/api_changes_3.3/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,7 @@ of all renderer classes is deprecated.

`.transforms.AffineDeltaTransform` can be used as a replacement. This API is
experimental and may change in the future.

``testing.compare.make_external_conversion_command``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... is deprecated.
9 changes: 7 additions & 2 deletions lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
Provides a collection of utilities for comparing (image) results.

Utilities for comparing image results.
"""

import atexit
Expand All @@ -17,6 +16,7 @@
import PIL

import matplotlib as mpl
from matplotlib import cbook
from matplotlib.testing.exceptions import ImageComparisonFailure

__all__ = ['compare_images', 'comparable_formats']
Expand Down Expand Up @@ -55,6 +55,7 @@ def get_file_hash(path, block_size=2 ** 20):
return md5.hexdigest()


@cbook.deprecated("3.3")
def make_external_conversion_command(cmd):
def convert(old, new):
cmdline = cmd(old, new)
Expand Down Expand Up @@ -194,6 +195,10 @@ def __call__(self, orig, dest):
# our encoding is even ASCII compatible... Just fall back on the
# slow solution (Inkscape uses `fgets` so it will always stop at a
# newline).
cbook.warn_deprecated(
"3.3", message="Support for converting files from paths "
"containing a newline is deprecated since %(since)s and "
"support will be removed %(removal)s")
return make_external_conversion_command(lambda old, new: [
'inkscape', '-z', old, '--export-png', new])(orig, dest)
self._proc.stdin.write(orig_b + b" --export-png=" + dest_b + b"\n")
Expand Down