PKsMM>11 celluloid.py"""Easy matplotlib animation.""" from typing import Dict, List from collections import defaultdict from matplotlib.figure import Figure from matplotlib.artist import Artist from matplotlib.animation import ArtistAnimation __version__ = '0.2.0' class Camera: """Make animations easier.""" def __init__(self, figure: Figure) -> None: """Create camera from matplotlib figure.""" self._figure = figure # need to keep track off artists for each axis self._offsets: Dict[str, Dict[int, int]] = { k: defaultdict(int) for k in [ 'collections', 'patches', 'lines', 'texts', 'artists', 'images' ] } self._photos: List[List[Artist]] = [] def snap(self) -> List[Artist]: """Capture current state of the figure.""" frame_artists: List[Artist] = [] for i, axis in enumerate(self._figure.axes): if axis.legend_ is not None: axis.add_artist(axis.legend_) for name in self._offsets: new_artists = getattr(axis, name)[self._offsets[name][i]:] frame_artists += new_artists self._offsets[name][i] += len(new_artists) self._photos.append(frame_artists) return frame_artists def animate(self, *args, **kwargs) -> ArtistAnimation: """Animate the snapshots taken. Uses matplotlib.animation.ArtistAnimation Returns ------- ArtistAnimation """ return ArtistAnimation(self._figure, self._photos, *args, **kwargs) PK.pMd--!celluloid-0.2.0.dist-info/LICENSEMIT License Copyright (c) 2018 Jacques Kvam Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR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