Skip to content

Commit 919c59a

Browse files
committed
DOC: Autoreformating of backend/*.py
Most of the changes are whitespaces, mostly in Parameters/definitions lines. You'll see two types, compact: ``` name : type description name : type description ``` and spaced: ``` name : type description <blankline> name : type description ``` The heuristic is the following: - if any of the "description" is multine and contain a blank line -> spaced. - otherwise -> compact.
1 parent 068e0f4 commit 919c59a

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,16 +545,13 @@ def print_jpg(self, filename_or_obj, *args, dryrun=False, pil_kwargs=None,
545545
the JPEG compression algorithm, and results in large files
546546
with hardly any gain in image quality. This parameter is
547547
deprecated.
548-
549548
optimize : bool, default: False
550549
Whether the encoder should make an extra pass over the image
551550
in order to select optimal encoder settings. This parameter is
552551
deprecated.
553-
554552
progressive : bool, default: False
555553
Whether the image should be stored as a progressive JPEG file.
556554
This parameter is deprecated.
557-
558555
pil_kwargs : dict, optional
559556
Additional keyword arguments that are passed to
560557
`PIL.Image.Image.save` when saving the figure. These take

lib/matplotlib/backends/backend_mixed.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,16 @@ def __init__(self, figure, width, height, dpi, vector_renderer,
2020
----------
2121
figure : `matplotlib.figure.Figure`
2222
The figure instance.
23-
2423
width : scalar
2524
The width of the canvas in logical units
26-
2725
height : scalar
2826
The height of the canvas in logical units
29-
3027
dpi : float
3128
The dpi of the canvas
32-
3329
vector_renderer : `matplotlib.backend_bases.RendererBase`
3430
An instance of a subclass of
3531
`~matplotlib.backend_bases.RendererBase` that will be used for the
3632
vector drawing.
37-
3833
raster_renderer_class : `matplotlib.backend_bases.RendererBase`
3934
The renderer class to use for the raster drawing. If not provided,
4035
this will use the Agg backend (which is currently the only viable

lib/matplotlib/backends/backend_pdf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def _create_pdf_info_dict(backend, metadata):
150150
----------
151151
backend : str
152152
The name of the backend to use in the Producer value.
153+
153154
metadata : Dict[str, Union[str, datetime, Name]]
154155
A dictionary of metadata supplied by the user with information
155156
following the PDF specification, also defined in
@@ -451,7 +452,6 @@ def __init__(self, id, len, file, extra=None, png=None):
451452
"""
452453
Parameters
453454
----------
454-
455455
id : int
456456
Object id of the stream.
457457
len : Reference or None
@@ -539,9 +539,9 @@ def __init__(self, filename, metadata=None):
539539
"""
540540
Parameters
541541
----------
542-
543542
filename : str or path-like or file-like
544543
Output target; if a string, a file will be opened for writing.
544+
545545
metadata : dict from strings to strings and dates
546546
Information dictionary object (see PDF reference section 10.2.1
547547
'Document Information Dictionary'), e.g.:
@@ -2470,9 +2470,11 @@ def __init__(self, filename, keep_empty=True, metadata=None):
24702470
Plots using `PdfPages.savefig` will be written to a file at this
24712471
location. The file is opened at once and any older file with the
24722472
same name is overwritten.
2473+
24732474
keep_empty : bool, optional
24742475
If set to False, then empty pdf files will be deleted automatically
24752476
when closed.
2477+
24762478
metadata : dict, optional
24772479
Information dictionary object (see PDF reference section 10.2.1
24782480
'Document Information Dictionary'), e.g.:

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,9 +1024,11 @@ def __init__(self, filename, *, keep_empty=True, metadata=None):
10241024
filename : str or path-like
10251025
Plots using `PdfPages.savefig` will be written to a file at this
10261026
location. Any older file with the same name is overwritten.
1027+
10271028
keep_empty : bool, default: True
10281029
If set to False, then empty pdf files will be deleted automatically
10291030
when closed.
1031+
10301032
metadata : dict, optional
10311033
Information dictionary object (see PDF reference section 10.2.1
10321034
'Document Information Dictionary'), e.g.:

lib/matplotlib/backends/backend_svg.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def end(self, tag=None, indent=True):
198198
tag
199199
Element tag. If given, the tag must match the start tag. If
200200
omitted, the current element is closed.
201-
"""
201+
"""
202202
if tag:
203203
assert self.__tags, "unbalanced end(%s)" % tag
204204
assert escape_cdata(tag) == self.__tags[-1], \
@@ -1023,11 +1023,11 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath, mtext=None):
10231023
Parameters
10241024
----------
10251025
s : str
1026-
text to be converted
1026+
text to be converted
10271027
prop : `matplotlib.font_manager.FontProperties`
1028-
font property
1028+
font property
10291029
ismath : bool
1030-
If True, use mathtext parser. If "TeX", use *usetex* mode.
1030+
If True, use mathtext parser. If "TeX", use *usetex* mode.
10311031
"""
10321032
writer = self.writer
10331033

@@ -1278,6 +1278,7 @@ def print_svg(self, filename, *args, **kwargs):
12781278
----------
12791279
filename : str or path-like or file-like
12801280
Output target; if a string, a file will be opened for writing.
1281+
12811282
metadata : Dict[str, Any], optional
12821283
Metadata in the SVG file defined as key-value pairs of strings,
12831284
datetimes, or lists of strings, e.g., ``{'Creator': 'My software',

lib/matplotlib/backends/qt_editor/_formlayout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ def __init__(self, data, comment="", with_margin=False, parent=None):
217217
data : list of (label, value) pairs
218218
The data to be edited in the form.
219219
comment : str, optional
220-
221220
with_margin : bool, default: False
222221
If False, the form elements reach to the border of the widget.
223222
This is the desired behavior if the FormWidget is used as a widget

0 commit comments

Comments
 (0)