Skip to content

Commit 796e68e

Browse files
authored
Merge pull request #15318 from anntzer/htmlextraargs
Deprecate unused rcParams["animation.html_args"].
2 parents 63b6312 + 07d8a51 commit 796e68e

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

doc/api/next_api_changes/deprecations.rst

+5
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,8 @@ Path helpers in :mod:`.bezier`
381381

382382
``bezier.concatenate_paths`` is deprecated. Use ``Path.make_compound_path()``
383383
instead.
384+
385+
``animation.html_args`` rcParam
386+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387+
The unused ``animation.html_args`` rcParam and ``animation.HTMLWriter.args_key``
388+
attribute are deprecated.

lib/matplotlib/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ def gen_candidates():
619619
'datapath': ('3.2.1',),
620620
'animation.avconv_path': ('3.3',),
621621
'animation.avconv_args': ('3.3',),
622+
'animation.html_args': ('3.3',),
622623
'mathtext.fallback_to_cm': ('3.3',),
623624
'keymap.all_axes': ('3.3',),
624625
'savefig.jpeg_quality': ('3.3',),

lib/matplotlib/animation.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,11 @@ class HTMLWriter(FileMovieWriter):
784784
"""Writer for JavaScript-based HTML movies."""
785785

786786
supported_formats = ['png', 'jpeg', 'tiff', 'svg']
787-
_args_key = 'animation.html_args'
787+
788+
@cbook.deprecated("3.3")
789+
@property
790+
def args_key(self):
791+
return 'animation.html_args'
788792

789793
@classmethod
790794
def isAvailable(cls):
@@ -793,21 +797,23 @@ def isAvailable(cls):
793797
def __init__(self, fps=30, codec=None, bitrate=None, extra_args=None,
794798
metadata=None, embed_frames=False, default_mode='loop',
795799
embed_limit=None):
800+
801+
if extra_args:
802+
_log.warning("HTMLWriter ignores 'extra_args'")
803+
extra_args = () # Don't lookup nonexistent rcParam[args_key].
796804
self.embed_frames = embed_frames
797805
self.default_mode = default_mode.lower()
806+
cbook._check_in_list(['loop', 'once', 'reflect'],
807+
default_mode=self.default_mode)
798808

799809
# Save embed limit, which is given in MB
800810
if embed_limit is None:
801811
self._bytes_limit = mpl.rcParams['animation.embed_limit']
802812
else:
803813
self._bytes_limit = embed_limit
804-
805814
# Convert from MB to bytes
806815
self._bytes_limit *= 1024 * 1024
807816

808-
cbook._check_in_list(['loop', 'once', 'reflect'],
809-
default_mode=self.default_mode)
810-
811817
super().__init__(fps, codec, bitrate, extra_args, metadata)
812818

813819
def setup(self, fig, outfile, dpi, frame_dir=None):

matplotlibrc.template

-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,6 @@
728728
#animation.bitrate: -1 # Controls size/quality tradeoff for movie.
729729
# -1 implies let utility auto-determine
730730
#animation.frame_format: png # Controls frame format used by temp files
731-
#animation.html_args: # Additional arguments to pass to html writer
732731
#animation.ffmpeg_path: ffmpeg # Path to ffmpeg binary. Without full path
733732
# $PATH is searched
734733
#animation.ffmpeg_args: # Additional arguments to pass to ffmpeg

0 commit comments

Comments
 (0)