Skip to content

Deprecate unused rcParams["animation.html_args"]. #15318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,8 @@ Path helpers in :mod:`.bezier`

``bezier.concatenate_paths`` is deprecated. Use ``Path.make_compound_path()``
instead.

``animation.html_args`` rcParam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The unused ``animation.html_args`` rcParam and ``animation.HTMLWriter.args_key``
attribute are deprecated.
1 change: 1 addition & 0 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ def gen_candidates():
'datapath': ('3.2.1',),
'animation.avconv_path': ('3.3',),
'animation.avconv_args': ('3.3',),
'animation.html_args': ('3.3',),
'mathtext.fallback_to_cm': ('3.3',),
'keymap.all_axes': ('3.3',),
'savefig.jpeg_quality': ('3.3',),
Expand Down
16 changes: 11 additions & 5 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@ class HTMLWriter(FileMovieWriter):
"""Writer for JavaScript-based HTML movies."""

supported_formats = ['png', 'jpeg', 'tiff', 'svg']
_args_key = 'animation.html_args'

@cbook.deprecated("3.3")
@property
def args_key(self):
return 'animation.html_args'

@classmethod
def isAvailable(cls):
Expand All @@ -793,21 +797,23 @@ def isAvailable(cls):
def __init__(self, fps=30, codec=None, bitrate=None, extra_args=None,
metadata=None, embed_frames=False, default_mode='loop',
embed_limit=None):

if extra_args:
_log.warning("HTMLWriter ignores 'extra_args'")
extra_args = () # Don't lookup nonexistent rcParam[args_key].
self.embed_frames = embed_frames
self.default_mode = default_mode.lower()
cbook._check_in_list(['loop', 'once', 'reflect'],
default_mode=self.default_mode)

# Save embed limit, which is given in MB
if embed_limit is None:
self._bytes_limit = mpl.rcParams['animation.embed_limit']
else:
self._bytes_limit = embed_limit

# Convert from MB to bytes
self._bytes_limit *= 1024 * 1024

cbook._check_in_list(['loop', 'once', 'reflect'],
default_mode=self.default_mode)

super().__init__(fps, codec, bitrate, extra_args, metadata)

def setup(self, fig, outfile, dpi, frame_dir=None):
Expand Down
1 change: 0 additions & 1 deletion matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@
#animation.bitrate: -1 # Controls size/quality tradeoff for movie.
# -1 implies let utility auto-determine
#animation.frame_format: png # Controls frame format used by temp files
#animation.html_args: # Additional arguments to pass to html writer
#animation.ffmpeg_path: ffmpeg # Path to ffmpeg binary. Without full path
# $PATH is searched
#animation.ffmpeg_args: # Additional arguments to pass to ffmpeg
Expand Down