Skip to main content

Material builder for Monte Carlo simulations

Project description

Materials for MC

Make materials for use in neutronics workflows.

🦀Rust back end for speed 🐍Python API for ease of use 🕸️WASM API for online deployment

General features:

  • Build Nuclides
    • Get microscopic cross sections
  • Build up Materials
    • Set densities
    • Add nuclides
    • Add elements
    • Get macroscopic cross sections
  • Set the nuclear data paths
    • Per nuclide, material or globally
    • Using local JSON files
    • On the fly downloading
    • Caches nuclides to avoid duplicate reading

Features speciffically for usage Monte Carlo Tranport

  • Get unified energy grid for material
  • Calculate MT reactions cross sections at specified energy
  • Calculate total macroscopic cross section
  • Calculate mean free path

User install

Install as a Python package if you want to use the package with your own Python code

pip install materials_for_mc

Install the Rust crate if you want to use the package with your own Rust code

cargo install materials_for_mc

Developer install

Depending on your usage you may need to Rust, Python

git clone git@github.com:fusion-neutronics/materials_for_mc.git
cd materials_for_mc

Example python usage

python3.11 -m venv .materials_for_mc_env

source .materials_for_mc_env/bin/activate

pip install maturin

maturin develop --features pyo3

python examples/use_in_python.py

Example rust usage

cargo build
cd example_use
cargo build
cargo run

WebAssembly Support

The package can be compiled to WebAssembly for use in web browsers:

to test the wasm bindings

wasm-pack test --headless --firefox
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack build --target web --features wasm
cp -r pkg examples/wasm/
# Serve the demo pages locally
python -m http.server 8000
# Open the demo pages in your browser, I use firefox here but others should also work.
firefox http://localhost:8000/examples/wasm/reaction_plotter.html

The WebAssembly demos include:

  • Material creation and manipulation
  • Cross section calculation and visualization
  • Predefined materials
  • Interactive plotting with Plotly

Testing

Tests are present for both the core Rust code and the Python wrapper

cargo test
pytest

WebAssembly (WASM) Testing

To run tests for the WASM bindings, you must enable the optional wasm-test feature and use a browser (e.g., Firefox):

cargo test --features wasm-test
wasm-pack test --headless --firefox --features wasm-test

This ensures that WASM-specific tests and dependencies are only included when needed.

Project details


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.

materials_for_mc-0.1.14-cp313-cp313-win_amd64.whl (374.7 kB view details)

Uploaded CPython 3.13Windows x86-64

