Skip to main content

Utilities and API for accessing MCPL (.mcpl) files

Project description

MCPL - Monte Carlo Particle Lists

MCPL files, with extensions .mcpl and .mcpl.gz is a binary format for usage in physics particle simulations. It contains lists of particle state information, and can be used to interchange or reuse particles between various Monte Carlo simulation applications. The format itself is formally described in:

T. Kittelmann, et al., Monte Carlo Particle Lists: MCPL, Computer Physics Communications 218, 17-42 (2017), https://doi.org/10.1016/j.cpc.2017.04.012

All MCPL code is provided under the highly liberal open source Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0), and further instructions and documentation can be found at https://mctools.github.io/mcpl/.

The mcpl-python package

The mcpl-python package provides a Python API for working with MCPL files. More details about the Python API and how to use it can be found at the https://mctools.github.io/mcpl/usage_python page.

Additionally, the package also provides the command-line tool pymcpltool, which has similar capabilities as the binary mcpltool from the mcpl-core package. The main difference being an ability to extract statistics and plots from MCPL files, and that the pymcpltool (unlike the mcpltool) only provides read-only capabilities.

Note that it is recommmended for most users to simply install the package named mcpl, rather than referring to the package named mcpl-python directly.

Scientific reference

Copyright 2015-2025 MCPL developers.

This software was mainly developed at the European Spallation Source ERIC (ESS) and the Technical University of Denmark (DTU). This work was supported in part by the European Union's Horizon 2020 research and innovation programme under grant agreement No 676548 (the BrightnESS project).

All MCPL files are distributed under the Apache 2.0 license, available at http://www.apache.org/licenses/LICENSE-2.0, as well as in the LICENSE file found in the source distribution.

A substantial effort went into developing MCPL. If you use it for your work, we would appreciate it if you would use the following reference in your work:

T. Kittelmann, et al., Monte Carlo Particle Lists: MCPL, Computer Physics Communications 218, 17-42 (2017), https://doi.org/10.1016/j.cpc.2017.04.012

Support for specific third party applications

Note that some users might also wish to additionally install the mcpl-extra package, which contains cmdline tools for converting between the binary data files native to some third-party Monte Carlo applications (currently PHITS and MCNP[X/5/6]). Users of Geant4 might wish to install the mcpl-geant4 package, which provides C++ classes (and CMake configuration code) for integrating MCPL I/O into Geant4 simulations. Finally, many Monte Carlo applications have directly integrated support for MCPL I/O into their codes. At the time of writing, the list of applications with known support from MCPL I/O includes:

  • McStas (built in)
  • McXtrace (built in)
  • OpenMC (built in)
  • Cinema/Prompt (built in)
  • VITESS (built in)
  • RESTRAX/SIMRES (built in)
  • McVine (built in)
  • MCNPX, MCNP5, MCNP6 (based on ssw2mcpl/mcpl2ssw from the mcpl-extra package)
  • PHITS (based on phits2mcpl/mcpl2phits from the mcpl-extra package)
  • Geant4 (based on C++/CMake code from the mcpl-geant4 package)

Note that instructions for installation and setup of third-party products like those listed above are beyond the scope of the MCPL project. Please refer to the products own instructions for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpl_python-2.0.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpl_python-2.0.0-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file mcpl_python-2.0.0.tar.gz.

File metadata

  • Download URL: mcpl_python-2.0.0.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcpl_python-2.0.0.tar.gz
Algorithm Hash digest
SHA256 0d6f4cca4bb46bb2b15d88cca1eb18825d9fcb54e195a3ea92109be4803579e7
MD5 7b700ce49b779de7444da0bf87d8e4ec
BLAKE2b-256 50b0f3da2187a398e8ce322fad17a37d137f6b1451f633f99cfcc8ff0a669ea5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpl_python-2.0.0.tar.gz:

Publisher: pypi.yml on mctools/mcpl

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

File details

Details for the file mcpl_python-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: mcpl_python-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcpl_python-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb56dba5c03cc68c0f64b4a203e9aafb69f53873439b0c22d0a5f838e683d48
MD5 8bbdc87c34742a13f268180bf88e9d03
BLAKE2b-256 976a5e0e1e96d0e863bf21b1ab42583b00c0720e65d087143f795c9fedd1141b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpl_python-2.0.0-py3-none-any.whl:

Publisher: pypi.yml on mctools/mcpl

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