Skip to main content

Anaconda-Server Badge Anaconda-Server Badge Binder License: GPL v3 License: CC BY-NC-SA 4.0 Anaconda-Server Badge

pyLabDD

Python Laboratory for Dislocation Dynamics

Dislocation Dynamics (DD) is a numerical method for studying the evolution of a population of discrete dislocations in an elastic medium under mechanical loads. The pyLabDD package introduces a simple version of Dislocation Dynamics in 2-dimensional space to study fundamental aspects of plastic deformation associated with the motion and mutual interaction of dislocations. Dislocations are considered as pure edge dislocations where the line direction is normal to the considered plane.

Installation

The preferred method to use pyLabDD is within Anaconda or Miniconda, into which it can be easily installed from conda-forge by

$ conda install conda-forge::pylabdd

or

$ conda install pylabdd -c conda-forge

Generally, it can be installed within any Python environment supporting the package installer for python pip from its latest PyPi image via pip

$ pip install pylabdd

Alternatively, the complete repository can be cloned and installed locally. It is recommended to create a conda environment before installation. This can be done by the following the command line instructions

$ git clone https://github.com/AHartmaier/pyLabDD.git ./pyLabDD
$ cd pyLabDD
$ conda env create -f environment.yml  
$ conda activate pylabdd
$ python -m pip install .

For this installation method, the correct implementation of the package can be tested with

$ pytest tests

After this, the package can be used within Python, e.g. be importing the entire package with

import pylabdd as dd

Speedup with Fortran subroutines

The subroutines to calculate the Peach-Koehler (PK) force on dislocations are rather time consuming. The Fortran implementation of these subroutines brings a considerable seepdup of the simulations compared with the pure Python version. After installation from conda-forge, these faster Fortran subroutines are automatically availble. Installations with pip or from source require a Fortran compiler, typically gfortran, within your active environment, i.e. you might need to install gfortran from conda or pip first.
The embedding of Fortran subroutines into Python is accomplished with the leightweight Fortran wrapper fmodpy. If the compliation of the Fortran subroutines should fail, you will receive a warning and the slower Python subroutines will be used as fallback option. In that case, please check if the gfortran compiler is available in your active environment. If problems still persist, please report them directly to the author of this packges or create an issue in the GitHub repo.

Jupyter notebooks

pyLabDD is conveniently used with Jupyter notebooks. Available notebooks with tutorials on the dislocation dynamics method and the Taylor hardening model are contained in the subfolder notebooks.

The Jupyter notebooks of the pyLabDD tutorials are also available on Binder Binder

HDF5 result catalog

HDF5Catalog extracts attributes and dataset structure without loading the large numerical arrays. It can return a Python dictionary, maintain a searchable SQLite database, and plot direct datasets or packed named fields.

from pylabdd.hdf5_catalog import HDF5Catalog

with HDF5Catalog("data/catalog.sqlite") as catalog:
    metadata = catalog.scan("data")
    runs = catalog.query({"temperature": 900, "tau0": 150}, dataset="global/psr_av")
    catalog.plot_group("global/psr_av", {"temperature": 900, "tau0": 150})

The same operations are available from the command line:

python -m pylabdd.hdf5_catalog --database data/catalog.sqlite index data
python -m pylabdd.hdf5_catalog --database data/catalog.sqlite query temperature=900 tau0=150
python -m pylabdd.hdf5_catalog --database data/catalog.sqlite plot global/psr_av temperature=900 --output psr.png

Contributions

Contributions to the pyLabDD package are highly welcome, either in form of new notebooks with application examples or tutorials, or in form of new functionalities to the Python code. Furthermore, bug reports or any comments on possible improvements of the code or its documentation are greatly appreciated.

Dependencies

pyLabDD requires the following packages as imports:

  • NumPy for array handling
  • MatPlotLib for graphical output
  • fmodpy for embedding of faster Fortran subroutines for PK force calculation (optional)

Version history

  • v 1.0: Initial version (with F90 subroutine)
  • v 1.1: Pure Python version (with optional F90 subroutines)
  • v 1.2: Automatic compilation of F90 subroutines with fallback to Python version
  • v 1.3: Implementation of module for grain boundary absorption and diffusion

License

The pyLabDD package comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GNU General Public License (GPLv3)

The contents of examples, notebooks and documentation are published under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0)

© 2025, 2026 Alexander Hartmaier, ICAMS/Ruhr University Bochum, Germany

Metadata

Release files for pylabdd 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylabdd 1.3.3
File Size Uploaded Provenance Actions
pylabdd-1.3.3.tar.gz 58.2 kB Without provenance Details for pylabdd-1.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylabdd 1.3.3
File Interpreter ABI Platform Actions
pylabdd-1.3.3-py3-none-any.whl Python 3 none any Details for pylabdd-1.3.3-py3-none-any.whl

Total release size: 156.2 kB

Release files / pylabdd-1.3.3.tar.gz

Download URL pylabdd-1.3.3.tar.gz
Size 58.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f6ea9e6d3b6a9e22783688014b5bccee2830fa1cb34df90eacc0519a76ac5275
BLAKE2b-256 checksum
How to use checksums
5ec4263939b2d4bb39c411d86636ae66651456fe416ee8a50126d8f98cc03d3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / pylabdd-1.3.3-py3-none-any.whl

Download URL pylabdd-1.3.3-py3-none-any.whl
Size 98.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dae0b82952e91113fd69435961a0c89e31824573c2f1337834d5061c9abd4fd1
BLAKE2b-256 checksum
How to use checksums
b8079440efe07401c14830ace13ff64ca117bff1cbf81ec26ce22e4e929781d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for pylabdd 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page