Nucleide

Python API

Nucleide exposes a typed pure-Python package at python/nucleide/ that re-exports a compiled PyO3 extension built from bindings/python/. The extension module is named nucleide._internal; users import from the nucleide domain submodules, which mirror the Rust workspace crates.

Module layout

import nucleide as nuc

The top level carries version(), nucleide.__version__, and the domain submodules below (so nuc.nuclei.Nuclide(...) works directly). Each submodule re-exports its symbols from nucleide._internal. If you are looking for a task-oriented entry point rather than the full module map, jump to Common workflows below:

Common workflows

The module sections below list every symbol; these are the shortest paths into the most common tasks. Snippets use the same from nucleide.<domain> import ... idiom as the tutorials, which cover each workflow in depth.

Parse a legacy output file

from nucleide.mcnp import read_meshtal
from nucleide.serpent import read_serpent

tallies = read_meshtal("path/to/meshtal").tallies
res = read_serpent("path/to/filename_res.m", "res")

Tutorials: Parse MCNP output, Parse Serpent output, Parse FLUKA output.

Build a material

from nucleide.data import fetch_compendium
from nucleide.material import MaterialsCompendium, from_formula

comp = from_formula("UO2")
lib = MaterialsCompendium.load(fetch_compendium())

Tutorial: Build materials.

Run depletion

from nucleide.depletion import deplete, read_chain

chain = read_chain("path/to/chain.xml")
out = deplete(chain, {"U235": 1.0, "U238": 20.0}, dt=1e6)

Tutorial: Run depletion.

Solve an enrichment cascade

from nucleide.enrichment import Cascade

cascade = Cascade.default_uranium()
cascade.solve()

Tutorial: Enrichment cascade.

Run a kinetics transient

from nucleide.kinetics import solve

betas = [0.00021, 0.00141, 0.00127, 0.00255, 0.00074, 0.00032]
lambdas = [0.01, 0.03, 0.1, 0.3, 1.0, 3.0]
out = solve(betas, lambdas, Lambda=1e-5,
            rho={"kind": "step", "t_step": 1.0, "rho_init": 0.0, "rho_final": 0.002},
            t=[0.5, 1.0, 2.0], n0=1.0)

Tutorial: Run kinetics.

nucleide.nuclei

Backing crate: nucleide-nuclei · source dir

nucleide.material

Backing crate: pure Python · source file

nucleide.mcnp

Backing crate: nucleide-mcnp-io · source dir

nucleide.mcpl

Backing crate: nucleide-mcpl-io · source dir

nucleide.serpent

Backing crate: nucleide-serpent-io · source dir

nucleide.fluka

Backing crate: nucleide-fluka-io · source dir

nucleide.vr

Backing crate: nucleide-vr-tools · source dir

  • magic(tally: MeshTally, per_group: bool = False, tolerance: float = 0.5) -> MagicOutput

  • magic_with:

    magic_with(tally: MeshTally, selection: str = 'total', tolerance: float = 0.5, null_value: float = 0.0) -> MagicOutput
  • MagicOutput — MAGIC weight-window generation output.

    • lower_bounds_ww: list[float] (property)
    • groups_per_ve: int (property)
    • scale_factors: list[float] (property)
    • e_upper_bounds: list[float] (property)
    • ww_tag_name: str (property)
  • emit_openmc_weight_windows:

    emit_openmc_weight_windows(tally: MeshTally, output: MagicOutput, mesh_id: int = 1, window_id: int = 1, upper_bound_ratio: float = 5.0, survival_ratio: float = 3.0, max_split: int = 10, weight_cutoff: float = 1e-38) -> dict[str, Any]
  • emit_serpent_wwin:

    emit_serpent_wwin(tally: MeshTally, output: MagicOutput, name: str = 'ww1', file: str = 'wwindows.wwd') -> dict[str, Any]
  • AliasTable — Walker alias table for discrete sampling.

    • __init__(pdf: list[float]) -> None
    • sample(r1: float, r2: float) -> int
    • pdf: list[float] (property)
    • __len__() -> int
  • MeshSourceSampler — Mesh source sampler over a meshtal tally (analog/uniform/user).

    • __init__(tally: MeshTally, mode: str, user_pdf: list[float] | None = None) -> None
    • sample(r1: float, r2: float) -> dict[str, float]
    • mode() -> str
    • num_voxels() -> int
    • table_len() -> int
  • KdeSampler — Gaussian KDE sampler over caller particle vectors.

    • __init__(samples: list[list[float]], bandwidth: str | list[float] = ...) -> None
    • pdf(point: list[float]) -> float
    • draw(u: float, normals: list[float]) -> list[float]
    • bandwidths() -> list[float]
    • n_samples() -> int

