PerturboPy

raw JSON →
0.7.2 verified Fri May 01 auth: no python

Suite of Python scripts for Perturbo (first-principles electron-phonon coupling) testing and postprocessing. Version 0.7.2, requires Python >=3.7.12. Development appears slow/infrequent.

pip install perturbopy
error ImportError: cannot import name 'PerturboCalc' from 'perturbopy'
cause Incorrect import path: PerturboCalc is in the calculator submodule.
fix
Use: from perturbopy.calculator import PerturboCalc
error ModuleNotFoundError: No module named 'pytables'
cause Missing optional dependency pytables needed for reading HDF5 with pandas.
fix
pip install tables or conda install pytables
error RuntimeError: Perturbo executable not found. Please make sure it is installed and in your PATH.
cause perturbopy is a wrapper; the actual Perturbo binary must be installed separately.
fix
Follow instructions at https://perturbo.epfl.ch to install Perturbo.
error ValueError: Invalid YAML input file. Keys missing: ...
cause YAML input file for PerturboCal must follow a specific schema (e.g., has 'qpoints', 'bands', etc.).
fix
Refer to the PerturboPy documentation for a valid YAML template or use the example files.
gotcha Top-level imports of classes/functions may fail. Always import from specific submodules (e.g., perturbopy.calculator, perturbopy.io_utils).
fix Use correct submodule paths: from perturbopy.calculator import PerturboCalc
deprecated Some plotting functions (e.g., plot_bands) are deprecated in favor of more flexible methods. Check documentation for latest API.
fix Use io_utils to load data and matplotlib directly for plotting.
gotcha The library interacts with the external 'Perturbo' binary (C++). Ensure Perturbo is installed and in PATH. perturbopy alone will not compute anything.
fix Install Perturbo from https://perturbo.epfl.ch or build from source.
conda install -c conda-forge perturbopy

Initialize a Perturbo calculation from a YAML input file, run it, and print available result keys.

from perturbopy.calculator import PerturboCalc

calc = PerturboCalc.from_yaml('perturbo_input.yaml')
calc.run()
results = calc.results
print(results.keys())