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.8-cp313-cp313-win_amd64.whl (374.9 kB view details)

Uploaded CPython 3.13Windows x86-64

materials_for_mc-0.1.8-cp313-cp313-macosx_11_0_arm64.whl (484.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

materials_for_mc-0.1.8-cp312-cp312-win_amd64.whl (374.9 kB view details)

Uploaded CPython 3.12Windows x86-64

materials_for_mc-0.1.8-cp312-cp312-macosx_11_0_arm64.whl (484.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

materials_for_mc-0.1.8-cp39-cp39-win_amd64.whl (373.8 kB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

materials_for_mc-0.1.8-cp38-cp38-win_amd64.whl (373.8 kB view details)

Uploaded CPython 3.8Windows x86-64

materials_for_mc-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (537.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.8-cp38-cp38-macosx_11_0_arm64.whl (483.8 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 482b5dba1045085ceef10d4043606f91f1d9c56a064a19283f1cb844af0b11a1
MD5 b5466509aa510babe4aab0244c7c36fc
BLAKE2b-256 73af4d39c1dd4b2e4344eb87547412ecd0aff0dd28c51a569bae2983b3806f8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2e73a963bb6d1b78009146a1e331ca06fab392d4f8936a66b71850c28d204dc1
MD5 b9c899071050339936d9c92af35e5b44
BLAKE2b-256 eb8a02e85ef8c39a59a4ca38b503d9fea2f6c8f0573a85078deefa1b7a702ed2

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 85b7bdf18d517cc295aed1b172681a576fdfb903ade5e8928602c06ff505093b
MD5 52cc676254eeca762a800f1193c2b245
BLAKE2b-256 f9f3e2a93894213a4de05eb6ec3a810af613740388923da3d93ab334bdd1aaad

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e0138687e72e6132331daeff619a26b949b8a8b3eda0174fecd50a08e33063d
MD5 41212962fca531b9736c5908e4d45a89
BLAKE2b-256 fb1fea4b998f075038e4c7a8644dd3fc0c7db362fa9a513f42185289a92e291d

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0f26a9d3fd782abd25fc27807ef70ff8a3860dcbd4e482e9f2d7cec3c880d3d6
MD5 e14c5a32fc1452bdbbb61b215bfe724e
BLAKE2b-256 7c2e5590fe9628c961b977ba7060f819441cb9cb4da6601c8ab7a4045dccb5cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1852fcc7211c9084018b236df361205519b0a9d6cc5acd450eb460117c5ff52d
MD5 34e46abfc22117abd71462cc1deaeaef
BLAKE2b-256 cd7e72b967f053c66245d78c6aa3b12b45401c5ce0a598a5e28c1b1618632dfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4425679f53b36782b56315423556416da8d3fdf3a135f419e0f80cc5779195a9
MD5 0a64bbb990ae18b7c921dd12738d40e5
BLAKE2b-256 00ee8ee7a969d12338984b52384518a93a169dbdfd7b61f1dc3f256ebcbb9d47

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05e39a535214affffc859357d3f7d97ce95b1a87e358b5e6ae0f9c1d9b8b8ac8
MD5 b7deb1bd090261fb628230f4475abea8
BLAKE2b-256 a1bd5b4b347b6f56ecabfd2052658fcbc291119a79ba3cafcc78e57bcaf1236c

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9ec389aa8d0b15b81dd6d431a6d5b9b9a25379e5bb8e0749357c442008c28a38
MD5 a2f286424ad94d34791f6ea9ecd75ad8
BLAKE2b-256 8d7b10c334a072b9e04486964b8560515be62a09ded45df9a24e85eb97cf87fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.8-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42f6a98469efc788a465212c5035f4f132cf72d7f211ec71a2e2732fbaa296e8
MD5 7dece234c9a189cf7f7e720ea5782573
BLAKE2b-256 e0018a8a4881b2daa1369ae0dafd163fe57c60b3ec5a2a8c667355d2b1d36fb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-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.

File details

Details for the file materials_for_mc-0.1.8-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6cabda73c53707e0530a37fd0daa76db9566726c84929310b5f11313202913b3
MD5 c5843d804b9c798192d22c943f77afc3
BLAKE2b-256 aada5dd340725978895f18787f76366453e3d661d31f24f73b62b1012bfe052a

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-cp38-cp38-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.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a120c54dee047f987194a859743d9cd2f7e3178f885c5539064b87fbb78911e
MD5 16ddddba8d813ae611edcf1df6914061
BLAKE2b-256 75219dfb3e71598eded485be1e3077cea450355ee73a66bcc66e1e44f6ea1241

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-cp38-cp38-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.8-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.8-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aacd890e083595b397e52ec3d812f69a4092486665f6e0beb222529617cf718b
MD5 a309ea236141a7e8afaa1fda652ef539
BLAKE2b-256 848e93fee1da39fc0759e8e3217bbf5d5dd78c244e27cc2ca5af9aab0c5f5d54

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.8-cp38-cp38-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