pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/e21576cd3e13efbbce32faa2f603a69ce1a068ea

ss" /> Expire unused positional parameters in canvas subclasses · matplotlib/matplotlib@e21576c · GitHub
Skip to content

Commit e21576c

Browse files
committed
Expire unused positional parameters in canvas subclasses
1 parent 6c09a56 commit e21576c

5 files changed

Lines changed: 13 additions & 16 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Unused positional parameters to ``print_<fmt>`` methods
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
None of the ``print_<fmt>`` methods implemented by canvas subclasses used
5+
positional arguments other that the first (the output filename or file-like),
6+
so these extra parameters are removed.

lib/matplotlib/backends/backend_agg.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ def buffer_rgba(self):
441441
"""
442442
return self.renderer.buffer_rgba()
443443

444-
@_api.delete_parameter("3.5", "args")
445-
def print_raw(self, filename_or_obj, *args):
444+
def print_raw(self, filename_or_obj):
446445
FigureCanvasAgg.draw(self)
447446
renderer = self.get_renderer()
448447
with cbook.open_file_cm(filename_or_obj, "wb") as fh:
@@ -460,9 +459,7 @@ def _print_pil(self, filename_or_obj, fmt, pil_kwargs, metadata=None):
460459
filename_or_obj, self.buffer_rgba(), format=fmt, origen="upper",
461460
dpi=self.figure.dpi, metadata=metadata, pil_kwargs=pil_kwargs)
462461

463-
@_api.delete_parameter("3.5", "args")
464-
def print_png(self, filename_or_obj, *args,
465-
metadata=None, pil_kwargs=None):
462+
def print_png(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
466463
"""
467464
Write the figure to a PNG file.
468465
@@ -521,8 +518,7 @@ def print_to_buffer(self):
521518
# print_figure(), and the latter ensures that `self.figure.dpi` already
522519
# matches the dpi kwarg (if any).
523520

524-
@_api.delete_parameter("3.5", "args")
525-
def print_jpg(self, filename_or_obj, *args, pil_kwargs=None):
521+
def print_jpg(self, filename_or_obj, *, pil_kwargs=None):
526522
# savefig() has already applied savefig.facecolor; we now set it to
527523
# white to make imsave() blend semi-transparent figures against an
528524
# assumed white background.

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,8 @@ class FigureCanvasPS(FigureCanvasBase):
822822
def get_default_filetype(self):
823823
return 'ps'
824824

825-
@_api.delete_parameter("3.5", "args")
826825
def _print_ps(
827-
self, fmt, outfile, *args,
826+
self, fmt, outfile, *,
828827
metadata=None, papertype=None, orientation='portrait',
829828
**kwargs):
830829

lib/matplotlib/backends/backend_svg.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,9 +1334,7 @@ class FigureCanvasSVG(FigureCanvasBase):
13341334

13351335
fixed_dpi = 72
13361336

1337-
@_api.delete_parameter("3.5", "args")
1338-
def print_svg(self, filename, *args, bbox_inches_restore=None,
1339-
metadata=None):
1337+
def print_svg(self, filename, *, bbox_inches_restore=None, metadata=None):
13401338
"""
13411339
Parameters
13421340
----------
@@ -1382,8 +1380,7 @@ def print_svg(self, filename, *args, bbox_inches_restore=None,
13821380
self.figure.draw(renderer)
13831381
renderer.finalize()
13841382

1385-
@_api.delete_parameter("3.5", "args")
1386-
def print_svgz(self, filename, *args, **kwargs):
1383+
def print_svgz(self, filename, **kwargs):
13871384
with cbook.open_file_cm(filename, "wb") as fh, \
13881385
gzip.GzipFile(mode='w', fileobj=fh) as gzipwriter:
13891386
return self.print_svg(gzipwriter, **kwargs)

lib/matplotlib/backends/backend_template.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ def draw(self):
197197
# you should add it to the class-scope filetypes dictionary as follows:
198198
filetypes = {**FigureCanvasBase.filetypes, 'foo': 'My magic Foo format'}
199199

200-
@_api.delete_parameter("3.5", "args")
201-
def print_foo(self, filename, *args, **kwargs):
200+
def print_foo(self, filename, **kwargs):
202201
"""
203202
Write out format foo.
204203

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy