VeraInViewer
A Python port of the 3D core visualization of VeraInView, built with trame, VTK and trame-vtklocal.
The scene is built with VTK on the server and mirrored in the browser with VTK.wasm, so all rendering and interaction happen client side: only geometry and state changes go over the wire.
It reads VERAin XML files (Teuchos ParameterList, e.g. the built-in samples in src/vera_in_viewer/samples) and shows:
- every pin of every assembly / control / detector / insert, stacked along their axial elevations, as concentric material rings (one concentric cylinder mesh per cell type, split into one glyph mapper per material; walls only where a material is hidden)
- spacer grids (strap thickness computed from mass and density), baffle, vessel, neutron pads and core plates, each with its own visibility toggle
- per material visibility, using VeraInView's color palette and color assignment rules
- elevation slices (the rod segments crossing an axial range, with a wireframe outline)
- control rod banks: positions per
STATEScard (cumulative, like the simulation sees them), per bank slider and visibility, insert / withdraw all, color by bank - 2D mode (parallel top view with pan/zoom interaction), vertical scaling, adjustable cylinder resolution
Quick start
Requires uv.
uv run vera-in-viewer # pick a built-in sample or drop a file
uv run vera-in-viewer --data ~/cases # also list the files of a directory
uv run vera-in-viewer --data ~/cases/core.xml # loaded right away
A browser tab opens automatically. Useful trame options: --port 1234, --server (do not open a
browser), --host 0.0.0.0.
Interaction
In 3D, left drag rotates, right drag (or scroll) zooms, shift + left drag (or middle drag) pans. The toolbar holds the structure toggles and the vertical scale slider. A collapsible floating bar at the top right of the 3D view holds the camera controls:
-
reset camera: fit the scene without changing the view direction
-
2D/3D (pan / orbit icons): 2D switches to a parallel top view (like the 2D core maps of VeraInView) where left drag pans and right drag or scroll zooms (no rotation)
-
perspective / parallel projection (cone / cylinder icons)
-
top, side and isometric views
-
download a PNG screenshot of the 3D view, read back from VTK.wasm in the browser. This needs a VTK nightly (9.7.20260716 or newer), the button is hidden with older versions:
uv pip install --pre --index-url https://wheels.vtk.org "vtk>=9.7.20260716.dev0" uv run --no-sync vera-in-viewer
The bar collapses into a single button with its top chevron.
The start page is a full screen drop zone: drop or browse a local file, pick one of the built-in
samples (CASL AMA problems 6 and 8, with a preview of each) or one of the files given with --data.
Once loaded, the toolbar shows the case title, the file name with the core size, pin segment
and material counts, and a close button to go back to the start page.
Development
uv sync --all-extras --dev # create .venv with runtime + dev dependencies
uv run pytest # run the tests
uvx nox # lint + tests on every supported Python
uvx nox -s fmt # format and auto-fix with ruff
uvx nox -s serve # launch the viewer
uvx nox -s build # build sdist + wheel into ./dist
uvx pre-commit install # optional: ruff + uv lock checks on commit
# Run pre-commit
uvx pre-commit run --all-files
| Tool | Role |
|---|---|
| uv | Python/dependency management, locked in uv.lock, uv_build backend |
| nox | Task runner (noxfile.py), sessions use uv and the lock file |
| ruff | Linting and formatting (config in pyproject.toml) |
| pytest | Tests, including the baffle/assembly overlap check on the built-in samples |
| pre-commit | Optional git hooks (.pre-commit-config.yaml) |
| GitHub CI | .github/workflows/ci.yml runs nox on Linux / macOS / Windows |
Layout
src/vera_in_viewer/
parser.py VERAin XML -> nested dicts (port of XMLVeraParser.js)
colors.py categorical color assignment (port of ColorManager.js + presets)
model.py dicts -> CoreModel: pin instances, grids, baffle, vessel, states
(port of ImageGenerator.compute3DCore and ModelHelper extractors)
geometry.py VTK meshes: concentric cylinder source (port of vtk.js), cubes, glyph instances
pipeline.py CoreScene: VTK actors/mappers and view settings (port of PipelineManager.js)
app.py trame UI (vuetify 4) + trame-vtklocal LocalView
module/serve/ client assets: 2D interaction script, start page style and background
samples/ built-in VERAin samples, their previews and metadata (index.json)
tests/ unit tests and a tiny synthetic core (tests/data/mini_core.xml)
model.py is pure Python + numpy, so the reactor description can be reused or tested without VTK.
Differences from VeraInView
- Only the 3D core view is ported (no 2D maps, cell/assembly views or editor).
- Assemblies are centered in their pitch (VeraInView offsets them by half a pin pitch).
- Baffle plates are computed per exposed assembly edge with proper convex/concave corner handling and Y orientation matching the core map, so they never overlap assemblies.
- Control rods start fully inserted.
- The LOD/Full switch is replaced by a resolution slider; the default depends on the number of pins (6 sides for full cores like VeraInView's LOD, 24 for small models).
Implementation notes
- Cell connectivity is stored in fixed width (
int32) arrays:vtkIdTypeArrayis 64-bit on the server but 32-bit in the wasm32 client, which garbles the meshes. - Coloring rods by bank uses a per instance color array toggled through the mapper scalar
visibility: changing only the actor color of a
vtkGlyph3DMapperwas not always picked up by the client after a scene rebuild. - VTK.wasm ignores interactor style changes after creation and has no serializer for
vtkInteractorStyleManipulator, so the 2D mode keeps the trackball style and a small client script (module/serve/view_2d.js) remaps the left button to the middle one (pan). - Scene updates are pushed one at a time and coalesced until the client acknowledges them, so quick successive changes are not lost behind a large update.
Metadata
Release files for vera-in-viewer 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vera_in_viewer-1.0.0.tar.gz | 273.7 kB | With provenance | Details for vera_in_viewer-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vera_in_viewer-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for vera_in_viewer-1.0.0-py3-none-any.whl |
Total release size: 548.8 kB
Release files / vera_in_viewer-1.0.0.tar.gz
| Download URL | vera_in_viewer-1.0.0.tar.gz |
|---|---|
| Size | 273.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e9f08b0466a5e81cc176f21e9057e5190b5e14ebc1e88e656c0c1de40106e6a
|
|
BLAKE2b-256 checksum How to use checksums |
e74eccd823af0b6abaee925f5a3aff5b0ab123a99b872425b4f7502164104c29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / vera_in_viewer-1.0.0-py3-none-any.whl
| Download URL | vera_in_viewer-1.0.0-py3-none-any.whl |
|---|---|
| Size | 275.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
877cb7dc887f35fcaf4734fe0433e9b17acecfe6b5640f7ee981cdd891b2b71e
|
|
BLAKE2b-256 checksum How to use checksums |
cae0a6b1c9e49f6ada508697702fc3c5c7eb4548cb8a902a280e8af73135b8ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for vera-in-viewer 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for vera_in_viewer-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.