Skip to main content

Nucleide

Nucleide is a modern Rust toolkit for nuclear-engineering workflow glue: legacy transport-code I/O, nuclide identification, materials, CRAM depletion, and enrichment analytics — exposed through a typed Python API.

The project is a fresh Rust implementation of capabilities pioneered by PyNE, focused on memory safety, fast builds, and pip install-able wheels. Scope is intentionally narrow today and will expand as more parsers and workflow pieces land.

Installation

pip install nucleide

Prebuilt wheels cover Linux, macOS, and Windows for Python >= 3.10 (abi3). To build from source instead, see the Development section below.

Why

Nuclear-engineering workflows spend most of their time moving data between codes rather than solving transport itself. The established tooling for that glue layer carries a heavy build chain (CMake + Fortran + Cython) and hand-written parsers that are hard to extend and harder to embed. Nucleide rebuilds the high-value subset in memory-safe Rust with one-command pip install wheels, keeping Python as the user-facing API.

Features

Area Capabilities
Nuclide core (nuclei) Canonical nucid representation, particle registry, reaction-name registry (labels, MT mapping, hashes), name-dialect conversions (ZZAAAMM, ZAID/MCNP, Serpent, FLUKA, NIST, CINDER, ALARA, SZA), AME2020 masses, natural abundances, half-lives
Materials (material) Compositions, mixing arithmetic, unit conversions, DOE/PNNL Materials Compendium loading, materials XML export
MCNP I/O (mcnp-io) xsdir, meshtal, SSW/SURFSRC, PTRAC, WWINP, MCTAL readers; material extraction from input decks; mesh-to-geometry deck generation
Serpent I/O (serpent-io) _res.m, _dep.m, _det.m readers producing structured records
FLUKA I/O (fluka-io) USRBIN tally reader, material/compound card generation
ALARA I/O (alara-io) Deck/flux/matlib-elelib-WDR/output/photon/schedule-expansion glue; solver out of scope
Depletion (depletion) CRAM (orders 16/48) matrix exponential, depletion-chain XML parsing
Enrichment (enrichment) Multicomponent cascade solver (numeric), SWU closed-form helpers
Variance reduction (vr-tools) MAGIC weight-window generation, mesh source sampling with alias tables
CCCC I/O (cccc-io) ISOTXS/RTFLUX text-subset parsers + PARTISN deck writer (no solver)
FISPACT I/O (fispact-io) FISPACT-II inventory output parser reusing the ALARA response frame (output-only)
ORIGEN I/O (origen-io) Scoped ORIGEN 2.2 TAPE5 input-echo, TAPE6 inventory, and TAPE9 decay readers
R2S (r2s) Scoped R2S workflow builder: zone-to-flux linking, schedule expansion, uniform-split photon assembly
Python bindings PyO3 extension module behind a typed pure-Python facade (nucleide._internal, .pyi stubs, py.typed)

Out of scope

Transport solvers, Fortran discrete-ordinates ports, ENSDF evaluators, MOAB-dependent meshing, and GUIs. Nucleide complements transport codes; it does not replace them.

Layout

nucleide/
├── crates/
│   ├── nuclei/        # nuclide ids, naming conventions, physical data
│   ├── material/      # compositions, mixing, libraries, XML export
│   ├── mcnp-io/       # xsdir/meshtal/SSW/MCTAL/PTRAC/WWINP
│   ├── serpent-io/    # res/dep/det readers
│   ├── fluka-io/      # usrbin reader, material cards
│   ├── alara-io/      # ALARA deck/flux/libs/output/photon/schedule glue (no solver)
│   ├── cccc-io/       # ISOTXS/RTFLUX text-subset parsers + PARTISN writer (no solver)
│   ├── fispact-io/    # FISPACT-II inventory output parser (output-only)
│   ├── origen-io/     # scoped ORIGEN TAPE5/6/9 readers
│   ├── r2s/           # scoped R2S workflow builder (uniform-split photon approximation)
│   ├── vr-tools/      # MAGIC weight windows, source sampling
│   ├── enrichment/    # cascades, SWU
│   ├── depletion/     # CRAM + chain files
│   └── linalg/        # isolation facade over the linear-algebra backend
├── bindings/python/   # PyO3 crate -> nucleide._internal
├── python/nucleide/   # typed pure-Python facade (maturin mixed layout)
├── fixtures/          # golden-byte test data
├── validation/        # cross-code validation harness vs PyNE/OpenMC
└── tests/             # Python-side tests

