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

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.2
File Size Uploaded Provenance Actions
llevant-0.1.2.tar.gz 1.7 MB With provenance Details for llevant-0.1.2.tar.gz

Built distributions (wheels)

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

Total release size: 33.9 MB

Release files / llevant-0.1.2.tar.gz

Download URL llevant-0.1.2.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
778aefb473959a09686a7ef659b576ab0a2b4bed5b81c023026e90e47729dcbc
BLAKE2b-256 checksum
How to use checksums
91bd87885fec9a94f8e35f4f4cbc45cd96dd4718a43c9a87f255873eb3ce7a66
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 16, 2026.

Transparency log

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

Download URL llevant-0.1.2-cp39-abi3-win_amd64.whl
Size 20.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f82f16f6cedc6dba18cccc99d79811577b3141b82b821dd2bcaec3e5b06e01d6
BLAKE2b-256 checksum
How to use checksums
cbb74b3162333cc3b1eeaa8e4feea11cddc9a04ce57e11c5d9e51db10da1fda6
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 16, 2026.

Transparency log

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

Download URL llevant-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl
Size 12.0 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
0d3fece678ca8f89414c8b3ec0a284bbd14da42ac314feb7b9d145b7de23e12b
BLAKE2b-256 checksum
How to use checksums
aadcc5b0f52fc50ee09384c45f27de28fb92d56c0372a5ab2f5cd908c9f9f802
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 16, 2026.

Transparency log

Security for llevant 0.1.2

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.2.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 16, 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