babelplot 2025.3__tar.gz → 2025.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.
Files changed (44) hide show
  1. {babelplot-2025.3 → babelplot-2025.5}/PKG-INFO +2 -2
  2. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/__init__.py +3 -3
  3. babelplot-2025.5/package/babelplot/api/backend.py +54 -0
  4. babelplot-2025.5/package/babelplot/api/definition.py +54 -0
  5. babelplot-2025.5/package/babelplot/api/help.py +54 -0
  6. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/backend/catalog/bokeh_.py +90 -90
  7. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/backend/catalog/matplotlib_.py +162 -164
  8. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/backend/catalog/plotly_.py +109 -105
  9. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/backend/catalog/vedo_.py +72 -77
  10. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/backend/helper/creation.py +11 -20
  11. babelplot-2025.3/package/babelplot/backend/specification/runtime.py → babelplot-2025.5/package/babelplot/backend/helper/validation.py +37 -20
  12. babelplot-2025.5/package/babelplot/constant/backend.py +65 -0
  13. babelplot-2025.3/package/babelplot/constant/backend.py → babelplot-2025.5/package/babelplot/constant/path.py +2 -1
  14. babelplot-2025.5/package/babelplot/extension/function.py +95 -0
  15. babelplot-2025.5/package/babelplot/runtime/backends.py +55 -0
  16. {babelplot-2025.3/package/babelplot → babelplot-2025.5/package/babelplot/task}/help.py +30 -26
  17. babelplot-2025.3/package/babelplot/main.py → babelplot-2025.5/package/babelplot/task/instantiation.py +21 -47
  18. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/task/show_pyqt6.py +14 -12
  19. babelplot-2025.5/package/babelplot/type/backend.py +190 -0
  20. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/type/base.py +26 -30
  21. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/type/figure.py +62 -68
  22. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/type/frame.py +47 -56
  23. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/type/plot.py +21 -14
  24. babelplot-2025.3/package/babelplot/specification/plot.py → babelplot-2025.5/package/babelplot/type/plot_definition.py +34 -29
  25. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/version.py +1 -1
  26. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot.egg-info/PKG-INFO +2 -2
  27. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot.egg-info/SOURCES.txt +12 -7
  28. babelplot-2025.3/package/babelplot/backend/helper/validation.py +0 -269
  29. babelplot-2025.3/package/babelplot/backend/specification/backend.py +0 -121
  30. {babelplot-2025.3 → babelplot-2025.5}/MANIFEST.in +0 -0
  31. {babelplot-2025.3 → babelplot-2025.5}/README-COPYRIGHT-utf8.txt +0 -0
  32. {babelplot-2025.3 → babelplot-2025.5}/README-LICENCE-utf8.txt +0 -0
  33. {babelplot-2025.3 → babelplot-2025.5}/README.rst +0 -0
  34. {babelplot-2025.3 → babelplot-2025.5}/documentation/wiki/description.asciidoc +0 -0
  35. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/constant/project.py +0 -0
  36. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot/extension/enum_.py +0 -0
  37. {babelplot-2025.3/package/babelplot/specification → babelplot-2025.5/package/babelplot/type}/dimension.py +0 -0
  38. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot.egg-info/dependency_links.txt +0 -0
  39. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot.egg-info/requires.txt +0 -0
  40. {babelplot-2025.3 → babelplot-2025.5}/package/babelplot.egg-info/top_level.txt +0 -0
  41. {babelplot-2025.3 → babelplot-2025.5}/pyproject.toml +0 -0
  42. {babelplot-2025.3 → babelplot-2025.5}/requirements.txt +0 -0
  43. {babelplot-2025.3 → babelplot-2025.5}/setup.cfg +0 -0
  44. {babelplot-2025.3 → babelplot-2025.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: babelplot
3
- Version: 2025.3
3
+ Version: 2025.5
4
4
  Summary: A Meta Plotting Library That Speaks Several Backends
5
5
  Home-page: https://src.koda.cnrs.fr/eric.debreuve/babelplot/
6
6
  Author: Eric Debreuve
@@ -17,10 +17,10 @@ else:
17
17
  if folder not in paths:
18
18
  beartype_this_package()
19
19
 
20
- from babelplot.backend.specification.backend import backend_e
21
- from babelplot.main import NewFigure, NewPlot
22
- from babelplot.specification.plot import plot_e
20
+ from babelplot.task.instantiation import NewFigure, NewPlot
21
+ from babelplot.type.dimension import dim_e
23
22
  from babelplot.type.figure import ShowAllFigures
23
+ from babelplot.type.plot_definition import plot_e
24
24
  from babelplot.version import __version__
25
25
 
26
26
  """
@@ -0,0 +1,54 @@
1
+ """
2
+ Copyright CNRS/Inria/UniCA
3
+ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2022
4
+ SEE COPYRIGHT NOTICE BELOW
5
+ """
6
+
7
+ from babelplot.backend.helper.creation import PrintBackendDraft # noqa
8
+ from babelplot.backend.helper.validation import CheckBackend # noqa
9
+
10
+ """
11
+ COPYRIGHT NOTICE
12
+
13
+ This software is governed by the CeCILL license under French law and
14
+ abiding by the rules of distribution of free software. You can use,
15
+ modify and/ or redistribute the software under the terms of the CeCILL
16
+ license as circulated by CEA, CNRS and INRIA at the following URL
17
+ "http://www.cecill.info".
18
+
19
+ As a counterpart to the access to the source code and rights to copy,
20
+ modify and redistribute granted by the license, users are provided only
21
+ with a limited warranty and the software's author, the holder of the
22
+ economic rights, and the successive licensors have only limited
23
+ liability.
24
+
25
+ In this respect, the user's attention is drawn to the risks associated
26
+ with loading, using, modifying and/or developing or reproducing the
27
+ software by the user in light of its specific status of free software,
28
+ that may mean that it is complicated to manipulate, and that also
29
+ therefore means that it is reserved for developers and experienced
30
+ professionals having in-depth computer knowledge. Users are therefore
31
+ encouraged to load and test the software's suitability as regards their
32
+ requirements in conditions enabling the security of their systems and/or
33
+ data to be ensured and, more generally, to use and operate it in the
34
+ same conditions as regards security.
35
+
36
+ The fact that you are presently reading this means that you have had
37
+ knowledge of the CeCILL license and that you accept its terms.
38
+
39
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
40
+
41
+ This software is being developed by Eric Debreuve, a CNRS employee and
42
+ member of team Morpheme.
43
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
44
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
45
+ I3S, and Laboratory iBV.
46
+
47
+ CNRS: https://www.cnrs.fr/index.php/en
48
+ Inria: https://www.inria.fr/en/
49
+ UniCA: https://univ-cotedazur.eu/
50
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
51
+ I3S: https://www.i3s.unice.fr/en/
52
+ iBV: http://ibv.unice.fr/
53
+ Team Morpheme: https://team.inria.fr/morpheme/
54
+ """
@@ -0,0 +1,54 @@
1
+ """
2
+ Copyright CNRS/Inria/UniCA
3
+ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2022
4
+ SEE COPYRIGHT NOTICE BELOW
5
+ """
6
+
7
+ from babelplot.type.dimension import dim_e # noqa
8
+ from babelplot.type.plot_definition import plot_e # noqa
9
+
10
+ """
11
+ COPYRIGHT NOTICE
12
+
13
+ This software is governed by the CeCILL license under French law and
14
+ abiding by the rules of distribution of free software. You can use,
15
+ modify and/ or redistribute the software under the terms of the CeCILL
16
+ license as circulated by CEA, CNRS and INRIA at the following URL
17
+ "http://www.cecill.info".
18
+
19
+ As a counterpart to the access to the source code and rights to copy,
20
+ modify and redistribute granted by the license, users are provided only
21
+ with a limited warranty and the software's author, the holder of the
22
+ economic rights, and the successive licensors have only limited
23
+ liability.
24
+
25
+ In this respect, the user's attention is drawn to the risks associated
26
+ with loading, using, modifying and/or developing or reproducing the
27
+ software by the user in light of its specific status of free software,
28
+ that may mean that it is complicated to manipulate, and that also
29
+ therefore means that it is reserved for developers and experienced
30
+ professionals having in-depth computer knowledge. Users are therefore
31
+ encouraged to load and test the software's suitability as regards their
32
+ requirements in conditions enabling the security of their systems and/or
33
+ data to be ensured and, more generally, to use and operate it in the
34
+ same conditions as regards security.
35
+
36
+ The fact that you are presently reading this means that you have had
37
+ knowledge of the CeCILL license and that you accept its terms.
38
+
39
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
40
+
41
+ This software is being developed by Eric Debreuve, a CNRS employee and
42
+ member of team Morpheme.
43
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
44
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
45
+ I3S, and Laboratory iBV.
46
+
47
+ CNRS: https://www.cnrs.fr/index.php/en
48
+ Inria: https://www.inria.fr/en/
49
+ UniCA: https://univ-cotedazur.eu/
50
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
51
+ I3S: https://www.i3s.unice.fr/en/
52
+ iBV: http://ibv.unice.fr/
53
+ Team Morpheme: https://team.inria.fr/morpheme/
54
+ """
@@ -0,0 +1,54 @@
1
+ """
2
+ Copyright CNRS/Inria/UniCA
3
+ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2022
4
+ SEE COPYRIGHT NOTICE BELOW
5
+ """
6
+
7
+ from babelplot.task.help import Main as PrintHelp # noqa
8
+ from babelplot.task.help import PrintUsage # noqa
9
+
10
+ """
11
+ COPYRIGHT NOTICE
12
+
13
+ This software is governed by the CeCILL license under French law and
14
+ abiding by the rules of distribution of free software. You can use,
15
+ modify and/ or redistribute the software under the terms of the CeCILL
16
+ license as circulated by CEA, CNRS and INRIA at the following URL
17
+ "http://www.cecill.info".
18
+
19
+ As a counterpart to the access to the source code and rights to copy,
20
+ modify and redistribute granted by the license, users are provided only
21
+ with a limited warranty and the software's author, the holder of the
22
+ economic rights, and the successive licensors have only limited
23
+ liability.
24
+
25
+ In this respect, the user's attention is drawn to the risks associated
26
+ with loading, using, modifying and/or developing or reproducing the
27
+ software by the user in light of its specific status of free software,
28
+ that may mean that it is complicated to manipulate, and that also
29
+ therefore means that it is reserved for developers and experienced
30
+ professionals having in-depth computer knowledge. Users are therefore
31
+ encouraged to load and test the software's suitability as regards their
32
+ requirements in conditions enabling the security of their systems and/or
33
+ data to be ensured and, more generally, to use and operate it in the
34
+ same conditions as regards security.
35
+
36
+ The fact that you are presently reading this means that you have had
37
+ knowledge of the CeCILL license and that you accept its terms.
38
+
39
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
40
+
41
+ This software is being developed by Eric Debreuve, a CNRS employee and
42
+ member of team Morpheme.
43
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
44
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
45
+ I3S, and Laboratory iBV.
46
+
47
+ CNRS: https://www.cnrs.fr/index.php/en
48
+ Inria: https://www.inria.fr/en/
49
+ UniCA: https://univ-cotedazur.eu/
50
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
51
+ I3S: https://www.i3s.unice.fr/en/
52
+ iBV: http://ibv.unice.fr/
53
+ Team Morpheme: https://team.inria.fr/morpheme/
54
+ """
@@ -4,19 +4,16 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2022
4
4
  SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
- from __future__ import annotations
8
-
7
+ import dataclasses as d
9
8
  import typing as h
10
9
 
11
- from babelplot.backend.specification.backend import backend_e
12
- from babelplot.specification.dimension import dim_e
13
- from babelplot.specification.plot import PlotsFromTemplate, plot_e, plot_type_h
14
10
  from babelplot.task.show_pyqt6 import Show
11
+ from babelplot.type.dimension import dim_e
15
12
  from babelplot.type.figure import figure_t as base_figure_t
16
13
  from babelplot.type.frame import frame_t as base_frame_t
17
14
  from babelplot.type.plot import plot_t as base_plot_t
15
+ from babelplot.type.plot_definition import PlotsFromTemplate, plot_e, plot_type_h
18
16
  from bokeh.embed import file_html as HTMLofBackendContent # noqa
19
- from bokeh.layouts import LayoutDOM as backend_content_t # noqa
20
17
  from bokeh.layouts import column as NewBackendColLayout # noqa
21
18
  from bokeh.layouts import grid as NewBackendGridLayout # noqa
22
19
  from bokeh.layouts import row as NewBackendRowLayout # noqa
@@ -24,96 +21,99 @@ from bokeh.models.renderers import GlyphRenderer as backend_plot_t # noqa
24
21
  from bokeh.plotting import figure as backend_figure_t # noqa
25
22
  from bokeh.resources import INLINE # noqa
26
23
 
27
- NAME = backend_e.BOKEH.value
24
+ # from bokeh.layouts import LayoutDOM as backend_content_t # noqa
25
+
26
+ NAME = "bokeh"
28
27
 
29
28
 
30
29
  backend_frame_t = backend_figure_t
31
30
 
32
31
 
33
- def _NewPlot(
34
- frame: backend_frame_t,
35
- type_: plot_type_h | type[backend_plot_t],
36
- plot_function: (
37
- type[backend_plot_t] | h.Callable[..., backend_plot_t | h.Any] | None
38
- ),
39
- *args,
40
- title: str | None = None, # If _, then it is swallowed by kwargs!
41
- **kwargs,
42
- ) -> tuple[
43
- backend_plot_t | h.Any,
44
- type[backend_plot_t] | h.Callable[..., backend_plot_t | h.Any],
45
- ]:
46
- """"""
47
- if plot_function is None:
48
- if hasattr(backend_frame_t, type_):
49
- plot_function = getattr(backend_frame_t, type_)
50
- else:
51
- raise ValueError(f"{type_}: Unknown {NAME} graph object.")
52
-
53
- return plot_function(frame, *args, **kwargs), plot_function
54
-
55
-
56
- def _NewFrame(
57
- _: backend_figure_t,
58
- __: int,
59
- ___: int,
60
- *args,
61
- title: str | None = None,
62
- dim: dim_e = dim_e.XY, # If _, then it is swallowed by kwargs!
63
- **kwargs,
64
- ) -> backend_frame_t:
65
- """"""
66
- return backend_frame_t(*args, title=title, **kwargs)
67
-
68
-
69
- def _AdjustLayout(figure: figure_t, /) -> None:
70
- """"""
71
- n_rows, n_cols = figure.shape
72
- arranged_frames = [n_cols * [None] for _ in range(n_rows)]
73
- for frame, (row, col) in zip(figure.frames, figure.locations):
74
- arranged_frames[row][col] = frame.backend
75
- arranged_frames: list[list[backend_frame_t]]
76
-
77
- if n_rows > 1:
78
- if n_cols > 1:
79
- layout = NewBackendGridLayout(arranged_frames)
32
+ @d.dataclass(slots=True, repr=False, eq=False)
33
+ class plot_t(base_plot_t): ...
34
+
35
+
36
+ @d.dataclass(slots=True, repr=False, eq=False)
37
+ class frame_t(base_frame_t):
38
+
39
+ def _NewPlot(
40
+ self,
41
+ type_: plot_type_h | type[backend_plot_t],
42
+ plot_function: (
43
+ type[backend_plot_t] | h.Callable[..., backend_plot_t | h.Any] | None
44
+ ),
45
+ *args,
46
+ title: str | None = None, # If _, then it is swallowed by kwargs!
47
+ **kwargs,
48
+ ) -> plot_t:
49
+ """"""
50
+ output = plot_t(
51
+ title=title,
52
+ property=kwargs.copy(),
53
+ backend_name=self.backend_name,
54
+ )
55
+
56
+ if plot_function is None:
57
+ if hasattr(backend_frame_t, type_):
58
+ plot_function = getattr(backend_frame_t, type_)
59
+ else:
60
+ raise ValueError(f"{type_}: Unknown {NAME} graph object.")
61
+
62
+ output.backend_type = plot_function
63
+ output.raw = plot_function(self.raw, *args, **kwargs)
64
+
65
+ return output
66
+
67
+
68
+ @d.dataclass(slots=True, repr=False, eq=False)
69
+ class figure_t(base_figure_t):
70
+ layout: h.Any = None
71
+
72
+ _NewBackendFigure = backend_figure_t
73
+ _BackendShow = Show
74
+
75
+ def _NewFrame(
76
+ self,
77
+ row: int,
78
+ col: int,
79
+ *args,
80
+ title: str | None = None,
81
+ dim: dim_e = dim_e.XY, # If _, then it is swallowed by kwargs!
82
+ **kwargs,
83
+ ) -> frame_t:
84
+ """"""
85
+ output = frame_t(
86
+ title=title,
87
+ dim=dim,
88
+ backend_name=self.backend_name,
89
+ )
90
+
91
+ output.raw = backend_frame_t(*args, title=title, **kwargs)
92
+
93
+ return output
94
+
95
+ def AdjustLayout(self) -> None:
96
+ """"""
97
+ n_rows, n_cols = self.shape
98
+ arranged_frames = [n_cols * [None] for _ in range(n_rows)]
99
+ for frame, (row, col) in zip(self.frames, self.locations):
100
+ arranged_frames[row][col] = frame.raw
101
+ arranged_frames: list[list[backend_frame_t]]
102
+
103
+ if n_rows > 1:
104
+ if n_cols > 1:
105
+ layout = NewBackendGridLayout(arranged_frames)
106
+ else:
107
+ column = [_row[0] for _row in arranged_frames]
108
+ layout = NewBackendColLayout(column)
80
109
  else:
81
- column = [_row[0] for _row in arranged_frames]
82
- layout = NewBackendColLayout(column)
83
- else:
84
- layout = NewBackendRowLayout(arranged_frames[0])
85
-
86
- figure.layout = layout
87
-
88
-
89
- def _AsHTML(figure: figure_t, /) -> str:
90
- """"""
91
-
92
- return HTMLofBackendContent(figure.layout, INLINE)
93
-
94
-
95
- # noinspection PyTypeChecker
96
- plot_t: type[base_plot_t] = type("plot_t", (base_plot_t,), {})
97
- # noinspection PyTypeChecker
98
- frame_t: type[base_frame_t] = type(
99
- "frame_t",
100
- (base_frame_t,),
101
- {"plot_class": plot_t, "NewBackendPlot": staticmethod(_NewPlot)},
102
- )
103
- # noinspection PyTypeChecker
104
- figure_t: type[base_figure_t] = type(
105
- "figure_t",
106
- (base_figure_t,),
107
- {
108
- "frame_class": frame_t,
109
- "NewBackendFigure": backend_figure_t,
110
- "NewBackendFrame": staticmethod(_NewFrame),
111
- "AdjustLayout": _AdjustLayout,
112
- "BackendShow": Show,
113
- "layout": None,
114
- "AsHTML": _AsHTML,
115
- },
116
- )
110
+ layout = NewBackendRowLayout(arranged_frames[0])
111
+
112
+ self.layout = layout
113
+
114
+ def AsHTML(self) -> str:
115
+ """"""
116
+ return HTMLofBackendContent(self.layout, INLINE)
117
117
 
118
118
 
119
119
  PLOTS = PlotsFromTemplate()