kplot 1.1.24__tar.gz → 1.1.26__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.24 → kplot-1.1.26}/PKG-INFO +1 -1
- {kplot-1.1.24 → kplot-1.1.26}/pyproject.toml +1 -1
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/cmaps.py +2 -1
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/movie.py +4 -3
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/plot.py +2 -1
- {kplot-1.1.24 → kplot-1.1.26}/README.md +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/__init__.py +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/axes.py +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/image.py +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/styles/example.mpl +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/styles/publication.mpl +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/threeD/__init__.py +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/threeD/slider_images.py +0 -0
- {kplot-1.1.24 → kplot-1.1.26}/src/kplot/utils.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
2
2
|
# >-|===|> Imports <|===|-<
|
|
3
3
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
4
|
-
from kbasic.typing import Number
|
|
4
|
+
from kbasic.typing import Number
|
|
5
5
|
from matplotlib.pyplot import cm
|
|
6
6
|
from matplotlib.colors import Colormap, LinearSegmentedColormap, ListedColormap, \
|
|
7
7
|
hex2color, Normalize, LogNorm, FuncNorm, AsinhNorm, PowerNorm, SymLogNorm, \
|
|
@@ -9,6 +9,7 @@ from matplotlib.colors import Colormap, LinearSegmentedColormap, ListedColormap,
|
|
|
9
9
|
from numpy import uint8, zeros, ndarray, inf, nanmin, nanmax, nanquantile, nanmean, \
|
|
10
10
|
nanstd, absolute, log10, ones, linspace
|
|
11
11
|
from colorist import ColorOKLCH
|
|
12
|
+
from collections.abc import Iterable
|
|
12
13
|
|
|
13
14
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
14
15
|
# >-|===|> Types <|===|-<
|
|
@@ -28,10 +28,10 @@ def ffmpeg(
|
|
|
28
28
|
system(f"ffmpeg -loglevel 8 -framerate {fps} -pattern_type glob -i '{source+'/*.png'}' -c:v libx264 -pix_fmt yuv420p -y {file_path}")
|
|
29
29
|
def func_video(
|
|
30
30
|
video_name: str, fig: Figure, updater: Callable, N: int,
|
|
31
|
-
frames: str = "
|
|
31
|
+
frames: str = f"./.temp", destination: str = "./",
|
|
32
32
|
dpi: int = 100, fps: int = 30, verbose=True
|
|
33
33
|
) -> None:
|
|
34
|
-
ensure_path(
|
|
34
|
+
ensure_path(f"")
|
|
35
35
|
if len(glob(f"{frames}/*.png"))>0: system(f"rm {frames}/*.png")
|
|
36
36
|
ndigits = len(str(N))
|
|
37
37
|
# if the size isn't divisible by 2 ffmpeg gets mad???
|
|
@@ -42,9 +42,10 @@ def func_video(
|
|
|
42
42
|
# make the frames and save them to the frames directory
|
|
43
43
|
for i in verbose_bar(range(N), verbose):
|
|
44
44
|
updater(i)
|
|
45
|
-
fig.savefig(f"{frames}/{str(i).zfill(ndigits)}.png", dpi=dpi)
|
|
45
|
+
fig.savefig(f"{frames}/{video_name}/{str(i).zfill(ndigits)}.png", dpi=dpi)
|
|
46
46
|
# make the video
|
|
47
47
|
ffmpeg(video_name, source=frames, destination=destination, fps=fps)
|
|
48
|
+
system(f'rm -r {frames}')
|
|
48
49
|
def line_video(
|
|
49
50
|
xs, ys,
|
|
50
51
|
fname,
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
4
4
|
from kplot.axes import subplots
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
from kbasic.typing import Number, Optional
|
|
7
8
|
from numpy import asarray, hstack, column_stack, newaxis, concatenate, hypot, diff,\
|
|
8
9
|
nanmin, nanmax, ndarray, log10
|
|
9
10
|
from matplotlib.figure import Figure
|
|
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
|