Skip to main content

llevant

Fast, exact geometry queries on MCNP models, from Python or the command line. llevant answers:

  • where points are, and what lines cross;
  • slices and 3D views;
  • volumes, and the gaps and overlaps of a model;
  • fingerprints that tell two versions of a model apart.

It reads the MCNP input and handles every universe level, lattice and transform. It is checked point by point against MCNP 6.2. The Python module is built on the Rust engine of the same name: models are compiled once (and cached on disk), then queried in numpy batches.

The viewer: a reactor core cut open in 3D, beside an exact slice through its fuel pins

Install

pip install llevant              # numpy comes with it; add polars or pandas for data frames

One abi3 wheel serves Python 3.9 and later, on Windows and Linux (x86-64; no macOS yet). It includes the GPU renderer and the interactive viewer.

Use

import llevant

m = llevant.load("model.mcnp")          # compiled once (cached on disk), then queried as often as needed
m.locate(0, 0, 0)                       # <Label inside 12 > 304[1,-2,0] > 7>: .cell, .material, .path...
r = m.classify(points)                  # (N, 3) array -> numpy columns: r.ids, r.cell, r.material, r.status
tr = m.trace_lines(starts, ends)        # ragged: tr.offsets, tr.t0, tr.t1, tr.ids, tr.surface_in...
m.slice(z=37, colour="material")        # an Image: shown inline in Jupyter, .save("s.png")
m.render(direction=(1, 1, -0.5), hide=[12], gpu=True)
m.volumes(h=2).by("material")           # volumes with an honest uncertainty
m.check(h=2)                            # gaps and overlaps
f = llevant.Field.read(m, "run.msht", tally=14)   # meshtal, MCTAL, D1SUNED cuvmsh, CSV per cell
m.slice(z=37, field=f)                  # results over the geometry

The package also has the llevant command and the viewer:

python -m llevant slice model.mcnp --plane z=37 --colour material -o slice.png
python -m llevant render model.mcnp --gpu -o view.png
python -m llevant view model.mcnp

Documentation

https://fusion4energy.github.io/llevant/:

Licence: EUPL-1.2.

Metadata

Release files for llevant 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llevant 0.1.3
File Size Uploaded Provenance Actions
llevant-0.1.3.tar.gz 1.7 MB With provenance Details for llevant-0.1.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for llevant 0.1.3
File Interpreter ABI Platform Actions
llevant-0.1.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for llevant-0.1.3-cp39-abi3-win_amd64.whl
llevant-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for llevant-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl

Total release size: 33.9 MB

Release files / llevant-0.1.3.tar.gz

Download URL llevant-0.1.3.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
233e8cbf581281b66ce6ed99c352a6d1dcd5278375dc6eb866601dbdf713fdb2
BLAKE2b-256 checksum
How to use checksums
f714114dd89db6a01e20a3faaf29a544e9db6149f8734bdbadb43609ad31df32
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 17, 2026.

Transparency log

Release files / llevant-0.1.3-cp39-abi3-win_amd64.whl

Download URL llevant-0.1.3-cp39-abi3-win_amd64.whl
Size 20.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
054420a12c33df1c8d576caff05ad8c6663353f8f9d3e28e02baa9f13ec71255
BLAKE2b-256 checksum
How to use checksums
dd65c48ca20826e0ae33386aa738e2d9b39482fb922fa6dcb8af66b2d144c775
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 17, 2026.

Transparency log

Release files / llevant-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL llevant-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl
Size 12.1 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
2285fdf80ee3308f573a953ca017566ffa27fdd125add2303b02df971dcf8ab2
BLAKE2b-256 checksum
How to use checksums
e5e1d6351e1b5ed40d4906d7a280bcd27cf9e49d5a7625b512b458594f757383
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 17, 2026.

Transparency log

Security for llevant 0.1.3

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

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for llevant-0.1.3.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 17, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page