babelplot 2024.3__tar.gz → 2024.5__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.
- {babelplot-2024.3 → babelplot-2024.5}/PKG-INFO +1 -1
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/catalog/bokeh_.py +2 -2
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/catalog/matplotlib_.py +2 -2
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/catalog/plotly_.py +1 -1
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/catalog/vedo_.py +2 -2
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/main.py +11 -11
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/type/figure.py +4 -4
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/type/frame.py +18 -7
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/type/plot.py +2 -2
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/version.py +1 -1
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot.egg-info/PKG-INFO +1 -1
- {babelplot-2024.3 → babelplot-2024.5}/MANIFEST.in +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/README-COPYRIGHT-utf8.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/README-LICENCE-utf8.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/README.rst +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/documentation/wiki/description.asciidoc +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/__init__.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/helper/creation.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/helper/validation.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/specification/backend.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/backend/specification/runtime.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/constant/backend.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/constant/project.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/extension/enum_.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/help.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/specification/dimension.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/specification/plot.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/task/show_pyqt6.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot/type/base.py +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot.egg-info/SOURCES.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot.egg-info/dependency_links.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot.egg-info/requires.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/package/babelplot.egg-info/top_level.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/pyproject.toml +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/requirements.txt +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/setup.cfg +0 -0
- {babelplot-2024.3 → babelplot-2024.5}/setup.py +0 -0
|
@@ -35,7 +35,7 @@ def _NewPlot(
|
|
|
35
35
|
type_: plot_type_h | type(backend_plot_t),
|
|
36
36
|
plot_function: h.Callable | None,
|
|
37
37
|
*args,
|
|
38
|
-
title: str = None, # If _, then it is swallowed by kwargs!
|
|
38
|
+
title: str | None = None, # If _, then it is swallowed by kwargs!
|
|
39
39
|
**kwargs,
|
|
40
40
|
) -> tuple[backend_plot_t, type(backend_plot_t)]:
|
|
41
41
|
""""""
|
|
@@ -53,7 +53,7 @@ def _NewFrame(
|
|
|
53
53
|
__: int,
|
|
54
54
|
___: int,
|
|
55
55
|
*args,
|
|
56
|
-
title: str = None,
|
|
56
|
+
title: str | None = None,
|
|
57
57
|
dim: dim_e = dim_e.XY, # If _, then it is swallowed by kwargs!
|
|
58
58
|
**kwargs,
|
|
59
59
|
) -> backend_frame_t:
|
|
@@ -42,7 +42,7 @@ def _NewPlot(
|
|
|
42
42
|
type_: plot_type_h | type(backend_plot_h),
|
|
43
43
|
plot_function: h.Callable | None,
|
|
44
44
|
*args,
|
|
45
|
-
title: str = None, # /!\ If _, then it is swallowed by kwargs!
|
|
45
|
+
title: str | None = None, # /!\ If _, then it is swallowed by kwargs!
|
|
46
46
|
**kwargs,
|
|
47
47
|
) -> tuple[h.Any, h.Callable]:
|
|
48
48
|
""""""
|
|
@@ -65,7 +65,7 @@ def _NewFrame(
|
|
|
65
65
|
_: int,
|
|
66
66
|
__: int,
|
|
67
67
|
*args,
|
|
68
|
-
title: str = None,
|
|
68
|
+
title: str | None = None,
|
|
69
69
|
dim: dim_e = dim_e.XY,
|
|
70
70
|
**kwargs,
|
|
71
71
|
) -> backend_frame_h:
|
|
@@ -49,7 +49,7 @@ def _NewPlot(
|
|
|
49
49
|
type_: plot_type_h | type(backend_plot_t),
|
|
50
50
|
plot_function: h.Callable | None,
|
|
51
51
|
*args,
|
|
52
|
-
title: str = None, # If _, then it is swallowed by kwargs!
|
|
52
|
+
title: str | None = None, # If _, then it is swallowed by kwargs!
|
|
53
53
|
**kwargs,
|
|
54
54
|
) -> tuple[backend_plot_t, type(backend_plot_t)]:
|
|
55
55
|
""""""
|
|
@@ -31,7 +31,7 @@ def _NewPlot(
|
|
|
31
31
|
type_: plot_type_h | type(backend_plot_h),
|
|
32
32
|
plot_function: h.Callable | None,
|
|
33
33
|
*args,
|
|
34
|
-
title: str = None, # If _, then it is swallowed by kwargs!
|
|
34
|
+
title: str | None = None, # If _, then it is swallowed by kwargs!
|
|
35
35
|
**kwargs,
|
|
36
36
|
) -> tuple[backend_plot_h, type(backend_plot_h)]:
|
|
37
37
|
""""""
|
|
@@ -52,7 +52,7 @@ def _NewFrame(
|
|
|
52
52
|
_: int,
|
|
53
53
|
__: int,
|
|
54
54
|
*___,
|
|
55
|
-
title: str = None,
|
|
55
|
+
title: str | None = None,
|
|
56
56
|
dim: dim_e = dim_e.XY, # If _, then it is swallowed by kwargs!
|
|
57
57
|
**____,
|
|
58
58
|
) -> backend_frame_t:
|
|
@@ -23,9 +23,9 @@ from logger_36 import LOGGER
|
|
|
23
23
|
|
|
24
24
|
def NewFigure(
|
|
25
25
|
*args,
|
|
26
|
-
title: str = None,
|
|
26
|
+
title: str | None = None,
|
|
27
27
|
offline_version: bool = False,
|
|
28
|
-
pbe: str | path_t | backend_e = None,
|
|
28
|
+
pbe: str | path_t | backend_e | None = None,
|
|
29
29
|
**kwargs,
|
|
30
30
|
) -> figure_t | None:
|
|
31
31
|
"""
|
|
@@ -75,24 +75,24 @@ def NewPlot(
|
|
|
75
75
|
*plt_args,
|
|
76
76
|
fig_args=(),
|
|
77
77
|
frm_args=(),
|
|
78
|
-
fig_kwargs: dict[str, h.Any] = None,
|
|
79
|
-
frm_kwargs: dict[str, h.Any] = None,
|
|
80
|
-
fig_title: str = None,
|
|
81
|
-
frm_title: str = None,
|
|
82
|
-
plt_title: str = None,
|
|
78
|
+
fig_kwargs: dict[str, h.Any] | None = None,
|
|
79
|
+
frm_kwargs: dict[str, h.Any] | None = None,
|
|
80
|
+
fig_title: str | None = None,
|
|
81
|
+
frm_title: str | None = None,
|
|
82
|
+
plt_title: str | None = None,
|
|
83
83
|
dim: str | dim_e = dim_e.XY,
|
|
84
|
-
pbe: str | path_t | backend_e = None,
|
|
84
|
+
pbe: str | path_t | backend_e | None = None,
|
|
85
85
|
should_show: bool = True,
|
|
86
86
|
modal: bool = True,
|
|
87
87
|
**plt_kwargs,
|
|
88
88
|
) -> tuple[figure_t, frame_t, plot_t] | None:
|
|
89
89
|
""""""
|
|
90
90
|
if fig_kwargs is None:
|
|
91
|
-
fig_kwargs =
|
|
91
|
+
fig_kwargs = {}
|
|
92
92
|
if frm_kwargs is None:
|
|
93
|
-
frm_kwargs =
|
|
93
|
+
frm_kwargs = {}
|
|
94
94
|
if plt_kwargs is None:
|
|
95
|
-
plt_kwargs =
|
|
95
|
+
plt_kwargs = {}
|
|
96
96
|
|
|
97
97
|
figure = NewFigure(
|
|
98
98
|
*fig_args,
|
|
@@ -31,9 +31,9 @@ def _DefaultShape() -> list[int]:
|
|
|
31
31
|
@dtcl.dataclass(repr=False, eq=False)
|
|
32
32
|
class figure_t(base_figure_t):
|
|
33
33
|
|
|
34
|
-
title: str = None
|
|
34
|
+
title: str | None = None
|
|
35
35
|
offline_version: bool = False
|
|
36
|
-
frame_class: type(frame_t) = dtcl.field(init=False, default=None)
|
|
36
|
+
frame_class: type(frame_t) | None = dtcl.field(init=False, default=None)
|
|
37
37
|
frames: list[frame_t] = dtcl.field(init=False, default_factory=list)
|
|
38
38
|
locations: list[tuple[int, int]] = dtcl.field(init=False, default_factory=list)
|
|
39
39
|
shape: list[int] = dtcl.field(init=False, default_factory=_DefaultShape)
|
|
@@ -46,7 +46,7 @@ class figure_t(base_figure_t):
|
|
|
46
46
|
def AddFrame(
|
|
47
47
|
self,
|
|
48
48
|
*args,
|
|
49
|
-
title: str = None,
|
|
49
|
+
title: str | None = None,
|
|
50
50
|
dim: str | dim_e = dim_e.XY,
|
|
51
51
|
row: int = 0,
|
|
52
52
|
col: int = 0,
|
|
@@ -185,7 +185,7 @@ class figure_t(base_figure_t):
|
|
|
185
185
|
row: int,
|
|
186
186
|
col: int,
|
|
187
187
|
*args,
|
|
188
|
-
title: str = None,
|
|
188
|
+
title: str | None = None,
|
|
189
189
|
dim: dim_e = dim_e.XY,
|
|
190
190
|
**kwargs,
|
|
191
191
|
) -> backend_frame_h:
|
|
@@ -5,11 +5,12 @@ SEE COPYRIGHT NOTICE BELOW
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import dataclasses as dtcl
|
|
8
|
+
import difflib as diff
|
|
8
9
|
import typing as h
|
|
9
10
|
|
|
10
11
|
from babelplot.backend.specification.runtime import BackendPlots, BackendTranslations
|
|
11
12
|
from babelplot.specification.dimension import FRAME_DIM_FOR_DATA_DIM, dim_e
|
|
12
|
-
from babelplot.specification.plot import TranslatedArguments, plot_type_h
|
|
13
|
+
from babelplot.specification.plot import KNOWN_PLOT_TYPES, TranslatedArguments, plot_type_h
|
|
13
14
|
from babelplot.type.base import babelplot_element_t as base_frame_t
|
|
14
15
|
from babelplot.type.base import backend_frame_h, backend_plot_h
|
|
15
16
|
from babelplot.type.plot import BackendPlotFromAny, plot_t
|
|
@@ -19,10 +20,10 @@ plot_type_w_pbe_h = plot_type_h | type(backend_plot_h)
|
|
|
19
20
|
|
|
20
21
|
@dtcl.dataclass(repr=False, eq=False)
|
|
21
22
|
class frame_t(base_frame_t):
|
|
22
|
-
title: str = None
|
|
23
|
-
dim: dim_e = None
|
|
24
|
-
frame_dim: int = dtcl.field(init=False, default=None)
|
|
25
|
-
plot_class: type(plot_t) = dtcl.field(init=False, default=None)
|
|
23
|
+
title: str | None = None
|
|
24
|
+
dim: dim_e | None = None
|
|
25
|
+
frame_dim: int | None = dtcl.field(init=False, default=None)
|
|
26
|
+
plot_class: type(plot_t) | None = dtcl.field(init=False, default=None)
|
|
26
27
|
plots: list[plot_t] = dtcl.field(init=False, default_factory=list)
|
|
27
28
|
|
|
28
29
|
def __post_init__(self) -> None:
|
|
@@ -33,10 +34,20 @@ class frame_t(base_frame_t):
|
|
|
33
34
|
self,
|
|
34
35
|
type_: plot_type_w_pbe_h,
|
|
35
36
|
*args,
|
|
36
|
-
title: str = None,
|
|
37
|
+
title: str | None = None,
|
|
37
38
|
**kwargs,
|
|
38
39
|
) -> plot_t:
|
|
39
40
|
""""""
|
|
41
|
+
if isinstance(type_, str):
|
|
42
|
+
closest = diff.get_close_matches(type_.lower(), KNOWN_PLOT_TYPES, n=1)
|
|
43
|
+
if closest.__len__() == 0:
|
|
44
|
+
raise ValueError(
|
|
45
|
+
f"{type_}: Unknown plot type. Valid options: "
|
|
46
|
+
f"{str(KNOWN_PLOT_TYPES)[1:-1]}."
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
type_ = closest[0]
|
|
50
|
+
|
|
40
51
|
plot_function = BackendPlotFromAny(
|
|
41
52
|
type_, self.frame_dim, self.pbe, BackendPlots(self.pbe)
|
|
42
53
|
)
|
|
@@ -77,7 +88,7 @@ class frame_t(base_frame_t):
|
|
|
77
88
|
type_: plot_type_w_pbe_h,
|
|
78
89
|
plot_function: h.Callable | None,
|
|
79
90
|
*args,
|
|
80
|
-
title: str = None,
|
|
91
|
+
title: str | None = None,
|
|
81
92
|
**kwargs,
|
|
82
93
|
) -> tuple[h.Any, type(backend_plot_h)]:
|
|
83
94
|
"""
|
|
@@ -19,9 +19,9 @@ from babelplot.type.base import backend_plot_h
|
|
|
19
19
|
|
|
20
20
|
@dtcl.dataclass(repr=False, eq=False)
|
|
21
21
|
class plot_t(base_plot_t):
|
|
22
|
-
title: str = None
|
|
22
|
+
title: str | None = None
|
|
23
23
|
# See babelplot.type.frame.NewBackendPlot for an explanation
|
|
24
|
-
backend_type: type(backend_plot_h) = dtcl.field(init=False, default=None)
|
|
24
|
+
backend_type: type(backend_plot_h) | None = dtcl.field(init=False, default=None)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def BackendPlotFromPlotE(
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|