kplot 1.1.45__tar.gz → 1.1.46__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kplot-1.1.45 → kplot-1.1.46}/PKG-INFO +1 -1
- {kplot-1.1.45 → kplot-1.1.46}/pyproject.toml +1 -1
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/movie.py +10 -10
- {kplot-1.1.45 → kplot-1.1.46}/README.md +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/__init__.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/axes.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/cmaps.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/image.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/plot.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/styles/example.mpl +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/styles/publication.mpl +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/threeD/__init__.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/threeD/slider_images.py +0 -0
- {kplot-1.1.45 → kplot-1.1.46}/src/kplot/utils.py +0 -0
|
@@ -18,19 +18,19 @@ from matplotlib.figure import Figure
|
|
|
18
18
|
# >-|===|> Functions <|===|-<
|
|
19
19
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
20
20
|
def ffmpeg(
|
|
21
|
-
file_name: str,
|
|
22
|
-
source: str = "./frames", destination: str = "./",
|
|
21
|
+
file_name: str,
|
|
22
|
+
source: str = "./frames", destination: str = "./",
|
|
23
23
|
fps: int = 30, verbose: bool = False,
|
|
24
24
|
log=8, vcodec='libx264', pix_fmt='yuv420p'
|
|
25
25
|
) -> None:
|
|
26
26
|
file_path: str = destination + '/' + file_name
|
|
27
27
|
if not file_path.endswith('.mp4'): file_path += ".mp4"
|
|
28
28
|
if verbose: print(purple("FFMPeg running..."))
|
|
29
|
-
system(f"
|
|
29
|
+
system(f"ffmpeg -loglevel {log} -framerate {fps} -pattern_type glob -i '{source+'/*.png'}' -c:v {vcodec} -pix_fmt {pix_fmt} -y {file_path}")
|
|
30
30
|
def func_video(
|
|
31
|
-
video_name: str, fig: Figure, updater: Callable, N: int,
|
|
32
|
-
frames: str = f"./.temp", destination: str = "./",
|
|
33
|
-
dpi: int = 100, fps: int = 30, verbose=True,
|
|
31
|
+
video_name: str, fig: Figure, updater: Callable, N: int,
|
|
32
|
+
frames: str = f"./.temp", destination: str = "./",
|
|
33
|
+
dpi: int = 100, fps: int = 30, verbose=True,
|
|
34
34
|
vcodec='libx264', pix_fmt='yuv420p',
|
|
35
35
|
**updater_kwargs
|
|
36
36
|
) -> None:
|
|
@@ -39,7 +39,7 @@ def func_video(
|
|
|
39
39
|
ndigits = len(str(N))
|
|
40
40
|
# if the size isn't divisible by 2 ffmpeg gets mad???
|
|
41
41
|
[wpix, hpix] = (array(fig.get_size_inches()) * dpi // 1).astype(int)
|
|
42
|
-
if wpix%2==1: wpix += 1
|
|
42
|
+
if wpix%2==1: wpix += 1
|
|
43
43
|
if hpix%2==1: hpix += 1
|
|
44
44
|
fig.set_size_inches(wpix/dpi, hpix/dpi)
|
|
45
45
|
# make the frames and save them to the frames directory
|
|
@@ -54,8 +54,8 @@ def func_video(
|
|
|
54
54
|
)
|
|
55
55
|
system(f'rm -r {frames}')
|
|
56
56
|
def line_video(
|
|
57
|
-
xs, ys,
|
|
58
|
-
fname,
|
|
57
|
+
xs, ys,
|
|
58
|
+
fname,
|
|
59
59
|
destination: str = '.',
|
|
60
60
|
ax=None, figsize=(5, 5),
|
|
61
61
|
fps=20, dpi=100,
|
|
@@ -100,7 +100,7 @@ def show_video(
|
|
|
100
100
|
def update(f: int):
|
|
101
101
|
img.set_array(frames[f])
|
|
102
102
|
func_video(fname, fig, update, len(frames), destination=destination, fps=fps, dpi=dpi)
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
105
105
|
# >-|===|> Decorators <|===|-<
|
|
106
106
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|