icplot 0.5.0__tar.gz → 0.6.0__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.
- {icplot-0.5.0/src/icplot.egg-info → icplot-0.6.0}/PKG-INFO +9 -21
- {icplot-0.5.0 → icplot-0.6.0}/README.md +8 -11
- {icplot-0.5.0 → icplot-0.6.0}/pyproject.toml +9 -23
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/graph/renderer.py +7 -3
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/scene/cairo.py +9 -4
- {icplot-0.5.0 → icplot-0.6.0/src/icplot.egg-info}/PKG-INFO +9 -21
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot.egg-info/SOURCES.txt +1 -22
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot.egg-info/requires.txt +0 -12
- {icplot-0.5.0 → icplot-0.6.0}/test/test_cairo.py +1 -2
- {icplot-0.5.0 → icplot-0.6.0}/test/test_frontmatter.py +1 -2
- {icplot-0.5.0 → icplot-0.6.0}/test/test_image.py +1 -2
- {icplot-0.5.0 → icplot-0.6.0}/test/test_mermaid.py +1 -2
- {icplot-0.5.0 → icplot-0.6.0}/test/test_puml.py +1 -2
- {icplot-0.5.0 → icplot-0.6.0}/test/test_tex.py +1 -2
- icplot-0.6.0/test/test_theme_generator.py +33 -0
- {icplot-0.5.0 → icplot-0.6.0}/test/test_tree.py +1 -2
- icplot-0.5.0/src/icplot/geometry/__init__.py +0 -4
- icplot-0.5.0/src/icplot/geometry/base.py +0 -68
- icplot-0.5.0/src/icplot/geometry/mesh/__init__.py +0 -6
- icplot-0.5.0/src/icplot/geometry/mesh/cell.py +0 -74
- icplot-0.5.0/src/icplot/geometry/mesh/edge.py +0 -31
- icplot-0.5.0/src/icplot/geometry/mesh/mesh.py +0 -132
- icplot-0.5.0/src/icplot/geometry/mesh/openfoam/__init__.py +0 -3
- icplot-0.5.0/src/icplot/geometry/mesh/openfoam/blockmesh.py +0 -131
- icplot-0.5.0/src/icplot/geometry/mesh/openfoam/foamfile.py +0 -118
- icplot-0.5.0/src/icplot/geometry/mesh/openfoam/polymesh.py +0 -316
- icplot-0.5.0/src/icplot/geometry/mesh/operations.py +0 -120
- icplot-0.5.0/src/icplot/geometry/mesh/shapes.py +0 -401
- icplot-0.5.0/src/icplot/geometry/mesh/vertex.py +0 -93
- icplot-0.5.0/src/icplot/geometry/mesh/vtk.py +0 -47
- icplot-0.5.0/src/icplot/geometry/operations.py +0 -57
- icplot-0.5.0/src/icplot/geometry/shapes.py +0 -182
- icplot-0.5.0/src/icplot/geometry/transform.py +0 -66
- icplot-0.5.0/src/icplot/renderer/graph/vtk.py +0 -80
- icplot-0.5.0/test/test_geometry.py +0 -65
- icplot-0.5.0/test/test_meshing.py +0 -132
- icplot-0.5.0/test/test_openfoam.py +0 -36
- icplot-0.5.0/test/test_polymesh.py +0 -132
- {icplot-0.5.0 → icplot-0.6.0}/LICENSE +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/setup.cfg +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/charts/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/charts/gantt.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/charts/tree.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/converter/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/converter/cli.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/converter/convert.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/converter/image.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/graph/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/graph/axis.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/graph/plot.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/graph/plot_group.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/graph/series.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/main_cli.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/py.typed +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/charts/pgfgantt.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/charts/svggantt.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/cli.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/config.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/formats/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/formats/mermaid.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/formats/plantuml.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/formats/tex.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/frontmatter.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/graph/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/graph/color.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/graph/matplotlib.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/graph/mpl.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/render.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/renderer/video.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/scene.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/__init__.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/cli.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/color.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/templates/puml.j2 +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/templates/tikz.j2 +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/theme.json +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/theme.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot/theme/theme_generator.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot.egg-info/dependency_links.txt +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot.egg-info/entry_points.txt +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/src/icplot.egg-info/top_level.txt +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/test/test_gantt_chart.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/test/test_line_plots.py +0 -0
- {icplot-0.5.0 → icplot-0.6.0}/test/test_plot_group.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: icplot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Utilities for generating plots and graphics for technical reports.
|
|
5
5
|
Author: Irish Centre for High End Computing
|
|
6
6
|
License: MIT
|
|
@@ -20,25 +20,16 @@ Requires-Dist: graphviz
|
|
|
20
20
|
Requires-Dist: Jinja2
|
|
21
21
|
Provides-Extra: cairo
|
|
22
22
|
Requires-Dist: CairoSVG; extra == "cairo"
|
|
23
|
-
Provides-Extra: scene
|
|
24
|
-
Requires-Dist: pycairo; extra == "scene"
|
|
25
23
|
Provides-Extra: imagemagick
|
|
26
24
|
Requires-Dist: wand; extra == "imagemagick"
|
|
27
25
|
Provides-Extra: plot
|
|
28
26
|
Requires-Dist: matplotlib; extra == "plot"
|
|
29
|
-
Provides-Extra: vtk
|
|
30
|
-
Requires-Dist: vtk; extra == "vtk"
|
|
31
|
-
Provides-Extra: geometry
|
|
32
|
-
Requires-Dist: scipy; extra == "geometry"
|
|
33
27
|
Provides-Extra: video
|
|
34
28
|
Requires-Dist: moviepy; extra == "video"
|
|
35
29
|
Provides-Extra: all
|
|
36
30
|
Requires-Dist: CairoSVG; extra == "all"
|
|
37
|
-
Requires-Dist: pycairo; extra == "all"
|
|
38
31
|
Requires-Dist: wand; extra == "all"
|
|
39
32
|
Requires-Dist: matplotlib; extra == "all"
|
|
40
|
-
Requires-Dist: vtk; extra == "all"
|
|
41
|
-
Requires-Dist: scipy; extra == "all"
|
|
42
33
|
Requires-Dist: moviepy; extra == "all"
|
|
43
34
|
Dynamic: license-file
|
|
44
35
|
|
|
@@ -50,9 +41,12 @@ This is a library used at [The Irish Centre for High End Computing (ICHEC)](http
|
|
|
50
41
|
|
|
51
42
|
The library is **frozen to what its consumers use** — the `ichec-handbook`
|
|
52
43
|
build tool and `ichec-flow`. That means `converter`, `renderer`, `theme` and
|
|
53
|
-
`graph`: fixes and maintenance yes, new capability no
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
`graph`: fixes and maintenance yes, new capability no.
|
|
45
|
+
|
|
46
|
+
The `geometry`/`mesh` 3D and OpenFOAM code has moved to
|
|
47
|
+
[icmesh](https://git.ichec.ie/platform-engineering/modules/ichec-mesh), taking
|
|
48
|
+
VTK and scipy with it — including VTK plot output, which is now
|
|
49
|
+
`icmesh.plot`. Install `icmesh` if you want it.
|
|
56
50
|
|
|
57
51
|
# Features #
|
|
58
52
|
|
|
@@ -103,7 +97,6 @@ Supported render inputs and targets are:
|
|
|
103
97
|
* Graph
|
|
104
98
|
* Backends:
|
|
105
99
|
* Matplotlib
|
|
106
|
-
* VTK
|
|
107
100
|
* Output formats:
|
|
108
101
|
* SVG
|
|
109
102
|
* PNG
|
|
@@ -124,10 +117,8 @@ Supported render inputs and targets are:
|
|
|
124
117
|
* Scene
|
|
125
118
|
* Backends:
|
|
126
119
|
* Cairo
|
|
127
|
-
* VTK
|
|
128
120
|
* Output formats:
|
|
129
121
|
* SVG
|
|
130
|
-
* VTK
|
|
131
122
|
|
|
132
123
|
## Themes ##
|
|
133
124
|
|
|
@@ -147,14 +138,11 @@ Backends are opt-in via extras:
|
|
|
147
138
|
|
|
148
139
|
| Extra | Pulls | Enables |
|
|
149
140
|
|---|---|---|
|
|
150
|
-
| `cairo` | CairoSVG | svg → png / pdf conversion |
|
|
151
|
-
| `scene` | pycairo | vector scene drawing (`renderer.scene.cairo`) |
|
|
141
|
+
| `cairo` | CairoSVG | svg → png / pdf conversion, and vector scene drawing |
|
|
152
142
|
| `imagemagick` | wand | pdf → png conversion (falls back to the `magick` CLI) |
|
|
153
143
|
| `plot` | matplotlib | 2D plotting (`renderer.graph`, `charts`) |
|
|
154
|
-
| `vtk` | vtk | 3D / mesh rendering (`geometry.mesh`) |
|
|
155
|
-
| `geometry` | scipy | geometry transforms (`geometry.operations`) |
|
|
156
144
|
| `video` | moviepy | video assembly (`renderer.video`) |
|
|
157
|
-
| `all` | all of the above | everything
|
|
145
|
+
| `all` | all of the above | everything |
|
|
158
146
|
|
|
159
147
|
For example, `pip install icplot[cairo]` for svg conversion, or
|
|
160
148
|
`pip install icplot[all]` for the full toolkit. The native `cairo` and
|
|
@@ -6,9 +6,12 @@ This is a library used at [The Irish Centre for High End Computing (ICHEC)](http
|
|
|
6
6
|
|
|
7
7
|
The library is **frozen to what its consumers use** — the `ichec-handbook`
|
|
8
8
|
build tool and `ichec-flow`. That means `converter`, `renderer`, `theme` and
|
|
9
|
-
`graph`: fixes and maintenance yes, new capability no
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
`graph`: fixes and maintenance yes, new capability no.
|
|
10
|
+
|
|
11
|
+
The `geometry`/`mesh` 3D and OpenFOAM code has moved to
|
|
12
|
+
[icmesh](https://git.ichec.ie/platform-engineering/modules/ichec-mesh), taking
|
|
13
|
+
VTK and scipy with it — including VTK plot output, which is now
|
|
14
|
+
`icmesh.plot`. Install `icmesh` if you want it.
|
|
12
15
|
|
|
13
16
|
# Features #
|
|
14
17
|
|
|
@@ -59,7 +62,6 @@ Supported render inputs and targets are:
|
|
|
59
62
|
* Graph
|
|
60
63
|
* Backends:
|
|
61
64
|
* Matplotlib
|
|
62
|
-
* VTK
|
|
63
65
|
* Output formats:
|
|
64
66
|
* SVG
|
|
65
67
|
* PNG
|
|
@@ -80,10 +82,8 @@ Supported render inputs and targets are:
|
|
|
80
82
|
* Scene
|
|
81
83
|
* Backends:
|
|
82
84
|
* Cairo
|
|
83
|
-
* VTK
|
|
84
85
|
* Output formats:
|
|
85
86
|
* SVG
|
|
86
|
-
* VTK
|
|
87
87
|
|
|
88
88
|
## Themes ##
|
|
89
89
|
|
|
@@ -103,14 +103,11 @@ Backends are opt-in via extras:
|
|
|
103
103
|
|
|
104
104
|
| Extra | Pulls | Enables |
|
|
105
105
|
|---|---|---|
|
|
106
|
-
| `cairo` | CairoSVG | svg → png / pdf conversion |
|
|
107
|
-
| `scene` | pycairo | vector scene drawing (`renderer.scene.cairo`) |
|
|
106
|
+
| `cairo` | CairoSVG | svg → png / pdf conversion, and vector scene drawing |
|
|
108
107
|
| `imagemagick` | wand | pdf → png conversion (falls back to the `magick` CLI) |
|
|
109
108
|
| `plot` | matplotlib | 2D plotting (`renderer.graph`, `charts`) |
|
|
110
|
-
| `vtk` | vtk | 3D / mesh rendering (`geometry.mesh`) |
|
|
111
|
-
| `geometry` | scipy | geometry transforms (`geometry.operations`) |
|
|
112
109
|
| `video` | moviepy | video assembly (`renderer.video`) |
|
|
113
|
-
| `all` | all of the above | everything
|
|
110
|
+
| `all` | all of the above | everything |
|
|
114
111
|
|
|
115
112
|
For example, `pip install icplot[cairo]` for svg conversion, or
|
|
116
113
|
`pip install icplot[all]` for the full toolkit. The native `cairo` and
|
|
@@ -18,7 +18,7 @@ classifiers = [
|
|
|
18
18
|
keywords = ["Publishing", "Technical Reports", "Graphics"]
|
|
19
19
|
|
|
20
20
|
# Core is deliberately light: only what every import path needs. The heavy
|
|
21
|
-
# rendering backends (matplotlib/
|
|
21
|
+
# rendering backends (matplotlib/moviepy/wand) are optional extras
|
|
22
22
|
# so consumers that only use the converter or diagram renderer (e.g. the
|
|
23
23
|
# handbook build) can install a small footprint. Use icplot[all] for the
|
|
24
24
|
# previous behaviour of pulling every backend.
|
|
@@ -31,15 +31,10 @@ Repository = "https://git.ichec.ie/platform-engineering/modules/documentation/ic
|
|
|
31
31
|
Homepage = "https://git.ichec.ie/platform-engineering/modules/documentation/ichec-plot"
|
|
32
32
|
|
|
33
33
|
[project.optional-dependencies]
|
|
34
|
-
# svg/pdf conversion (converter.svg_to_png / svg_to_pdf)
|
|
35
|
-
# cairocffi, which dlopens
|
|
36
|
-
cairo
|
|
37
|
-
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
# vector scene drawing (renderer.scene.cairo). pycairo (module `cairo`)
|
|
41
|
-
# builds against libcairo — needs the cairo headers + a C toolchain at install.
|
|
42
|
-
scene = ["pycairo"]
|
|
34
|
+
# svg/pdf conversion (converter.svg_to_png / svg_to_pdf) and vector scene
|
|
35
|
+
# drawing (renderer.scene.cairo). CairoSVG pulls cairocffi, which dlopens
|
|
36
|
+
# libcairo at runtime — no C build step, and one cairo binding rather than two.
|
|
37
|
+
cairo = ["CairoSVG"]
|
|
43
38
|
|
|
44
39
|
# raster conversion via ImageMagick bindings (converter.pdf_to_png);
|
|
45
40
|
# falls back to the `magick` CLI if wand is absent
|
|
@@ -48,24 +43,15 @@ imagemagick = ["wand"]
|
|
|
48
43
|
# 2D plotting backend (icplot.renderer.graph / icplot.charts)
|
|
49
44
|
plot = ["matplotlib"]
|
|
50
45
|
|
|
51
|
-
#
|
|
52
|
-
vtk = ["vtk"]
|
|
53
|
-
|
|
54
|
-
# geometry transforms (icplot.geometry.operations)
|
|
55
|
-
geometry = ["scipy"]
|
|
56
|
-
|
|
57
|
-
# video assembly (icplot.renderer.video)
|
|
46
|
+
# video assembly (renderer.video, driven from renderer.graph.mpl)
|
|
58
47
|
video = ["moviepy"]
|
|
59
48
|
|
|
60
|
-
# convenience aggregate — every backend
|
|
49
|
+
# convenience aggregate — every backend
|
|
61
50
|
all = [
|
|
62
51
|
"CairoSVG",
|
|
63
|
-
"pycairo",
|
|
64
52
|
"wand",
|
|
65
53
|
"matplotlib",
|
|
66
|
-
"
|
|
67
|
-
"scipy",
|
|
68
|
-
"moviepy"
|
|
54
|
+
"moviepy",
|
|
69
55
|
]
|
|
70
56
|
|
|
71
57
|
[build-system]
|
|
@@ -115,7 +101,7 @@ src = ["src", "test"]
|
|
|
115
101
|
select = ["E", "W", "F", "I", "N", "UP", "B"]
|
|
116
102
|
|
|
117
103
|
[tool.ruff.lint.isort]
|
|
118
|
-
known-first-party = ["icplot"]
|
|
104
|
+
known-first-party = ["icplot", "utils"]
|
|
119
105
|
|
|
120
106
|
[tool.pytest.ini_options]
|
|
121
107
|
testpaths = ["test",]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import os
|
|
2
3
|
from collections.abc import Callable
|
|
3
4
|
from pathlib import Path
|
|
@@ -13,7 +14,9 @@ from icplot.graph.plot_group import PlotGroupPublic, PlotSeriesPublic
|
|
|
13
14
|
from icplot.graph.series import LinePlotSeries
|
|
14
15
|
from icplot.renderer.graph.matplotlib import render
|
|
15
16
|
|
|
16
|
-
from . import mpl
|
|
17
|
+
from . import mpl
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
class PlotConfig(BaseModel, frozen=True):
|
|
@@ -127,5 +130,6 @@ def plot_series(
|
|
|
127
130
|
if "mpl" in group.formats:
|
|
128
131
|
mpl.plot(output_path, group, series, converted_data_series)
|
|
129
132
|
|
|
130
|
-
if "vtk" in group.formats
|
|
131
|
-
|
|
133
|
+
if "vtk" in group.formats:
|
|
134
|
+
# Moved to icmesh.plot — warn rather than silently drop the request.
|
|
135
|
+
logger.warning("vtk plot output moved to icmesh; skipping %s", output_path)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# cairocffi, not pycairo: same drawing API, but it dlopens libcairo instead of
|
|
4
|
+
# building against its headers, and CairoSVG already pulls it in.
|
|
5
|
+
import cairocffi as cairo
|
|
4
6
|
|
|
5
7
|
from icplot.scene import Rectangle, Scene
|
|
6
8
|
|
|
@@ -54,6 +56,9 @@ def draw_scene(cr, scene: Scene):
|
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
def render(scene: Scene, path: Path):
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
# cairocffi surfaces take a str and are not context managers.
|
|
60
|
+
surface = cairo.SVGSurface(str(path), scene.size[0], scene.size[1])
|
|
61
|
+
try:
|
|
62
|
+
draw_scene(cairo.Context(surface), scene)
|
|
63
|
+
finally:
|
|
64
|
+
surface.finish()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: icplot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Utilities for generating plots and graphics for technical reports.
|
|
5
5
|
Author: Irish Centre for High End Computing
|
|
6
6
|
License: MIT
|
|
@@ -20,25 +20,16 @@ Requires-Dist: graphviz
|
|
|
20
20
|
Requires-Dist: Jinja2
|
|
21
21
|
Provides-Extra: cairo
|
|
22
22
|
Requires-Dist: CairoSVG; extra == "cairo"
|
|
23
|
-
Provides-Extra: scene
|
|
24
|
-
Requires-Dist: pycairo; extra == "scene"
|
|
25
23
|
Provides-Extra: imagemagick
|
|
26
24
|
Requires-Dist: wand; extra == "imagemagick"
|
|
27
25
|
Provides-Extra: plot
|
|
28
26
|
Requires-Dist: matplotlib; extra == "plot"
|
|
29
|
-
Provides-Extra: vtk
|
|
30
|
-
Requires-Dist: vtk; extra == "vtk"
|
|
31
|
-
Provides-Extra: geometry
|
|
32
|
-
Requires-Dist: scipy; extra == "geometry"
|
|
33
27
|
Provides-Extra: video
|
|
34
28
|
Requires-Dist: moviepy; extra == "video"
|
|
35
29
|
Provides-Extra: all
|
|
36
30
|
Requires-Dist: CairoSVG; extra == "all"
|
|
37
|
-
Requires-Dist: pycairo; extra == "all"
|
|
38
31
|
Requires-Dist: wand; extra == "all"
|
|
39
32
|
Requires-Dist: matplotlib; extra == "all"
|
|
40
|
-
Requires-Dist: vtk; extra == "all"
|
|
41
|
-
Requires-Dist: scipy; extra == "all"
|
|
42
33
|
Requires-Dist: moviepy; extra == "all"
|
|
43
34
|
Dynamic: license-file
|
|
44
35
|
|
|
@@ -50,9 +41,12 @@ This is a library used at [The Irish Centre for High End Computing (ICHEC)](http
|
|
|
50
41
|
|
|
51
42
|
The library is **frozen to what its consumers use** — the `ichec-handbook`
|
|
52
43
|
build tool and `ichec-flow`. That means `converter`, `renderer`, `theme` and
|
|
53
|
-
`graph`: fixes and maintenance yes, new capability no
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
`graph`: fixes and maintenance yes, new capability no.
|
|
45
|
+
|
|
46
|
+
The `geometry`/`mesh` 3D and OpenFOAM code has moved to
|
|
47
|
+
[icmesh](https://git.ichec.ie/platform-engineering/modules/ichec-mesh), taking
|
|
48
|
+
VTK and scipy with it — including VTK plot output, which is now
|
|
49
|
+
`icmesh.plot`. Install `icmesh` if you want it.
|
|
56
50
|
|
|
57
51
|
# Features #
|
|
58
52
|
|
|
@@ -103,7 +97,6 @@ Supported render inputs and targets are:
|
|
|
103
97
|
* Graph
|
|
104
98
|
* Backends:
|
|
105
99
|
* Matplotlib
|
|
106
|
-
* VTK
|
|
107
100
|
* Output formats:
|
|
108
101
|
* SVG
|
|
109
102
|
* PNG
|
|
@@ -124,10 +117,8 @@ Supported render inputs and targets are:
|
|
|
124
117
|
* Scene
|
|
125
118
|
* Backends:
|
|
126
119
|
* Cairo
|
|
127
|
-
* VTK
|
|
128
120
|
* Output formats:
|
|
129
121
|
* SVG
|
|
130
|
-
* VTK
|
|
131
122
|
|
|
132
123
|
## Themes ##
|
|
133
124
|
|
|
@@ -147,14 +138,11 @@ Backends are opt-in via extras:
|
|
|
147
138
|
|
|
148
139
|
| Extra | Pulls | Enables |
|
|
149
140
|
|---|---|---|
|
|
150
|
-
| `cairo` | CairoSVG | svg → png / pdf conversion |
|
|
151
|
-
| `scene` | pycairo | vector scene drawing (`renderer.scene.cairo`) |
|
|
141
|
+
| `cairo` | CairoSVG | svg → png / pdf conversion, and vector scene drawing |
|
|
152
142
|
| `imagemagick` | wand | pdf → png conversion (falls back to the `magick` CLI) |
|
|
153
143
|
| `plot` | matplotlib | 2D plotting (`renderer.graph`, `charts`) |
|
|
154
|
-
| `vtk` | vtk | 3D / mesh rendering (`geometry.mesh`) |
|
|
155
|
-
| `geometry` | scipy | geometry transforms (`geometry.operations`) |
|
|
156
144
|
| `video` | moviepy | video assembly (`renderer.video`) |
|
|
157
|
-
| `all` | all of the above | everything
|
|
145
|
+
| `all` | all of the above | everything |
|
|
158
146
|
|
|
159
147
|
For example, `pip install icplot[cairo]` for svg conversion, or
|
|
160
148
|
`pip install icplot[all]` for the full toolkit. The native `cairo` and
|
|
@@ -18,23 +18,6 @@ src/icplot/converter/__init__.py
|
|
|
18
18
|
src/icplot/converter/cli.py
|
|
19
19
|
src/icplot/converter/convert.py
|
|
20
20
|
src/icplot/converter/image.py
|
|
21
|
-
src/icplot/geometry/__init__.py
|
|
22
|
-
src/icplot/geometry/base.py
|
|
23
|
-
src/icplot/geometry/operations.py
|
|
24
|
-
src/icplot/geometry/shapes.py
|
|
25
|
-
src/icplot/geometry/transform.py
|
|
26
|
-
src/icplot/geometry/mesh/__init__.py
|
|
27
|
-
src/icplot/geometry/mesh/cell.py
|
|
28
|
-
src/icplot/geometry/mesh/edge.py
|
|
29
|
-
src/icplot/geometry/mesh/mesh.py
|
|
30
|
-
src/icplot/geometry/mesh/operations.py
|
|
31
|
-
src/icplot/geometry/mesh/shapes.py
|
|
32
|
-
src/icplot/geometry/mesh/vertex.py
|
|
33
|
-
src/icplot/geometry/mesh/vtk.py
|
|
34
|
-
src/icplot/geometry/mesh/openfoam/__init__.py
|
|
35
|
-
src/icplot/geometry/mesh/openfoam/blockmesh.py
|
|
36
|
-
src/icplot/geometry/mesh/openfoam/foamfile.py
|
|
37
|
-
src/icplot/geometry/mesh/openfoam/polymesh.py
|
|
38
21
|
src/icplot/graph/__init__.py
|
|
39
22
|
src/icplot/graph/axis.py
|
|
40
23
|
src/icplot/graph/plot.py
|
|
@@ -57,7 +40,6 @@ src/icplot/renderer/graph/color.py
|
|
|
57
40
|
src/icplot/renderer/graph/matplotlib.py
|
|
58
41
|
src/icplot/renderer/graph/mpl.py
|
|
59
42
|
src/icplot/renderer/graph/renderer.py
|
|
60
|
-
src/icplot/renderer/graph/vtk.py
|
|
61
43
|
src/icplot/renderer/scene/cairo.py
|
|
62
44
|
src/icplot/theme/__init__.py
|
|
63
45
|
src/icplot/theme/cli.py
|
|
@@ -70,14 +52,11 @@ src/icplot/theme/templates/tikz.j2
|
|
|
70
52
|
test/test_cairo.py
|
|
71
53
|
test/test_frontmatter.py
|
|
72
54
|
test/test_gantt_chart.py
|
|
73
|
-
test/test_geometry.py
|
|
74
55
|
test/test_image.py
|
|
75
56
|
test/test_line_plots.py
|
|
76
57
|
test/test_mermaid.py
|
|
77
|
-
test/test_meshing.py
|
|
78
|
-
test/test_openfoam.py
|
|
79
58
|
test/test_plot_group.py
|
|
80
|
-
test/test_polymesh.py
|
|
81
59
|
test/test_puml.py
|
|
82
60
|
test/test_tex.py
|
|
61
|
+
test/test_theme_generator.py
|
|
83
62
|
test/test_tree.py
|
|
@@ -4,30 +4,18 @@ Jinja2
|
|
|
4
4
|
|
|
5
5
|
[all]
|
|
6
6
|
CairoSVG
|
|
7
|
-
pycairo
|
|
8
7
|
wand
|
|
9
8
|
matplotlib
|
|
10
|
-
vtk
|
|
11
|
-
scipy
|
|
12
9
|
moviepy
|
|
13
10
|
|
|
14
11
|
[cairo]
|
|
15
12
|
CairoSVG
|
|
16
13
|
|
|
17
|
-
[geometry]
|
|
18
|
-
scipy
|
|
19
|
-
|
|
20
14
|
[imagemagick]
|
|
21
15
|
wand
|
|
22
16
|
|
|
23
17
|
[plot]
|
|
24
18
|
matplotlib
|
|
25
19
|
|
|
26
|
-
[scene]
|
|
27
|
-
pycairo
|
|
28
|
-
|
|
29
20
|
[video]
|
|
30
21
|
moviepy
|
|
31
|
-
|
|
32
|
-
[vtk]
|
|
33
|
-
vtk
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import shutil
|
|
3
3
|
|
|
4
|
-
from iccore.test_utils import get_test_output_dir
|
|
5
|
-
|
|
6
4
|
from icplot.renderer.scene import cairo as cairo_interface
|
|
7
5
|
from icplot.scene import Rectangle, Scene, TextPath
|
|
8
6
|
from icplot.theme.color import Color
|
|
7
|
+
from utils import get_test_output_dir
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
def test_cairo():
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
from iccore.test_utils import get_test_data_dir
|
|
4
|
-
|
|
5
3
|
from icplot.renderer.config import PlantUmlConfig, RenderConfig, apply_frontmatter
|
|
6
4
|
from icplot.renderer.frontmatter import parse
|
|
5
|
+
from utils import get_test_data_dir
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
def test_parse_returns_dict():
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import shutil
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
|
-
from iccore.test_utils import get_test_data_dir, get_test_output_dir
|
|
5
|
-
|
|
6
4
|
from icplot.renderer.config import MermaidConfig, RenderConfig, RenderContext
|
|
7
5
|
from icplot.renderer.formats import mermaid
|
|
6
|
+
from utils import get_test_data_dir, get_test_output_dir
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def test_mermaid():
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import shutil
|
|
2
2
|
|
|
3
|
-
from iccore.test_utils import get_test_data_dir, get_test_output_dir
|
|
4
|
-
|
|
5
3
|
from icplot.renderer.config import RenderConfig, RenderContext
|
|
6
4
|
from icplot.renderer.formats import plantuml
|
|
5
|
+
from utils import get_test_data_dir, get_test_output_dir
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
def test_puml():
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import shutil
|
|
2
2
|
|
|
3
|
-
from iccore.test_utils import get_test_data_dir, get_test_output_dir
|
|
4
|
-
|
|
5
3
|
from icplot.renderer.config import RenderConfig, RenderContext
|
|
6
4
|
from icplot.renderer.formats import tex
|
|
5
|
+
from utils import get_test_data_dir, get_test_output_dir
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
def test_tex():
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import icplot.theme
|
|
4
|
+
from icplot.theme.theme_generator import generate_theme
|
|
5
|
+
|
|
6
|
+
_THEME_DIR = Path(icplot.theme.__file__).parent
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_generate_theme(tmp_path):
|
|
10
|
+
generate_theme(tmp_path, _THEME_DIR / "theme.json", _THEME_DIR / "templates")
|
|
11
|
+
|
|
12
|
+
puml = tmp_path / "puml-theme-platform.puml"
|
|
13
|
+
tikz = tmp_path / "tikzlibraryplatform.code.tex"
|
|
14
|
+
assert puml.exists()
|
|
15
|
+
assert tikz.exists()
|
|
16
|
+
|
|
17
|
+
# Tokens must be substituted, not left as Jinja placeholders. The templates
|
|
18
|
+
# target PlantUML and TeX, so autoescape is off — a mangled colour here
|
|
19
|
+
# would mean it was turned back on.
|
|
20
|
+
for path in (puml, tikz):
|
|
21
|
+
content = path.read_text()
|
|
22
|
+
assert content.strip()
|
|
23
|
+
assert "{{" not in content
|
|
24
|
+
assert "&#" not in content
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_generate_theme_missing_file(tmp_path):
|
|
28
|
+
try:
|
|
29
|
+
generate_theme(tmp_path, tmp_path / "absent.json", _THEME_DIR / "templates")
|
|
30
|
+
except RuntimeError as e:
|
|
31
|
+
assert "not found" in str(e).lower()
|
|
32
|
+
else:
|
|
33
|
+
raise AssertionError("expected RuntimeError for a missing theme file")
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
|
|
5
|
-
import numpy as np
|
|
6
|
-
|
|
7
|
-
from .operations import get_point_distance
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@dataclass(frozen=True)
|
|
11
|
-
class Vector:
|
|
12
|
-
"""
|
|
13
|
-
A 3d spatial vector
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
x: float
|
|
17
|
-
y: float = 0.0
|
|
18
|
-
z: float = 0.0
|
|
19
|
-
|
|
20
|
-
def scale(self, factor: float) -> Vector:
|
|
21
|
-
return Vector(self.x * factor, self.y * factor, self.z * factor)
|
|
22
|
-
|
|
23
|
-
def as_array(self) -> np.ndarray:
|
|
24
|
-
return np.array([self.x, self.y, self.z])
|
|
25
|
-
|
|
26
|
-
def subtract(self, v: Vector) -> Vector:
|
|
27
|
-
return Vector(self.x - v.x, self.y - v.y, self.z - v.z)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@dataclass(frozen=True)
|
|
31
|
-
class Point:
|
|
32
|
-
"""
|
|
33
|
-
A location in 3d space
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
x: float
|
|
37
|
-
y: float = 0.0
|
|
38
|
-
z: float = 0.0
|
|
39
|
-
|
|
40
|
-
def as_array(self) -> np.ndarray:
|
|
41
|
-
return np.array([self.x, self.y, self.z])
|
|
42
|
-
|
|
43
|
-
def translate(self, v: Vector) -> Point:
|
|
44
|
-
return Point(self.x + v.x, self.y + v.y, self.z + v.z)
|
|
45
|
-
|
|
46
|
-
@staticmethod
|
|
47
|
-
def from_array(arr: np.ndarray) -> Point:
|
|
48
|
-
return Point(arr[0], arr[1], arr[2])
|
|
49
|
-
|
|
50
|
-
def subtract(self, v: Vector) -> Vector:
|
|
51
|
-
return Vector(self.x - v.x, self.y - v.y, self.z - v.z)
|
|
52
|
-
|
|
53
|
-
def get_distance(self, p: Point) -> float:
|
|
54
|
-
return get_point_distance(p.as_array(), self.as_array())
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
@dataclass(frozen=True)
|
|
58
|
-
class Bounds:
|
|
59
|
-
"""
|
|
60
|
-
A bounding box
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
xmin: float
|
|
64
|
-
xmax: float
|
|
65
|
-
ymin: float
|
|
66
|
-
ymax: float
|
|
67
|
-
zmin: float = 0.0
|
|
68
|
-
zmax: float = 0.0
|