PyMCNP supports running Monte Carlo N-Particle (MCNP) simulations. It parses MCNP files, enabling automation such as parameter scans, creates MCNP geometry visualization using pyvista. PyMCNP provides a Python API for MCNP input and output files and a command line interface for interacting with MCNP and MCNP files.
Find more information on ReadTheDocs.
PyMCNP is available on PyPI and can be "pip installed":
pip install pymcnp
PyMCNP source code is accessable for contributions, suggestions, and bug reports on GitHub:
# Installing
git clone https://github.com/FSIBT/PyMCNP
cd PyMCNP
pip install -e .
# Running
pymcnp
To contribute, use pre-commit and ruff:
# Installing
pip install pre-commit ruff
cd PyMCNP
pre-commit install
# Running
pre-commit
To run the PyMCNP test suite, after cloning the PyMCNP GitHub repository, use the following commands to install pytest with pytest-cov inside the PyMCNP directory:
# Installing
pip install pytest-cov
cd PyMCNP
python -m pytest
# Running
pytest --cov --cov-report term-missing:skip-covered
To rebuild the documentation using Sphinx and Napolean:
# Installing
pip install sphinx
# Running
cd docs
make html
For copyright and license information, see the COPYRIGHT
and LICENSE
files in the top level directory.