nucleide.enrichment

Backing crate: nucleide-enrichment · source dir

nucleide.depletion

Backing crate: nucleide-depletion · source dir

nucleide.kinetics

Backing crate: nucleide-kinetics · source dir

nucleide.tritium

Backing crate: nucleide-tritium · source dir

nucleide.plasma_source

Backing crate: nucleide-plasma-source · source dir

nucleide.damage

Damage and gas-production metrics by spectral folding: NRT-dpa (Norgett–Robinson–Torrens 1975) and arc-dpa (Nordlund et al. 2018) displacement functions, He/H production in appm, and He/dpa ratios — the folds take caller-supplied group fluxes and response cross sections (piecewise-constant per group), and fold_uq propagates caller-block uncertainties through the seeded MVN machinery. Coil fast-fluence and lifetime bookkeeping (coil_fast_flux/coil_fast_fluence/coil_accumulate/coil_lifetime/ coil_remaining) accumulates caller spectra against caller-supplied limit tables.

Backing crate: nucleide-damage · source dir

nucleide.blanket

Backing crate: nucleide-blanket · source dir

nucleide.equilib

Backing crate: nucleide-equilib-io · source dir

nucleide.spectroscopy

Backing crate: nucleide-spectroscopy · source dir

nucleide.unfold

Backing crate: nucleide-unfold · source dir

  • sandii:

    sandii(response: list[list[float]], rates: list[float], guess: list[float], &#42;, tolerance: float = 0.001, max_iterations: int = 200) -> dict[str, Any]
  • staysl:

    staysl(response: list[list[float]], rates: list[float], sigmas: list[float], guess: list[float], &#42;, tolerance: float = 0.001, max_iterations: int = 200, damping: float = 0.001) -> dict[str, Any]
  • gravel:

    gravel(response: list[list[float]], rates: list[float], sigmas: list[float], guess: list[float], &#42;, tolerance: float = 0.001, max_iterations: int = 200) -> dict[str, Any]
  • maxed:

    maxed(response: list[list[float]], rates: list[float], sigmas: list[float], guess: list[float], &#42;, target_chi2: float | None = None, tolerance: float = 0.001, max_iterations: int = 200) -> dict[str, Any]
  • forward_fold(response: list[list[float]], spectrum: list[float]) -> list[float]

nucleide.alara

Backing crate: nucleide-alara-io · source dir

nucleide.cccc

Backing crate: nucleide-cccc-io · source dir

nucleide.fispact

Backing crate: nucleide-fispact-io · source dir

nucleide.origen

Backing crate: nucleide-origen-io · source dir

nucleide.r2s

Backing crate: nucleide-r2s · source dir

nucleide.emit

Backing crate: nucleide-emit · source dir

  • emit_armi_cards:

    emit_armi_cards(comp: dict[str, float], name: str, density: float | None = None, mcnp_number: int = 1, xs_suffix: str = '80c', serpent_lib: str = '03c', fluka_fid: int = 1, partisn_zone: int = 1) -> dict[str, str]
  • emit_armi_drift_table:

    emit_armi_drift_table(comp: dict[str, float], name: str, density: float | None = None, mcnp_number: int = 1, xs_suffix: str = '80c', serpent_lib: str = '03c', fluka_fid: int = 1, partisn_zone: int = 1) -> list[dict[str, Any]]
  • emit_cards:

    emit_cards(comp: dict[str, float], name: str, density: float | None = None, mcnp_number: int = 1, xs_suffix: str = '80c', serpent_lib: str = '03c', fluka_fid: int = 1, partisn_zone: int = 1) -> dict[str, str]
  • emit_drift_table:

    emit_drift_table(comp: dict[str, float], name: str, density: float | None = None, mcnp_number: int = 1, xs_suffix: str = '80c', serpent_lib: str = '03c', fluka_fid: int = 1, partisn_zone: int = 1) -> list[dict[str, Any]]

nucleide.uq

Backing crate: nucleide-linalg · source dir

nucleide.data

Pure-Python helpers (no backing crate) for downloading repo data files that the wheel does not bundle, pinned to the installed release:

Backing crate: pure Python · source file

nucleide.openmc

Pure-Python OpenMC statepoint tally bridge (no backing crate): caller-side OpenMC reads the statepoint, Nucleide takes plain arrays.

Backing crate: pure Python · source file

Version

  • version() → workspace version string
  • nucleide.__version__ — same value

The signatures above are generated from python/nucleide/_internal.pyi (the function source of truth) and the python/nucleide/*.py facades; see those files for the authoritative definitions.