@@ -261,9 +261,6 @@ class MovieWriter(AbstractMovieWriter):
261
261
# stored. Third-party writers cannot meaningfully set these as they cannot
262
262
# extend rcParams with new keys.
263
263
264
- exec_key = _api .deprecate_privatize_attribute ("3.3" )
265
- args_key = _api .deprecate_privatize_attribute ("3.3" )
266
-
267
264
# Pipe-based writers only support RGBA, but file-based ones support more
268
265
# formats.
269
266
supported_formats = ["rgba" ]
@@ -407,9 +404,7 @@ def __init__(self, *args, **kwargs):
407
404
super ().__init__ (* args , ** kwargs )
408
405
self .frame_format = mpl .rcParams ['animation.frame_format' ]
409
406
410
- @_api .delete_parameter ("3.3" , "clear_temp" )
411
- def setup (self , fig , outfile , dpi = None , frame_prefix = None ,
412
- clear_temp = True ):
407
+ def setup (self , fig , outfile , dpi = None , frame_prefix = None ):
413
408
"""
414
409
Setup for writing the movie file.
415
410
@@ -423,13 +418,10 @@ def setup(self, fig, outfile, dpi=None, frame_prefix=None,
423
418
The dpi of the output file. This, with the figure size,
424
419
controls the size in pixels of the resulting movie file.
425
420
frame_prefix : str, optional
426
- The filename prefix to use for temporary files. If None (the
421
+ The filename prefix to use for temporary files. If * None* (the
427
422
default), files are written to a temporary directory which is
428
- deleted by `cleanup` (regardless of the value of *clear_temp*).
429
- clear_temp : bool, optional
430
- If the temporary files should be deleted after stitching
431
- the final result. Setting this to ``False`` can be useful for
432
- debugging. Defaults to ``True``.
423
+ deleted by `cleanup`; if not *None*, no temporary files are
424
+ deleted.
433
425
"""
434
426
self .fig = fig
435
427
self .outfile = outfile
@@ -444,7 +436,6 @@ def setup(self, fig, outfile, dpi=None, frame_prefix=None,
444
436
else :
445
437
self ._tmpdir = None
446
438
self .temp_prefix = frame_prefix
447
- self ._clear_temp = clear_temp
448
439
self ._frame_counter = 0 # used for generating sequential file names
449
440
self ._temp_paths = list ()
450
441
self .fname_format_str = '%s%%07d.%s'
@@ -453,15 +444,6 @@ def __del__(self):
453
444
if self ._tmpdir :
454
445
self ._tmpdir .cleanup ()
455
446
456
- @_api .deprecated ("3.3" )
457
- @property
458
- def clear_temp (self ):
459
- return self ._clear_temp
460
-
461
- @clear_temp .setter
462
- def clear_temp (self , value ):
463
- self ._clear_temp = value
464
-
465
447
@property
466
448
def frame_format (self ):
467
449
"""
@@ -488,10 +470,9 @@ def _base_temp_name(self):
488
470
489
471
def grab_frame (self , ** savefig_kwargs ):
490
472
# docstring inherited
491
- # Overloaded to explicitly close temp file.
492
473
# Creates a filename for saving using basename and counter.
493
474
path = Path (self ._base_temp_name () % self ._frame_counter )
494
- self ._temp_paths .append (path ) # Record the filename for later cleanup .
475
+ self ._temp_paths .append (path ) # Record the filename for later use .
495
476
self ._frame_counter += 1 # Ensures each created name is unique.
496
477
_log .debug ('FileMovieWriter.grab_frame: Grabbing frame %d to path=%s' ,
497
478
self ._frame_counter , path )
@@ -510,12 +491,6 @@ def _cleanup(self): # Inline to finish() once cleanup() is removed.
510
491
if self ._tmpdir :
511
492
_log .debug ('MovieWriter: clearing temporary path=%s' , self ._tmpdir )
512
493
self ._tmpdir .cleanup ()
513
- else :
514
- if self ._clear_temp :
515
- _log .debug ('MovieWriter: clearing temporary paths=%s' ,
516
- self ._temp_paths )
517
- for path in self ._temp_paths :
518
- path .unlink ()
519
494
520
495
521
496
@writers .register ('pillow' )
@@ -582,17 +557,6 @@ def output_args(self):
582
557
583
558
return args + ['-y' , self .outfile ]
584
559
585
- @classmethod
586
- def isAvailable (cls ):
587
- return (
588
- super ().isAvailable ()
589
- # Ubuntu 12.04 ships a broken ffmpeg binary which we shouldn't use.
590
- # NOTE: when removed, remove the same method in AVConvBase.
591
- and b'LibAv' not in subprocess .run (
592
- [cls .bin_path ()], creationflags = subprocess_creation_flags ,
593
- stdin = subprocess .DEVNULL , stdout = subprocess .DEVNULL ,
594
- stderr = subprocess .PIPE ).stderr )
595
-
596
560
597
561
# Combine FFMpeg options with pipe-based writing
598
562
@writers .register ('ffmpeg' )
@@ -651,45 +615,6 @@ def _args(self):
651
615
return [self .bin_path (), * args , * self .output_args ]
652
616
653
617
654
- # Base class of avconv information. AVConv has identical arguments to FFMpeg.
655
- @_api .deprecated ('3.3' )
656
- class AVConvBase (FFMpegBase ):
657
- """
658
- Mixin class for avconv output.
659
-
660
- To be useful this must be multiply-inherited from with a
661
- `MovieWriterBase` sub-class.
662
- """
663
-
664
- _exec_key = 'animation.avconv_path'
665
- _args_key = 'animation.avconv_args'
666
-
667
- # NOTE : should be removed when the same method is removed in FFMpegBase.
668
- isAvailable = classmethod (MovieWriter .isAvailable .__func__ )
669
-
670
-
671
- # Combine AVConv options with pipe-based writing
672
- @writers .register ('avconv' )
673
- class AVConvWriter (AVConvBase , FFMpegWriter ):
674
- """
675
- Pipe-based avconv writer.
676
-
677
- Frames are streamed directly to avconv via a pipe and written in a single
678
- pass.
679
- """
680
-
681
-
682
- # Combine AVConv options with file-based writing
683
- @writers .register ('avconv_file' )
684
- class AVConvFileWriter (AVConvBase , FFMpegFileWriter ):
685
- """
686
- File-based avconv writer.
687
-
688
- Frames are written to temporary files on disk and then stitched
689
- together at the end.
690
- """
691
-
692
-
693
618
# Base class for animated GIFs with ImageMagick
694
619
class ImageMagickBase :
695
620
"""
@@ -794,8 +719,6 @@ class HTMLWriter(FileMovieWriter):
794
719
"""Writer for JavaScript-based HTML movies."""
795
720
796
721
supported_formats = ['png' , 'jpeg' , 'tiff' , 'svg' ]
797
- args_key = _api .deprecated ("3.3" )(property (
798
- lambda self : 'animation.html_args' ))
799
722
800
723
@classmethod
801
724
def isAvailable (cls ):
@@ -892,19 +815,13 @@ def finish(self):
892
815
893
816
# duplicate the temporary file clean up logic from
894
817
# FileMovieWriter.cleanup. We can not call the inherited
895
- # versions of finished or cleanup because both assume that
818
+ # versions of finish or cleanup because both assume that
896
819
# there is a subprocess that we either need to call to merge
897
820
# many frames together or that there is a subprocess call that
898
821
# we need to clean up.
899
822
if self ._tmpdir :
900
823
_log .debug ('MovieWriter: clearing temporary path=%s' , self ._tmpdir )
901
824
self ._tmpdir .cleanup ()
902
- else :
903
- if self ._clear_temp :
904
- _log .debug ('MovieWriter: clearing temporary paths=%s' ,
905
- self ._temp_paths )
906
- for path in self ._temp_paths :
907
- path .unlink ()
908
825
909
826
910
827
class Animation :
0 commit comments