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
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
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
│   ├── 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nucleide-0.1.0.tar.gz (278.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nucleide-0.1.0-cp310-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

nucleide-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

nucleide-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (948.5 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file nucleide-0.1.0.tar.gz.

File metadata

  • Download URL: nucleide-0.1.0.tar.gz
  • Upload date:
  • Size: 278.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.15.0

File hashes

Hashes for nucleide-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6025a3ca0d85e526269d9b87ba25c263b10d639159fa43ffb559477712d2adf
MD5 1f191252678376430741c29491b5ab70
BLAKE2b-256 057d0722cddc815066cb8f3899ce46a9366d6f80b3fd77c12ad1953b474631b5

See more details on using hashes here.

File details

Details for the file nucleide-0.1.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: nucleide-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.15.0

File hashes

Hashes for nucleide-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 da826a3c128f1acf32d8a9debff0662b65b5fbcd9b44ae00f3374fb99491726b
MD5 42cbe57088cc2e501837e6599b8f0438
BLAKE2b-256 2fdd00fdd8084caf43df91f2a797cc5a0d795eced3fcd7140bb9c42ee170ad38

See more details on using hashes here.

File details

Details for the file nucleide-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nucleide-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd19339ecb7c1c75f3079b5b76b1b7b58148cc65fed38e953743a809be5368cc
MD5 b444d28f1b8804aba9b2e6332b14ecd8
BLAKE2b-256 597629b9d6b80b2549a6092a13c7a78d9c43b96b778aacf87a8352703e818427

See more details on using hashes here.

File details

Details for the file nucleide-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nucleide-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c499349dbba8b8235cf6f59f17df0f9970d8355e1313c3431065549eab2281e8
MD5 22ec16091d8f2a3e0485b7e66ed0d88d
BLAKE2b-256 d3cedac510bbd82063bb9ee8b7f6e06ac98fcfad2b05809e677ac352daba89b6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 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