Skip to main content

aci_rssa

CI PyPI License: EUPL-1.2

Fast, streaming reader for MCNP RSSA (surface source) files, with a Rust core and a Polars-based Python API.

RSSA files record every particle that crosses a given surface during an MCNP (or D1S-UNED) simulation, and can easily reach tens or hundreds of gigabytes. aci_rssa memory-maps the file and decodes track records in parallel (via rayon), handing the result to Python as a Polars DataFrame — either all at once, or as a lazy, batch-at-a-time stream for files too large to fit in memory.

Installation

pip install aci_rssa

Prebuilt wheels are published for Linux, macOS, and Windows (x86_64/arm64) on CPython ≥3.10 — no Rust toolchain needed to install.

Quickstart

from aci_rssa import RSSA

rssa = RSSA.read_from_file("surface_source.w")
print(rssa)  # summary: surfaces, track/history counts, source code

rssa.tracks          # polars.DataFrame: history, particle_type, weight, energy,
                      # time, x, y, z, u, v, w, surface_id
rssa.neutron_tracks   # tracks filtered to neutrons
rssa.photon_tracks    # tracks filtered to everything else (typically photons)

Reading only the header (fast, never touches the potentially huge track data):

from aci_rssa import FileParameters

parameters = FileParameters.read_from_file("surface_source.w")
parameters.nrss       # number of tracks recorded
parameters.surfaces   # surfaces tracks were recorded on

Very large files

For files too large to load eagerly, scan_tracks returns a Polars LazyFrame backed by a Rust reader that decodes the file batch by batch, driven by Polars' query engine — filters and column selection are pushed down so you only decode what you need:

from aci_rssa import scan_tracks
import polars as pl

(
    scan_tracks("surface_source.w")
    .filter(pl.col("energy") > 1.0)
    .select("x", "y", "z", "energy")
    .collect(engine="streaming")
)

Plotting

rssa.plot_cyl(axis="z").show()      # particle density on a cylindrical surface
rssa.plot_plane(x="x", y="y").show()  # particle density on a planar surface
rssa.plot_spectra().show()            # energy spectrum

Development

This is a Cargo workspace (rssa-core, the pure-Rust parsing/decoding library, and rssa-python, its PyO3 bindings) plus a Python package in python/, built together with maturin.

python -m venv .venv && source .venv/bin/activate
pip install "maturin>=1.9.4,<2.0"
maturin develop --extras test,dev   # builds the extension module, installs test/dev deps

cargo test                          # Rust tests (rssa-core)
pytest                              # Python tests
ty check python/aci_rssa            # type checking

License

Licensed under the European Union Public Licence v1.2 (EUPL-1.2).

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

aci_rssa-0.0.5-cp310-abi3-win_arm64.whl (4.5 MB view details)

Uploaded CPython 3.10+Windows ARM64

aci_rssa-0.0.5-cp310-abi3-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view details)

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

aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

aci_rssa-0.0.5-cp310-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

aci_rssa-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file aci_rssa-0.0.5-cp310-abi3-win_arm64.whl.

File metadata

  • Download URL: aci_rssa-0.0.5-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.10+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for aci_rssa-0.0.5-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 8e4c7bbf6d77bd9c35044ea53aaee852520dd94d99719eca805e4e0837a37881
MD5 90915e21a67a871f2731a27b12cd1a13
BLAKE2b-256 a696cb75305a52825e796ff605cf33ab84a9237dd7fbe13c25f264694e8358d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aci_rssa-0.0.5-cp310-abi3-win_arm64.whl:

Publisher: release.yml on AlvaroCubi/aci_rssa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aci_rssa-0.0.5-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: aci_rssa-0.0.5-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for aci_rssa-0.0.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4eb382eb86963fc79dc0774c09b96584b0830424395ffe6e952f279a88a69dd1
MD5 ba3d4e881443457a9122a92d3ad4c5b6
BLAKE2b-256 a87ead3baa46e3a20b02285d031f2c5e0fb4fbb2e411f0341ba53d309566779f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aci_rssa-0.0.5-cp310-abi3-win_amd64.whl:

Publisher: release.yml on AlvaroCubi/aci_rssa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e0fa607e21d841fd7f581c4157907327f648946227d9e1093f84b3ec654a160
MD5 87c7ec557484c6ef359bf763ed5cf059
BLAKE2b-256 f44d75edfcd496dd19d5a0f4a892d7ae829afca2137b03ebd5bf0e46a0245471

See more details on using hashes here.

Provenance

The following attestation bundles were made for aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on AlvaroCubi/aci_rssa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 087a1d1863be13c4f996c60b3a7c628c03a905e6541680ceec97288b8123109b
MD5 7ba3da00f93c336f8e26b05cca02639e
BLAKE2b-256 a7e3f3b8eb4eb2ab809e8bdda2e45997af0cce4e472d68a44d2d07740cb8f922

See more details on using hashes here.

Provenance

The following attestation bundles were made for aci_rssa-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on AlvaroCubi/aci_rssa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aci_rssa-0.0.5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aci_rssa-0.0.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce8295e660e5b683f271ca1dc17771ac20148eb778e1453b9eafe8d1594db6fe
MD5 bfa746bbd1d485145f144c999adb10f5
BLAKE2b-256 11dbd42c6924ef0792095dc480efb14ca45506e32a4c99525dceeb48fe82c4ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for aci_rssa-0.0.5-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on AlvaroCubi/aci_rssa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aci_rssa-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aci_rssa-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7a0ee3cdc7879f09cfa972cef9d7f869fe079b1cc3ec0f442a642bbde9df7014
MD5 e080d6ee787ed87a5da7bf34501fb60a
BLAKE2b-256 20f12ed12b00959410134af5deeebd330f80087c4d89c632c7a16bfc9b182d40

See more details on using hashes here.

Provenance

The following attestation bundles were made for aci_rssa-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on AlvaroCubi/aci_rssa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page