pyvista-vector 0.1.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.
Files changed (81) hide show
  1. pyvista_vector-0.1.0/.clang-format +6 -0
  2. pyvista_vector-0.1.0/.github/dependabot.yml +40 -0
  3. pyvista_vector-0.1.0/.github/labeler.yml +18 -0
  4. pyvista_vector-0.1.0/.github/scripts/runtime_floors.py +24 -0
  5. pyvista_vector-0.1.0/.github/workflows/ci_cd.yml +371 -0
  6. pyvista_vector-0.1.0/.github/workflows/cpp.yml +181 -0
  7. pyvista_vector-0.1.0/.github/workflows/label.yml +40 -0
  8. pyvista_vector-0.1.0/.gitignore +20 -0
  9. pyvista_vector-0.1.0/.pre-commit-config.yaml +57 -0
  10. pyvista_vector-0.1.0/LICENSE +21 -0
  11. pyvista_vector-0.1.0/MANIFEST.in +9 -0
  12. pyvista_vector-0.1.0/PKG-INFO +323 -0
  13. pyvista_vector-0.1.0/README.rst +282 -0
  14. pyvista_vector-0.1.0/benchmarks/README.md +10 -0
  15. pyvista_vector-0.1.0/benchmarks/benchmark-examples.py +80 -0
  16. pyvista_vector-0.1.0/benchmarks/generate_gallery_plots.py +332 -0
  17. pyvista_vector-0.1.0/cpp/CMakeLists.txt +122 -0
  18. pyvista_vector-0.1.0/cpp/cmake/pvvecConfig.cmake.in +12 -0
  19. pyvista_vector-0.1.0/cpp/include/pvvec/pvvec.h +261 -0
  20. pyvista_vector-0.1.0/cpp/src/contour.cpp +1042 -0
  21. pyvista_vector-0.1.0/cpp/src/detail.h +559 -0
  22. pyvista_vector-0.1.0/cpp/src/pdf_writer.cpp +407 -0
  23. pyvista_vector-0.1.0/cpp/src/preview.cpp +1092 -0
  24. pyvista_vector-0.1.0/cpp/src/pvvec_api.cpp +407 -0
  25. pyvista_vector-0.1.0/cpp/src/silhouette.cpp +523 -0
  26. pyvista_vector-0.1.0/cpp/src/svg_writer.cpp +390 -0
  27. pyvista_vector-0.1.0/cpp/src/zbuf.cpp +477 -0
  28. pyvista_vector-0.1.0/cpp/tests/test_core.cpp +220 -0
  29. pyvista_vector-0.1.0/cpp/tools/pvvec_cli.cpp +239 -0
  30. pyvista_vector-0.1.0/doc/Makefile +20 -0
  31. pyvista_vector-0.1.0/doc/_static/pyvista_logo_sm.png +0 -0
  32. pyvista_vector-0.1.0/doc/_templates/autosummary/base.rst +5 -0
  33. pyvista_vector-0.1.0/doc/_templates/autosummary/class.rst +38 -0
  34. pyvista_vector-0.1.0/doc/_templates/autosummary/module.rst +65 -0
  35. pyvista_vector-0.1.0/doc/api.rst +45 -0
  36. pyvista_vector-0.1.0/doc/benchmarks/index.rst +13 -0
  37. pyvista_vector-0.1.0/doc/c_api.rst +44 -0
  38. pyvista_vector-0.1.0/doc/conf.py +81 -0
  39. pyvista_vector-0.1.0/doc/images/benchmark_gl2ps_comparison.png +0 -0
  40. pyvista_vector-0.1.0/doc/images/example_aero_bracket.svg +60 -0
  41. pyvista_vector-0.1.0/doc/images/example_dragon.svg +59 -0
  42. pyvista_vector-0.1.0/doc/images/example_notch_stress.svg +54 -0
  43. pyvista_vector-0.1.0/doc/images/example_st_helens.svg +63 -0
  44. pyvista_vector-0.1.0/doc/images/example_turbine_blade.svg +59 -0
  45. pyvista_vector-0.1.0/doc/images/gallery_showcase.png +0 -0
  46. pyvista_vector-0.1.0/doc/images/live_vector_mode_showcase.png +0 -0
  47. pyvista_vector-0.1.0/doc/images/research_rotor_modes_1p83m.png +0 -0
  48. pyvista_vector-0.1.0/doc/images/research_rotor_strain_reconstruction.png +0 -0
  49. pyvista_vector-0.1.0/doc/index.rst +31 -0
  50. pyvista_vector-0.1.0/examples/00-basic-vector-export.py +49 -0
  51. pyvista_vector-0.1.0/examples/01-compare-gl2ps.py +50 -0
  52. pyvista_vector-0.1.0/examples/02-pyvista-examples-gallery.py +54 -0
  53. pyvista_vector-0.1.0/examples/03-live-vectorized-mode.py +43 -0
  54. pyvista_vector-0.1.0/examples/04-turbomachinery-rotor-modes.py +122 -0
  55. pyvista_vector-0.1.0/examples/README.txt +5 -0
  56. pyvista_vector-0.1.0/pyproject.toml +147 -0
  57. pyvista_vector-0.1.0/setup.cfg +4 -0
  58. pyvista_vector-0.1.0/setup.py +175 -0
  59. pyvista_vector-0.1.0/src/pyvista_vector/__init__.py +74 -0
  60. pyvista_vector-0.1.0/src/pyvista_vector/_capi.py +726 -0
  61. pyvista_vector-0.1.0/src/pyvista_vector/_plugin.py +790 -0
  62. pyvista_vector-0.1.0/src/pyvista_vector/_version.py +24 -0
  63. pyvista_vector-0.1.0/src/pyvista_vector/colormaps.py +128 -0
  64. pyvista_vector-0.1.0/src/pyvista_vector/datasets.py +375 -0
  65. pyvista_vector-0.1.0/src/pyvista_vector/mpl.py +181 -0
  66. pyvista_vector-0.1.0/src/pyvista_vector/render.py +584 -0
  67. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/PKG-INFO +323 -0
  68. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/SOURCES.txt +79 -0
  69. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/dependency_links.txt +1 -0
  70. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/entry_points.txt +21 -0
  71. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/requires.txt +23 -0
  72. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/scm_file_list.json +74 -0
  73. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/scm_version.json +8 -0
  74. pyvista_vector-0.1.0/src/pyvista_vector.egg-info/top_level.txt +1 -0
  75. pyvista_vector-0.1.0/tests/conformance/test_c_abi_boundary.py +63 -0
  76. pyvista_vector-0.1.0/tests/conformance/test_c_abi_runtime.py +87 -0
  77. pyvista_vector-0.1.0/tests/conformance/test_cli_parity.py +64 -0
  78. pyvista_vector-0.1.0/tests/test_colormaps_and_errors.py +90 -0
  79. pyvista_vector-0.1.0/tests/test_datasets_and_render.py +142 -0
  80. pyvista_vector-0.1.0/tests/test_examples_gallery.py +29 -0
  81. pyvista_vector-0.1.0/tests/test_vector_mode_plugin.py +263 -0
