Skip to content

Commit 6e7ac04

Browse files
committed
Deprecate unused rcParams["animation.html_args"].
I guess it was intended as a parallel for e.g. `animation.ffmpeg_args` -- a list of command-line arguments additionally passed to ffmpeg -- but no external program is used by the html animation writer.
1 parent 030157c commit 6e7ac04

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
The unused ``animation.html_args`` rcParam and ``animation.HTMLWriter.args_key``
5+
attribute are deprecated.

lib/matplotlib/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ def gen_candidates():
731731
'savefig.frameon': ('3.1',),
732732
'verbose.fileo': ('3.1',),
733733
'verbose.level': ('3.1',),
734+
'animation.html_args': ('3.3',),
734735
}
735736

736737

lib/matplotlib/animation.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,11 @@ def _embedded_frames(frame_list, frame_format):
788788
@writers.register('html')
789789
class HTMLWriter(FileMovieWriter):
790790
supported_formats = ['png', 'jpeg', 'tiff', 'svg']
791-
args_key = 'animation.html_args'
791+
792+
@cbook.deprecated("3.3")
793+
@property
794+
def args_key(self):
795+
return 'animation.html_args'
792796

793797
@classmethod
794798
def isAvailable(cls):
@@ -797,21 +801,23 @@ def isAvailable(cls):
797801
def __init__(self, fps=30, codec=None, bitrate=None, extra_args=None,
798802
metadata=None, embed_frames=False, default_mode='loop',
799803
embed_limit=None):
804+
805+
if extra_args:
806+
_log.warning("HTMLWriter ignores 'extra_args'")
807+
extra_args = () # Don't lookup nonexistent rcParam[args_key].
800808
self.embed_frames = embed_frames
801809
self.default_mode = default_mode.lower()
810+
cbook._check_in_list(['loop', 'once', 'reflect'],
811+
default_mode=self.default_mode)
802812

803813
# Save embed limit, which is given in MB
804814
if embed_limit is None:
805815
self._bytes_limit = rcParams['animation.embed_limit']
806816
else:
807817
self._bytes_limit = embed_limit
808-
809818
# Convert from MB to bytes
810819
self._bytes_limit *= 1024 * 1024
811820

812-
cbook._check_in_list(['loop', 'once', 'reflect'],
813-
default_mode=self.default_mode)
814-
815821
super().__init__(fps, codec, bitrate, extra_args, metadata)
816822

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

matplotlibrc.template

-1
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,6 @@
734734
#animation.bitrate : -1 ## Controls size/quality tradeoff for movie.
735735
## -1 implies let utility auto-determine
736736
#animation.frame_format : png ## Controls frame format used by temp files
737-
#animation.html_args : ## Additional arguments to pass to html writer
738737
#animation.ffmpeg_path : ffmpeg ## Path to ffmpeg binary. Without full path
739738
## $PATH is searched
740739
#animation.ffmpeg_args : ## Additional arguments to pass to ffmpeg

0 commit comments

Comments
 (0)