Development

git clone https://github.com/nukehub-dev/nucleide.git
cd nucleide

# Rust side
cargo test                       # workspace unit tests
cargo clippy --all-targets -- -D warnings

# Python side (needs: rustup, pip install maturin)
pip install maturin pytest pytest-cov ruff mypy
maturin develop                  # build + install into current venv
pytest tests/

# Lint / type-check / format the Python surface
ruff format python tests
ruff check python tests
mypy                             # strict type-check against .pyi stubs

# Rust coverage (needs llvm-tools-preview component)
cargo llvm-cov --workspace       # or --lcov for CI upload

Tooling

Layer Format Lint Types Coverage
Rust rustfmt (cargo fmt) clippy -D warnings — cargo-llvm-cov (CI)
Python ruff format ruff check mypy --strict via .pyi stubs pytest-cov

Wheels are built with maturin (PyO3 mixed layout). One wheel serves all Python >= 3.10 via abi3 — the same stack used by pydantic-core, polars, and ruff.

Validation strategy

  1. Parsers are validated against golden-byte fixtures in fixtures/; parser output must match recorded snapshots before any release.
  2. Numeric kernels (CRAM, cascade solving) are checked against published analytic vectors and cross-code results on shared inputs; the runnable cross-code harness in validation/ compares Nucleide against PyNE and OpenMC and commits its measured results.
  3. Behavioral compatibility with legacy tool output is asserted wherever a fixture exists, so downstream workflows see identical data.

Criterion benchmarks (cargo bench) cover the numeric kernels and parsers.

Citing

If you use Nucleide in research, see CITATION.cff and the JOSS paper draft in paper.md.

Status

Pre-alpha. APIs may change without notice.

Documentation

Additional tutorials, reference pages, and developer guides live in the docs/ tree.

Acknowledgments

Nucleide is a fresh Rust implementation of workflow-glue capabilities pioneered by PyNE ("Python for Nuclear Engineering", BSD-3-Clause). Some reference data and golden test fixtures — notably the DOE/PNNL Materials Compendium — are vendored directly from PyNE; see fixtures/data/MaterialsCompendium.LICENSE for its terms.

License

BSD-2-Clause.

Metadata

Release files for nucleide 0.2.0

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

Source distribution (sdist)

Source distribution for nucleide 0.2.0
File Size Uploaded
nucleide-0.2.0.tar.gz 350.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nucleide 0.2.0
File Interpreter ABI Platform
nucleide-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
nucleide-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
nucleide-0.2.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 3.9 MB

Release files / nucleide-0.2.0.tar.gz

Download URL nucleide-0.2.0.tar.gz
Size 350.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aa51751d98c2a05aea04a35049a976135184edc63ebc263bf7d5aefb40b654a6
BLAKE2b-256 checksum
How to use checksums
5ce3240bb7f178da223b5f2930df9dde8092f04ee7c4d702924a2b2d971d36f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / nucleide-0.2.0-cp310-abi3-win_amd64.whl

Download URL nucleide-0.2.0-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0137126d1a8acf37ae3b6b045231fe15b3a9bc0be547b7561cb3135e1be0beda
BLAKE2b-256 checksum
How to use checksums
89a06c3941e04346d8b05cbe358f4345b292b481209ecd911f6fa2b7c00165ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / nucleide-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nucleide-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
638e8a5ff69df1b62d2ae4a0e88c4ab65aeeb64ba95e29422a9d1b3debbaa12e
BLAKE2b-256 checksum
How to use checksums
0950edd3d9ba457deee7341865ad84fa570ceaa29511d2c44c61b5e7ef707462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / nucleide-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL nucleide-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
610d8d2f4bdd467d1413204d5bde6b080c1ae51aedce9952b586251863cbfdfd
BLAKE2b-256 checksum
How to use checksums
1b4a30d7e3963a3f89dffab2528769348b60aca10bb849966ec78fc5ac9074c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release history Release notifications | RSS feed

0.16.0

4 release files

0.15.0

4 release files

0.14.0

4 release files

0.13.0

4 release files

0.12.0

4 release files

0.11.0

4 release files

0.10.0

4 release files

0.9.0

4 release files

0.8.0

4 release files

0.7.0

4 release files

0.6.0

4 release files

0.5.0

4 release files

0.4.0

4 release files

0.3.0

4 release files

This release

0.2.0 This release

4 release files

0.1.0

4 release files

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