materials_for_mc-0.1.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (539.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.14-cp313-cp313-macosx_11_0_arm64.whl (484.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

materials_for_mc-0.1.14-cp312-cp312-win_amd64.whl (374.7 kB view details)

Uploaded CPython 3.12Windows x86-64

materials_for_mc-0.1.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (539.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.14-cp312-cp312-macosx_11_0_arm64.whl (484.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

materials_for_mc-0.1.14-cp311-cp311-win_amd64.whl (373.6 kB view details)

Uploaded CPython 3.11Windows x86-64

materials_for_mc-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (537.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.14-cp311-cp311-macosx_11_0_arm64.whl (484.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

materials_for_mc-0.1.14-cp310-cp310-win_amd64.whl (373.6 kB view details)

Uploaded CPython 3.10Windows x86-64

materials_for_mc-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (537.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.14-cp310-cp310-macosx_11_0_arm64.whl (484.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

materials_for_mc-0.1.14-cp39-cp39-win_amd64.whl (373.9 kB view details)

Uploaded CPython 3.9Windows x86-64

materials_for_mc-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (538.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.14-cp39-cp39-macosx_11_0_arm64.whl (485.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file materials_for_mc-0.1.14-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 504557cc9c794d20ab5896d720595ed3aa795d92b4e567c08a723a0e8e66fd82
MD5 d5eb7ed49b562fc26ea65080c9500e8a
BLAKE2b-256 9a29f24f16efbc57abfe4044feaa82f0fc408140cb06ea4ee3fbd9139e2d8e01

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp313-cp313-win_amd64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f13f13c5c89cc054aea20c42c4bc88e1bbf74f9c1c6aae05d5aa37391fc3a75a
MD5 aabb14e63fb2e45f0cfcb165991f78d5
BLAKE2b-256 d78579461939638b6536d00ae547299e9ff221ff2bcb50bbd511af240859dd70

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adcdcb13555d7428a8baed9e8836e276623cb1dc4f0be22137640923816efdc8
MD5 6bab4f6317517b548b48354ead6d5ebb
BLAKE2b-256 73933dd2bcae76ce34de2da075baf606983e02a07be140f6c767a9397d87db5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 719cce4983f6b3a25cc1952a0c1cbb359df7c0858202748f7f7f99f5cb15fed4
MD5 a01e9e4f58cd640f78de6fcb0a8fe367
BLAKE2b-256 ebee49ebbfa30c341e3ba6c7b1077c1a61536f9c23ef797cfa355dc1b00ecfa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp312-cp312-win_amd64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a562f2d8d64e89dea8aa5e90ccf2597195ce4f7ce7e94680c826fea9c8ccce7f
MD5 6f243026312d10c1defbe4b5de46b423
BLAKE2b-256 0dcaceb0669b8dde84dce2309a1ff631929ed9a6eabde6fbcffbea205552d6fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 63d015389865223a2b6e65c23582e0523cb04f3c7d247fbc2bdf6a312853c7e1
MD5 0e1d58f2f5e271c35780714e058f3004
BLAKE2b-256 5bb545d4c09bdfab8f55727053b6d1bc9a20984ba4840299cb6bd16593704448

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3b1f519f42ad9100ccbb1964206bd44f8e00e98eb5315742734834e18c83e9f9
MD5 022e50817151426a0133153518d90813
BLAKE2b-256 b59ab09ff6df792832db79f0f35264786e188926c7008ba54b7f88bb71c2cc63

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp311-cp311-win_amd64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 580b98d46989ff43d9fc90e4293334bdcac96fc6ebfbf2a07cf6a96b580f70c7
MD5 92b880610a5ed5ef37a5c19352a996a3
BLAKE2b-256 023b9db12261932e789008b175696c7fb3b3b78fa5c38c1ba05d089e04a3ee6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2f1eea5d6fb432fa0ba4b69d2e3e4a6b54d42e474d0defe905a2a98d721fb81
MD5 612deeaeb8ac144ee85e50c2b76b1380
BLAKE2b-256 aa56b192cbc691a212b36f17b75fa24ea88db2899dbc5875a50b2e99154c8965

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9f7096df62957d9667dd9584ec3337fe28f0c9da1de8bf0090bdc09c9deaa5c6
MD5 9f6ad48c0e6f23a09b0207e34ff805e5
BLAKE2b-256 7123666b6126bedb5f4492b94896f3c64287d55971d1caa0a6c690eb115dbb0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp310-cp310-win_amd64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72769324bc450e90aea1e9f4add85a8185079085ae0e43cfef137d1376512c79
MD5 f5cf184d5bd759c7e71aca30303b8251
BLAKE2b-256 4558973ebcb06c42fd7bda2e74763c5e76789746ad6ce8aee76fca6c5484f1fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba3a3d437fb8a14e093786051a3b300c9ed82ea42269094aa8c8ca35bac6b383
MD5 de728adc812f41cff6597238f6961db8
BLAKE2b-256 ba25a1ac090042b571be2dae3e30507f28a16a92ff5e6e90462fe832fe3c8835

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e2f6998a1cdb2b2b556959b315c229a9cfdce808978d1731fe9a9393dc7f2c7c
MD5 85332d356914f7e3d6c28df28c21e088
BLAKE2b-256 4d3282f0614a84e96f72caa6e4dceb402e2cab7080c71ad059040a478f646b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp39-cp39-win_amd64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53fae8745c27428fbdcd8e58a8671ef2acdfb4e0d3501acd3ef33d4266d95d04
MD5 b154f1d86f406e6fc42b9466c8e7cd21
BLAKE2b-256 d8d9a1101d786b2a18e06129aa02baee2d91e25cd169cdbe0032dc8e48229acc

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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

File details

Details for the file materials_for_mc-0.1.14-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.14-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bec5b4ba26b5aa6c1ad657f8fdade01c809f9d99371afcd890565bef3faab741
MD5 58c50fb5b77269e66c09c8315152cfeb
BLAKE2b-256 1ad361fa2130529f30e0ced032667501d5e5fa8bc486e49463f7ec8b3b4b5445

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.14-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: ci-python.yml on fusion-neutronics/materials_for_mc

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