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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

materials_for_mc-0.1.9-cp311-cp311-macosx_11_0_arm64.whl (484.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

materials_for_mc-0.1.9-cp310-cp310-macosx_11_0_arm64.whl (484.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

materials_for_mc-0.1.9-cp39-cp39-macosx_11_0_arm64.whl (485.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.8Windows x86-64

materials_for_mc-0.1.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (537.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

materials_for_mc-0.1.9-cp38-cp38-macosx_11_0_arm64.whl (483.9 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 548fb415d9b206239f813a167fa72b88f4a5d6f4bf3b23fbb0391a0ab2962943
MD5 db29314831e31e808df2bd1d621ca542
BLAKE2b-256 7776d00112dc7faf250ca36fa56fd3537e2bda15bdcef0427aa6d3f758df038c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5fe30d5eb5137ccad295d236b99cb7135ed8602fb0e681eeacfbcaa0c2607800
MD5 a62c3f3fff410575ee014f1a1953f385
BLAKE2b-256 559f8979b6b1d6b2960f32e9ee23dd60504090783c01a562d3a62c2a9e0e9f7e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0343765e77bba062b7e6218aad2cf77a6e68533cc8732f9af7d4b1624ced4e12
MD5 b9499763d54a316e8c11f08765cb1b80
BLAKE2b-256 7c6ebe7cacb86cfe24c9963397366c33bcf51e0d95c199092b3b8fd8f0e94304

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b61e6233abba32cbce62980d7ad3b38b690ab5dca84bb7fc1fed85ec6df4801e
MD5 65d69d4d7f7061b19500adb99e3d4e93
BLAKE2b-256 6458ed8ca412f4d0419d716bbc546cb46ba5ca68263ef9657c25eedd6a56035e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b28a8bb1325f0333b8d7cb93e734f6ff6069696fb59342cea7d7a368287f0d19
MD5 f77c5289920742caf5d3756fc4d0ef7d
BLAKE2b-256 6de9984f9b59111cab488b16f93b8da476fc9ec785d7711a0e95f905431a2939

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 703bcc978903b1dc35c9314b1ad064cb2100d060600129d46f350de87bbdc534
MD5 6f372cb93ae5cde1976e3fe426155451
BLAKE2b-256 d6080579429000f74de270905e309b0e7da4fbf44ec48d05b9cdeae135a15dda

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3a030d3bcf307bfb5572db7c34edc75367e4e3f0bae9b4d4d985db06820ffe93
MD5 d3a6fdb748eb8726d064064e0d8261fe
BLAKE2b-256 a9a1be9bd013f4bcfc682f9443453c5611cc55e1d5ce4ab600d03157ceb0e2ac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eea4b9f1168467411ac7d006932eb304cb752be055dbb9f296b61e5c8c74db92
MD5 e151d90bfbfbb02701ece122989e60fd
BLAKE2b-256 06bfb0f73518acd9ae8bd1313ac64f058ec9439c1b81dfaacc8e6527b61d14ab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4ec0fe72861715151b3a5efcb3ba53a8d40d621dbb632c1871acb7a2612d2b74
MD5 bd6d6b97ecf0327c7995f30709509b73
BLAKE2b-256 21ce710749ace98810c108950a3f3b2cbce9845fef49a0fbff768431a4d57827

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31b40a81fd6172a2a4f1e8b39e4bafc7990253311f5d731e4e7057f4c785ab3d
MD5 693a1239c12b60d55dad307b24dcf37c
BLAKE2b-256 df6a194c1aae00ccfda8f2e7a97449a97a157eab1923fd0d13c364955696abad

See more details on using hashes here.

Provenance

The following attestation bundles were made for materials_for_mc-0.1.9-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.9-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a8713940a7c565c1491453a153abe8540f449669f3a33dd749f6e5ef43767199
MD5 edbda68c52e1433d1878df2fb6be5a6d
BLAKE2b-256 8f1ddcf81109cc858905d296d4fc42f95e2164c6fe44457e4022be277cd45df1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e41c546ff803975ce7398c53de8bf28ef004ca09eb2becc031e918ca42cc02e6
MD5 86681999c0a79391459221335a70433e
BLAKE2b-256 1c33503153b2022f5e59a0813e98a59b3068130c90b8f85332cf86c244c39070

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for materials_for_mc-0.1.9-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d183c7e1ec67c72c77fd0d16a3f69e723b3239106ba83c88180e40cb1577d35e
MD5 0050337d8ad0a762ba0414e71a3031af
BLAKE2b-256 90ec7ff214390faef63b2f30faf6f98f7ac04a9c47532d64745475fb5a82955f

See more details on using hashes here.

Provenance

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