Skip to main content

Primary irradiation-damage simulation, MD debris generation, and analysis tools.

Project description

irradiapy

irradiapy is a Python toolkit for constructing and analysing primary irradiation damage data. It connects recoil spectra from SRIM or SPECTRA-PKA with curated molecular dynamics (MD) cascade debris, and provides SQLite-backed storage, file I/O, defect analysis, and plotting tools.

The central workflow is:

  1. Generate primary knock-on atoms (PKAs) with SRIM, or read time-dependent PKAs produced by SPECTRA-PKA.
  2. Re-run recoils through SRIM when their energies exceed the MD cascade database range.
  3. Store ions, recoils, target information, and SRIM output in SQLite databases.
  4. Match each recoil to MD cascade debris.
  5. Calculate defect, cluster, recoil, and displacements-per-atom (dpa) statistics.

irradiapy does not distribute SRIM, SPECTRA-PKA, or any MD cascade database. Those tools and data must be installed or obtained separately.

Features

Ion irradiation: SRIM

The irradiapy.srim subpackage automates SRIM graphical application and parses its output.

  • Runs quick, full, and monolayer SRIM calculations.
  • Supports Windows directly and Linux through Wine.
  • Converts SRIM text outputs into queryable SQLite tables.
  • Collects all generated ions and recoils in a central recoils.db.
  • Iteratively simulates recoils whose energies are above the configured MD debris range.

SRIM remains a GUI application: its windows are visible while a calculation runs. On Linux, automation requires Wine, xdotool, and an X11-compatible display (including XWayland where available). See Installing SRIM on Linux for the tested setup.

Neutron irradiation: SPECTRA-PKA and SRIM

The irradiapy.spectrapka subpackage reads SPECTRA-PKA material and config_events.pka output, converts the PKA events to irradiapy's database format, and delegates high-energy recoils to the SRIM workflow.

SPECTRA-PKA itself is not launched by irradiapy. Run it separately on Linux and provide its input and event files to irradiapy.spectrapka.Spectra2SRIM. For Windows users, Windows Subsystem for Linux 2 (WSL2) is recommended.

MD cascade debris

DebrisDataset reads cascade metadata and energy-indexed LAMMPS dump files from one dataset. DebrisDatabase filters and combines compatible datasets by target composition, lattice type, electronic-interaction model, interatomic potential, DOI, and contributors.

irradiapy.analysis.debris.generate_debris then matches stored recoils to those cascades, rotates and places the selected debris, applies boundary conditions, and represents unmatched low-energy recoils with Frenkel pairs.

Compatible curated datasets are available from CascadesDefectsDB.

LAMMPS

The irradiapy.lammps subpackage acts as a wrapper around the official lammps Python package to use commands as instances of classes. This is useful for custom workflows and reuse of commands.

Analysis

The irradiapy.analysis subpackage provides:

  • defect identification similar to U. Bhardwaj, et al. (2020);
  • vacancy and self-interstitial cluster identification;
  • recoil-energy, recoil-position, and injected-ion distributions;
  • NRT, arc, and fer-arc dpa calculations;
  • SQLite-backed analysis results and plotting helpers.

I/O

The irradiapy.io subpackage contains:

  • serial and MPI readers and writers for LAMMPS custom dump files;
  • serial and MPI readers and writers for bzip2-compressed LAMMPS dumps;
  • a LAMMPS log reader;
  • basic XYZ readers and writers.

The parallel compressed reader uses indexed-bzip2 for indexed, multi-threaded decompression. Compression and conversion helpers are available under irradiapy.utils.io.

Materials and plotting

irradiapy.materials defines reusable Element and Component data classes, several built-in elements, and reference components for bcc Fe and W (you can request new components). Component implements recoil-to-damage-energy conversion and NRT, arc, and fer-arc dpa models.

irradiapy.config.use_style() enables the package's colourblind-friendly Matplotlib style. Pass latex=True to use LaTeX text rendering when a LaTeX installation is available.

Installation

irradiapy 2.0.0 requires Python 3.14 or newer.

python -m pip install irradiapy

MPI I/O support is optional:

python -m pip install "irradiapy[mpi]"

To work from a source checkout:

git clone https://github.com/acgc99/irradiapy.git
cd irradiapy
python -m pip install -e .

An MPI implementation is required when installing the mpi extra. For example, Debian and Ubuntu users can install Open MPI with:

sudo apt install libopenmpi-dev openmpi-bin

Additional external requirements depend on the workflow:

  • SRIM on Windows: install SRIM; Windows automation dependencies are installed with irradiapy.
  • SRIM on Linux: install wine, xdotool and SRIM.
  • SPECTRA-PKA: build and run SPECTRA-PKA separately on Linux or WSL2.
  • LAMMPS cascade simulations: build LAMMPS with Python support and install its Python module from the LAMMPS source tree. Do not use the unofficial lammps package from PyPI.
  • MD debris generation: obtain a compatible cascade database such as CascadesDefectsDB.

Basic configuration

SRIM and debris-database locations are configured explicitly:

from pathlib import Path

import irradiapy as irpy

irpy.config.set_srim_dir(Path("/path/to/SRIM-2013"))
irpy.config.set_debris_database(
    path=Path("/path/to/CascadesDefectsDB"),
    electronic_interactions="SRIM",
    target={"Fe": 1.0},
    lattice="bcc",
)

The complete workflows require irradiation inputs and material-specific parameters. Start from the maintained examples:

The API documentation describes the individual classes and functions.

Scientific use

This package should be cites as:

A.-C. Gutiérrez-Camacho et al., “Towards a standardised methodology of radiation damage defect distributions for microstructure evolution models”, Scientific Reports 15, 20596 (2025).

It has been used in the following works:

A.-C. Gutiérrez-Camacho et al., “Towards a standardised methodology of radiation damage defect distributions for microstructure evolution models”, Scientific Reports 15, 20596 (2025).

Contributing

Questions belong in GitHub Discussions. Report bugs and feature requests through GitHub Issues.

Building the documentation

Run the following commands from the repository root with the project virtual environment activated:

python -m pip install -e ".[mpi]" -r docs/requirements.txt
python -m sphinx.ext.apidoc --force --remove-old --separate -o docs/source/api irradiapy
python -m sphinx -W --keep-going -b html docs/source docs/build/html

The generated documentation is written to docs/build/html/index.html.

Building the package

Run the following commands from the repository root with the project virtual environment activated:

python -m pip install build
python -m build

The wheel and source distributions are written to dist.

License

irradiapy is distributed under the MIT License.

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

irradiapy-2.0.0.tar.gz (104.7 kB view details)

Uploaded Source

Built Distribution

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

irradiapy-2.0.0-py3-none-any.whl (153.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: irradiapy-2.0.0.tar.gz
  • Upload date:
  • Size: 104.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for irradiapy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 bdb77fa9b90b95721172507de8a0be157fe8ab095940fac1411564c41d1ad61c
MD5 7c64b260a76398d5c5811bb859225325
BLAKE2b-256 4a217c1314022b94da01dfbab9bf8ee1478ee5d47db383a659a3d0e814ff52b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: irradiapy-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 153.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for irradiapy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4aa52de899c49c1b59fac8b1c03d1b6a5ea69a99b377f58fbdfd00b374926544
MD5 0157221938155fa716193d0fa82a423a
BLAKE2b-256 a7b9666108ad9d125c8e00df605171095aad40fb7cec88de1debae6533b38a28

See more details on using hashes here.

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