Skip to content

FSIBT/PyMCNP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

babbeac · Apr 24, 2025
Oct 20, 2024
Apr 24, 2025
Apr 21, 2025
Apr 24, 2025
Apr 24, 2025
Apr 24, 2025
Mar 14, 2025
Oct 23, 2024
Nov 17, 2024
Nov 15, 2024
Aug 20, 2024
Aug 20, 2024
Feb 27, 2025
Mar 15, 2025
Apr 20, 2025

Repository files navigation

Documentation Status PyPI version pre-commit

PyMCNP

PyMCNP supports running Monte Carlo N-Particle (MCNP) simulations. It parses MCNP files, enabling automation such as parameter scans, creates MCNP geometry visualization using cadquery, and can run MCNP in parallel across multiple machines (including support for clusters). 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.

Installation

PyMCNP is available on PyPI and can be pip installed.

pip install pymcnp

Contributing

PyMCNP source code is accessable for contributions, suggestions, and bug reports on GitHub. The following command downloads PyMCNP source code and installs pymcnp and its dependencies in editable mode:

git clone https://github.com/FSIBT/PyMCNP
cd PyMCNP
pip install -e .

If you plan to contribute, you should also enable pre-commit:

pip install pre-commit
# cd into repo
pre-commit install

from within the top level directory in the git repository.

Testings

To run the PyMCNP test suite, after clone the PyMCNP GitHub repository, use the following commands to install Pytest (Docs) inside the PyMCNP directory:

pip install pytest

After instaling pytest, test the pymcnp package by calling the following commands inside the PyMCNP directory:

cd PyMCNP
python -m pytest

Metaprogramming

To regenerate the autogenerated, run the following Python script:

python3 src/pymcnp/_text.py

Copyright and License

For copyright and license infromation, see the COPYRIGHT and LICENSE files in the top level directory.