8000 Deprecate unused rcParams["animation.html_args"]. · matplotlib/matplotlib@3414ac0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3414ac0

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 7b6eb77 commit 3414ac0

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

doc/api/next_api_changes/deprecations.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,8 @@ variables is deprecated. Additional fonts may be registered using
173173
``matplotlib.compat``
174174
~~~~~~~~~~~~~~~~~~~~~
175175
This module is deprecated.
176+
177+
``animation.html_args`` rcParam
178+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179+
The unused ``animation.html_args`` rcParam and ``animation.HTMLWriter.args_key``
180+
attribute are deprecated.

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ def gen_candidates():
609609
# listed in the rcParams (not included in _all_deprecated).
610610
# Values are tuples of (version,)
611611
_deprecated_remain_as_none = {
612+
'animation.html_args': ('3.3',),
612613
}
613614

614615

lib/matplotlib/animation.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,11 @@ class HTMLWriter(FileMovieWriter):
780780
"""Writer for JavaScript-based HTML movies."""
781781

782782
supported_formats = ['png', 'jpeg', 'tiff', 'svg']
783-
_args_key = 'animation.html_args'
783+
784+
@cbook.deprecated("3.3")
785+
@property
786+
def args_key(self):
787+
return 'animation.html_args'
784788

785789
@classmethod
786790
def isAvailable(cls):
@@ -789,21 +793,23 @@ def isAvailable(cls):
789793
def __init__(self, fps=30, codec=None, bitrate=None, extra_args=None,
790794
metadata=None, embed_frames=False, default_mode='loop',
791795
embed_limit=None):
796+
797+
if extra_args:
798+
_log.warning("HTMLWriter ignores 'extra_args'")
799+
extra_args = () # Don't lookup nonexistent rcParam[args_key].
792800
self.embed_frames = embed_frames
793801
self.default_mode = default_mode.lower()
802+
cbook._check_in_list(['loop', 'once', 'reflect'],
803+
default_mode=self.default_mode)
794804

795805
# Save embed limit, which is given in MB
796806
if embed_limit is None:
797807
self._bytes_limit = mpl.rcParams['animation.embed_limit']
798808
else:
799809
self._bytes_limit = embed_limit
800-
801810
# Convert from MB to bytes
802811
self._bytes_limit *= 1024 * 1024
803812

804-
cbook._check_in_list(['loop', 'once', 'reflect'],
805-
default_mode=self.default_mode)
806-
807813
super().__init__(fps, codec, bitrate, extra_args, metadata)
808814

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

matplotlibrc.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@
740740
#animation.bitrate : -1 ## Controls size/quality tradeoff for movie.
741741
## -1 implies let utility auto-determine
742742
#animation.frame_format : png ## Controls frame format used by temp files
743-
#animation.html_args : ## Additional arguments to pass to html writer
744743
#animation.ffmpeg_path : ffmpeg ## Path to ffmpeg binary. Without full path
745744
## $PATH is searched
746745
#animation.ffmpeg_args : ## Additional arguments to pass to ffmpeg

0 commit comments

Comments
 (0)
0