@@ -0,0 +1,6 @@
1
+ ---
2
+ Language: Cpp
3
+ BasedOnStyle: Google
4
+ ColumnLimit: 100
5
+ DerivePointerAlignment: false
6
+ PointerAlignment: Right
@@ -0,0 +1,40 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ insecure-external-code-execution: allow
6
+ schedule:
7
+ interval: "monthly"
8
+ open-pull-requests-limit: 100
9
+ labels:
10
+ - "maintenance"
11
+ - "dependencies"
12
+ groups:
13
+ pip:
14
+ patterns:
15
+ - "*"
16
+ - package-ecosystem: "github-actions"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "monthly"
20
+ open-pull-requests-limit: 100
21
+ labels:
22
+ - "maintenance"
23
+ - "dependencies"
24
+ groups:
25
+ actions:
26
+ patterns:
27
+ - "*"
28
+ rebase-strategy: "disabled"
29
+ - package-ecosystem: "pre-commit"
30
+ directory: "/"
31
+ schedule:
32
+ interval: "monthly"
33
+ open-pull-requests-limit: 100
34
+ labels:
35
+ - "maintenance"
36
+ - "dependencies"
37
+ groups:
38
+ pre-commit:
39
+ patterns:
40
+ - "*"
@@ -0,0 +1,18 @@
1
+ documentation:
2
+ - any:
3
+ - changed-files:
4
+ - any-glob-to-any-file: "doc/**/*"
5
+ - any-glob-to-any-file: "examples/**/*"
6
+ - any-glob-to-any-file: "./*.md"
7
+ - any-glob-to-any-file: "./*.rst"
8
+ maintenance:
9
+ - any:
10
+ - changed-files:
11
+ - any-glob-to-any-file: ".github/**/*"
12
+ - any-glob-to-any-file: "pyproject.toml"
13
+ - any-glob-to-any-file: "setup.py"
14
+ dependencies:
15
+ - any:
16
+ - changed-files:
17
+ - any-glob-to-any-file: "requirements*"
18
+ - any-glob-to-any-file: "environment.yml"
@@ -0,0 +1,24 @@
1
+ # /// script
2
+ # requires-python = ">=3.11"
3
+ # dependencies = ["packaging"]
4
+ # ///
5
+ """Print ``name==floor`` for every runtime dependency declared in pyproject.toml."""
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+ import sys
11
+ import tomllib
12
+
13
+ from packaging.requirements import Requirement
14
+
15
+ pyproject = tomllib.loads((Path(__file__).parents[2] / "pyproject.toml").read_text())
16
+ pins = []
17
+ for dep in pyproject["project"]["dependencies"]:
18
+ req = Requirement(dep)
19
+ floors = [s.version for s in req.specifier if s.operator == ">="]
20
+ if len(floors) != 1:
21
+ msg = f"{req.name} needs exactly one >= floor, got {dep!r}"
22
+ raise SystemExit(msg)
23
+ pins.append(f"{req.name}=={floors[0]}")
24
+ sys.stdout.write(" ".join(pins) + "\n")
@@ -0,0 +1,371 @@
1
+ name: Unit Testing and Deployment
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+ push:
7
+ tags:
8
+ - "*"
9
+ branches:
10
+ - main
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ env:
20
+ ALLOW_PLOTTING: true
21
+ SHELLOPTS: "errexit:pipefail"
22
+
23
+ jobs:
24
+ pre-commit:
25
+ name: pre-commit
26
+ runs-on: ubuntu-24.04
27
+ if: github.event_name == 'pull_request'
28
+ steps:
29
+ - uses: actions/checkout@v7
30
+
31
+ - name: Set up Python 3.13
32
+ uses: actions/setup-python@v7
33
+ with:
34
+ python-version: "3.13"
35
+
36
+ - uses: pre-commit/action@v3.0.1
37
+
38
+ doc:
39
+ name: Build Documentation
40
+ runs-on: ubuntu-24.04
41
+ permissions:
42
+ contents: write
43
+ steps:
44
+ - uses: actions/checkout@v7
45
+ with:
46
+ fetch-depth: 0
47
+
48
+ - name: Set up Python 3.13
49
+ uses: actions/setup-python@v7
50
+ with:
51
+ python-version: "3.13"
52
+ cache: "pip"
53
+ cache-dependency-path: pyproject.toml
54
+
55
+ - name: Install uv
56
+ run: pip install uv
57
+
58
+ - name: Install with documentation dependencies
59
+ env:
60
+ PVVEC_BUILD_CORE: "1"
61
+ run: |
62
+ uv pip install --system .[docs] &&
63
+ python -m pip install pyvista vtk &&
64
+ uv pip check --system
65
+
66
+ - name: Setup headless display
67
+ uses: pyvista/setup-headless-display-action@v5.2
68
+
69
+ - name: Build Documentation
70
+ run: |
71
+ make -C doc html
72
+ touch doc/_build/html/.nojekyll
73
+
74
+ - name: Deploy on release
75
+ if: startsWith(github.ref, 'refs/tags/v')
76
+ uses: peaceiris/actions-gh-pages@v4
77
+ with:
78
+ github_token: ${{ secrets.GITHUB_TOKEN }}
79
+ publish_dir: doc/_build/html/
80
+
81
+ unit_testing:
82
+ name: Unit Testing
83
+ runs-on: ${{ matrix.os }}
84
+ strategy:
85
+ fail-fast: false
86
+ matrix:
87
+ os: [ubuntu-latest, windows-latest, macos-15-intel]
88
+ python-version: ["3.11", "3.13"]
89
+ vtk-version: ["9.3.1", "9.4.2", "latest"]
90
+ exclude:
91
+ - vtk-version: "9.3.1"
92
+ python-version: "3.13"
93
+ - os: macos-15-intel
94
+ python-version: "3.11"
95
+ - os: macos-15-intel
96
+ vtk-version: "9.3.1"
97
+ - os: macos-15-intel
98
+ vtk-version: "9.4.2"
99
+ - os: windows-latest
100
+ vtk-version: "9.3.1"
101
+ - os: windows-latest
102
+ vtk-version: "9.4.2"
103
+
104
+ steps:
105
+ - uses: actions/checkout@v7
106
+
107
+ - name: Set up Python ${{ matrix.python-version }}
108
+ uses: actions/setup-python@v7
109
+ with:
110
+ python-version: ${{ matrix.python-version }}
111
+ cache: "pip"
112
+ cache-dependency-path: pyproject.toml
113
+
114
+ - name: Install uv
115
+ run: pip install uv
116
+
117
+ - name: Install with test dependencies
118
+ env:
119
+ PVVEC_BUILD_CORE: "1"
120
+ run: |
121
+ uv pip install --system .[tests] &&
122
+ python -m pip install pyvista ${{ matrix.vtk-version != 'latest' && format('vtk=={0}', matrix.vtk-version) || 'vtk' }} &&
123
+ uv pip check --system
124
+
125
+ - name: Confirm the VTK version
126
+ run: python -c "import importlib.metadata as m, sys; v = m.version('vtk'); print('vtk', v); sys.exit(0 if '${{ matrix.vtk-version }}' in ('latest', v) else 1)"
127
+
128
+ - name: Confirm the C++ core is present
129
+ run: |
130
+ python -c "
131
+ from pyvista_vector import _capi
132
+ print('C++ core loaded from', _capi.library_path())"
133
+
134
+ - name: Setup headless display
135
+ uses: pyvista/setup-headless-display-action@v5.2
136
+
137
+ - name: Unit Testing
138
+ run: pytest -vv
139
+
140
+ - name: Build and verify wheels
141
+ run: |
142
+ uv pip install --system build twine
143
+ python -m build
144
+ python -m twine check dist/*
145
+
146
+ dependency_floor:
147
+ name: Dependency Floor
148
+ runs-on: ubuntu-latest
149
+ steps:
150
+ - uses: actions/checkout@v7
151
+
152
+ - name: Set up Python 3.11
153
+ uses: actions/setup-python@v7
154
+ with:
155
+ python-version: "3.11"
156
+ cache: "pip"
157
+ cache-dependency-path: pyproject.toml
158
+
159
+ - name: Install uv
160
+ run: pip install uv
161
+
162
+ - name: Install with test dependencies at the declared floors
163
+ env:
164
+ PVVEC_BUILD_CORE: "1"
165
+ run: |
166
+ uv pip install --system .[tests] $(uv run .github/scripts/runtime_floors.py) &&
167
+ python -m pip install $(uv run .github/scripts/runtime_floors.py) vtk==9.3.1 &&
168
+ uv pip check --system
169
+
170
+ - name: Setup headless display
171
+ uses: pyvista/setup-headless-display-action@v5.2
172
+
173
+ - name: Unit Testing
174
+ run: pytest -vv
175
+
176
+ cvista:
177
+ name: cvista without stock VTK
178
+ runs-on: ubuntu-latest
179
+ steps:
180
+ - uses: actions/checkout@v7
181
+
182
+ - name: Set up Python 3.13
183
+ uses: actions/setup-python@v7
184
+ with:
185
+ python-version: "3.13"
186
+ cache: "pip"
187
+ cache-dependency-path: pyproject.toml
188
+
189
+ - name: Install uv
190
+ run: pip install uv
191
+
192
+ - name: Install with cvista and test dependencies
193
+ env:
194
+ PVVEC_BUILD_CORE: "1"
195
+ run: |
196
+ uv pip install --system .[tests] 'pyvista[cvista]>=0.49'
197
+ uv pip uninstall --system vtk
198
+
199
+ - name: Confirm cvista is the only VTK binding
200
+ run: |
201
+ python - <<'PY'
202
+ from importlib.metadata import requires
203
+ import importlib.util
204
+ from packaging.requirements import Requirement
205
+ import pyvista as pv
206
+
207
+ assert all(Requirement(req).name != "vtk" for req in requires("pyvista-vector"))
208
+ assert importlib.util.find_spec("vtkmodules") is None
209
+ assert pv.vtk_backend() == "cvista"
210
+ print("PyVista backend:", pv.vtk_backend())
211
+ PY
212
+
213
+ - name: Setup headless display
214
+ uses: pyvista/setup-headless-display-action@v5.2
215
+
216
+ - name: Unit Testing
217
+ run: pytest -vv
218
+
219
+ wheels:
220
+ name: Wheels (${{ matrix.os }})
221
+ runs-on: ${{ matrix.os }}
222
+ timeout-minutes: 90
223
+ strategy:
224
+ fail-fast: false
225
+ matrix:
226
+ include:
227
+ - os: ubuntu-latest
228
+ archs_linux: x86_64
229
+ - os: ubuntu-24.04-arm
230
+ archs_linux: aarch64
231
+ - os: macos-15-intel
232
+ - os: windows-latest
233
+
234
+ steps:
235
+ - uses: actions/checkout@v7
236
+ with:
237
+ fetch-depth: 0
238
+
239
+ - name: Build wheels
240
+ uses: pypa/cibuildwheel@v4.3.5
241
+ env:
242
+ CIBW_BUILD: "cp310-* cp312-*"
243
+ CIBW_SKIP: "*-musllinux_* cp310-macosx_* cp310-win*"
244
+ CIBW_TEST_SKIP: "cp310-manylinux*"
245
+ CIBW_ARCHS_LINUX: ${{ matrix.archs_linux }}
246
+ CIBW_ARCHS_MACOS: "x86_64 arm64"
247
+ CIBW_ARCHS_WINDOWS: AMD64
248
+ CIBW_ENVIRONMENT: PVVEC_BUILD_CORE=1
249
+ CIBW_ENVIRONMENT_MACOS: PVVEC_BUILD_CORE=1 MACOSX_DEPLOYMENT_TARGET=10.15
250
+ CIBW_TEST_COMMAND: >
251
+ python -c
252
+ "from pyvista_vector import _capi;
253
+ print('C++ core loaded from', _capi.library_path())"
254
+
255
+ - uses: actions/upload-artifact@v7
256
+ with:
257
+ name: wheels-${{ matrix.os }}
258
+ path: wheelhouse/*.whl
259
+
260
+ sdist:
261
+ name: Source distribution
262
+ runs-on: ubuntu-latest
263
+ timeout-minutes: 30
264
+ steps:
265
+ - uses: actions/checkout@v7
266
+ with:
267
+ fetch-depth: 0
268
+
269
+ - name: Set up Python 3.13
270
+ uses: actions/setup-python@v7
271
+ with:
272
+ python-version: "3.13"
273
+
274
+ - name: Build the sdist
275
+ run: |
276
+ python -m pip install --upgrade pip build
277
+ python -m build --sdist
278
+
279
+ - name: A source install must still reach the C++ core
280
+ env:
281
+ PVVEC_BUILD_CORE: "1"
282
+ run: |
283
+ pip install dist/*.tar.gz
284
+ cd "$(mktemp -d)"
285
+ python -c "
286
+ from pyvista_vector import _capi
287
+ print('C++ core built from sdist:', _capi.library_path())"
288
+
289
+ - uses: actions/upload-artifact@v7
290
+ with:
291
+ name: sdist
292
+ path: dist/*.tar.gz
293
+
294
+ release:
295
+ name: GitHub Release
296
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
297
+ needs: [doc, unit_testing, dependency_floor, cvista, wheels, sdist]
298
+ runs-on: ubuntu-latest
299
+ permissions:
300
+ contents: write
301
+ steps:
302
+ - uses: actions/checkout@v7
303
+
304
+ - name: Collect the wheels built for this commit
305
+ uses: actions/download-artifact@v8
306
+ with:
307
+ pattern: wheels-*
308
+ merge-multiple: true
309
+ path: dist
310
+
311
+ - name: Collect the sdist built for this commit
312
+ uses: actions/download-artifact@v8
313
+ with:
314
+ name: sdist
315
+ path: dist
316
+
317
+ - name: Verify release distributions
318
+ run: |
319
+ ls -lh dist
320
+ test -n "$(find dist -name '*.whl' -print -quit)" || {
321
+ echo "::error::no wheels to publish"
322
+ exit 1
323
+ }
324
+ test "$(find dist -name '*.tar.gz' | wc -l)" -eq 1
325
+ if find dist -name '*-py3-none-any.whl' | grep -q .; then
326
+ echo "::error::a py3-none-any wheel carries no C++ core"
327
+ exit 1
328
+ fi
329
+ python -m pip install --upgrade pip twine
330
+ python -m twine check dist/*
331
+
332
+ - name: Create GitHub Release
333
+ uses: softprops/action-gh-release@v3.0.4
334
+ with:
335
+ generate_release_notes: true
336
+ files: |
337
+ dist/*.whl
338
+ dist/*.tar.gz
339
+
340
+ publish_pypi:
341
+ name: Publish to PyPI
342
+ if: >-
343
+ github.event_name == 'push' &&
344
+ startsWith(github.ref, 'refs/tags/v') &&
345
+ (!github.event.repository.private || vars.PUBLISH_TO_PYPI == 'true')
346
+ needs: [release]
347
+ runs-on: ubuntu-latest
348
+ environment:
349
+ name: pypi
350
+ url: https://pypi.org/p/pyvista-vector
351
+ permissions:
352
+ id-token: write
353
+ contents: read
354
+ steps:
355
+ - name: Collect the wheels built for this commit
356
+ uses: actions/download-artifact@v8
357
+ with:
358
+ pattern: wheels-*
359
+ merge-multiple: true
360
+ path: dist
361
+
362
+ - name: Collect the sdist built for this commit
363
+ uses: actions/download-artifact@v8
364
+ with:
365
+ name: sdist
366
+ path: dist
367
+
368
+ - name: Publish package distributions to PyPI
369
+ uses: pypa/gh-action-pypi-publish@release/v1
370
+ with:
371
+ skip-existing: true
@@ -0,0 +1,181 @@
1
+ name: C++ Core
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+ push:
7
+ tags:
8
+ - "*"
9
+ branches:
10
+ - main
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ env:
20
+ SHELLOPTS: "errexit:pipefail"
21
+
22
+ jobs:
23
+ cmake:
24
+ name: CMake + parity (${{ matrix.os }})
25
+ runs-on: ${{ matrix.os }}
26
+ timeout-minutes: 30
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ os: [ubuntu-latest, macos-15-intel, windows-latest]
31
+
32
+ steps:
33
+ - uses: actions/checkout@v7
34
+
35
+ - name: Set up Python 3.13
36
+ uses: actions/setup-python@v7
37
+ with:
38
+ python-version: "3.13"
39
+ cache: "pip"
40
+ cache-dependency-path: pyproject.toml
41
+
42
+ - name: Configure
43
+ shell: bash
44
+ run: |
45
+ cmake -S cpp -B cpp/build \
46
+ -DCMAKE_BUILD_TYPE=Release \
47
+ -DPVVEC_BUILD_SHARED=ON \
48
+ -DPVVEC_BUILD_TOOLS=ON \
49
+ -DPVVEC_BUILD_TESTS=ON
50
+
51
+ - name: Build
52
+ shell: bash
53
+ run: cmake --build cpp/build --config Release --parallel
54
+
55
+ - name: Run C++ unit tests
56
+ shell: bash
57
+ run: ctest --test-dir cpp/build --build-config Release --output-on-failure --no-tests=error
58
+
59
+ - name: Locate the build artefacts
60
+ shell: bash
61
+ run: |
62
+ find_one() {
63
+ found=$(find cpp/build -name "$1" -type f | head -n 1)
64
+ if [ -z "$found" ]; then
65
+ echo "::error::did not find $1 in the build tree"
66
+ exit 1
67
+ fi
68
+ echo "$found"
69
+ }
70
+ case "${{ runner.os }}" in
71
+ Windows) libname=pvvec.dll; suffix=.exe ;;
72
+ macOS) libname=libpvvec.dylib; suffix= ;;
73
+ *) libname=libpvvec.so; suffix= ;;
74
+ esac
75
+ {
76
+ echo "PVVEC_LIBRARY=$(pwd)/$(find_one "$libname")"
77
+ echo "PVVEC_CLI=$(pwd)/$(find_one "pvvec_cli$suffix")"
78
+ } >> "$GITHUB_ENV"
79
+
80
+ - name: Install the package as pure Python
81
+ shell: bash
82
+ env:
83
+ PVVEC_BUILD_CORE: "0"
84
+ run: |
85
+ python -m pip install --upgrade pip
86
+ pip install .[tests] vtk
87
+
88
+ - name: Confirm the tests will use the CMake build
89
+ shell: bash
90
+ run: |
91
+ python - <<'PY'
92
+ import os
93
+ from pyvista_vector import _capi
94
+
95
+ expected = os.environ["PVVEC_LIBRARY"]
96
+ actual = _capi.library_path()
97
+ assert actual == expected, f"loaded {actual}, expected {expected}"
98
+ print(f"ABI {_capi.ABI_VERSION} from {actual}")
99
+ PY
100
+
101
+ - name: Setup headless display
102
+ uses: pyvista/setup-headless-display-action@v5.2
103
+
104
+ - name: Conformance and parity
105
+ shell: bash
106
+ run: pytest tests -vv
107
+
108
+ sanitizers:
109
+ name: Sanitizers (ASan + UBSan)
110
+ runs-on: ubuntu-latest
111
+ timeout-minutes: 20
112
+ steps:
113
+ - uses: actions/checkout@v7
114
+
115
+ - name: Configure and build with ASan + UBSan
116
+ run: |
117
+ cmake -S cpp -B cpp/build-san \
118
+ -DCMAKE_BUILD_TYPE=Debug \
119
+ -DPVVEC_BUILD_SHARED=OFF \
120
+ -DPVVEC_BUILD_TOOLS=ON \
121
+ -DPVVEC_BUILD_TESTS=ON \
122
+ -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \
123
+ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
124
+ cmake --build cpp/build-san --parallel
125
+
126
+ - name: Run sanitized C++ tests and CLI demo
127
+ run: |
128
+ ctest --test-dir cpp/build-san --output-on-failure --no-tests=error
129
+ ./cpp/build-san/pvvec_cli demo /tmp/san.svg /tmp/san.pdf 2
130
+
131
+ wasm:
132
+ name: WebAssembly (${{ matrix.config }})
133
+ runs-on: ubuntu-latest
134
+ timeout-minutes: 30
135
+ strategy:
136
+ fail-fast: false
137
+ matrix:
138
+ include:
139
+ - config: threads
140
+ pvvec_threads: "ON"
141
+ emcc_thread_flags: -DCMAKE_C_FLAGS=-pthread -DCMAKE_CXX_FLAGS=-pthread
142
+ emcc_linker_flags: -pthread -sPTHREAD_POOL_SIZE=4 -sALLOW_MEMORY_GROWTH=1 -sNODERAWFS=1 -sEXIT_RUNTIME=1
143
+ cli_threads: "4"
144
+ - config: threads-off
145
+ pvvec_threads: "OFF"
146
+ emcc_thread_flags: ""
147
+ emcc_linker_flags: -sALLOW_MEMORY_GROWTH=1 -sNODERAWFS=1 -sEXIT_RUNTIME=1
148
+ cli_threads: "1"
149
+ steps:
150
+ - uses: actions/checkout@v7
151
+
152
+ - uses: mymindstorm/setup-emsdk@v16
153
+ with:
154
+ version: 4.0.20
155
+
156
+ - name: Build for the host
157
+ run: |
158
+ cmake -S cpp -B cpp/build-host \
159
+ -DCMAKE_BUILD_TYPE=Release \
160
+ -DPVVEC_BUILD_TOOLS=ON
161
+ cmake --build cpp/build-host --parallel
162
+
163
+ - name: Build for WebAssembly
164
+ run: |
165
+ emcmake cmake -S cpp -B cpp/build-wasm \
166
+ -DCMAKE_BUILD_TYPE=Release \
167
+ -DPVVEC_BUILD_SHARED=OFF \
168
+ -DPVVEC_BUILD_TOOLS=ON \
169
+ -DPVVEC_THREADS=${{ matrix.pvvec_threads }} \
170
+ ${{ matrix.emcc_thread_flags }} \
171
+ -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.emcc_linker_flags }}"
172
+ cmake --build cpp/build-wasm --parallel
173
+
174
+ - name: WASM SVG and PDF output must match the host byte for byte
175
+ run: |
176
+ ./cpp/build-host/pvvec_cli demo host.svg host.pdf ${{ matrix.cli_threads }} > host.txt
177
+ node cpp/build-wasm/pvvec_cli.js demo wasm.svg wasm.pdf ${{ matrix.cli_threads }} > wasm.txt
178
+ cat host.txt
179
+ diff host.txt wasm.txt
180
+ cmp host.svg wasm.svg
181
+ cmp host.pdf wasm.pdf
@@ -0,0 +1,40 @@
1
+ name: "Pull Request Labeler"
2
+ on:
3
+ pull_request_target:
4
+ types: [opened, reopened]
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ triage:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ pull-requests: write
15
+ steps:
16
+ - name: Label based on changed files
17
+ uses: actions/labeler@v7
18
+ with:
19
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
20
+
21
+ - uses: actions-ecosystem/action-add-labels@v1
22
+ if: startsWith(github.event.pull_request.head.ref, 'doc/') || startsWith(github.event.pull_request.head.ref, 'docs')
23
+ with:
24
+ labels: documentation
25
+ - uses: actions-ecosystem/action-add-labels@v1
26
+ if: startsWith(github.event.pull_request.head.ref, 'maint') || startsWith(github.event.pull_request.head.ref, 'no-ci') || startsWith(github.event.pull_request.head.ref, 'ci')
27
+ with:
28
+ labels: maintenance
29
+ - uses: actions-ecosystem/action-add-labels@v1
30
+ if: startsWith(github.event.pull_request.head.ref, 'feat')
31
+ with:
32
+ labels: enhancement
33
+ - uses: actions-ecosystem/action-add-labels@v1
34
+ if: startsWith(github.event.pull_request.head.ref, 'fix') || startsWith(github.event.pull_request.head.ref, 'patch')
35
+ with:
36
+ labels: bug
37
+ - uses: actions-ecosystem/action-add-labels@v1
38
+ if: startsWith(github.event.pull_request.head.ref, 'release')
39
+ with:
40
+ labels: release
@@ -0,0 +1,20 @@
1
+ build/
2
+ dist/
3
+ wheelhouse/
4
+ *.egg-info/
5
+ .eggs/
6
+ .venv/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ coverage.xml
12
+ __pycache__/
13
+ *.py[cod]
14
+ src/pyvista_vector/_version.py
15
+ src/pyvista_vector/lib/
16
+ cpp/build*/
17
+ doc/_build/
18
+ doc/auto_examples/
19
+ doc/_autosummary/
20
+ doc/errors.txt