-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathplot.py
32 lines (23 loc) · 855 Bytes
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from enum import Enum
from ..paseos import PASEOS
from .space_animation import SpaceAnimation
class PlotType(Enum):
"""Describes the different plot types
1 - SpacePlot
"""
SpacePlot = 1
def plot(sim: PASEOS, plot_type: PlotType, filename: str = None):
"""Creates the animation object
Args:
sim (PASEOS): simulation object
plot_type (PlotType): enum deciding what kind of plot object to be made
filename (str, optional): filename to save the animation to. Defaults to None.
Raises:
ValueError: supplied plot type not supported
Returns:
Animation: Animation object
"""
if plot_type is PlotType.SpacePlot:
return SpaceAnimation(sim, filename=filename)
else:
raise ValueError(f"PlotType {plot_type} not known. Available are {[e for e in PlotType]}")