doped module (__init__.py)
doped is a python package for managing solid-state defect calculations,
with functionality to generate defect structures and relevant competing phases
(for chemical potentials), interface with ShakeNBreak
(https://shakenbreak.readthedocs.io) for defect structure-searching (see
https://www.nature.com/articles/s41524-023-00973-1), write VASP input files for
defect supercell calculations, and automatically parse and analyse the results.
- exception doped.ParameterOrderWarning[source]
Bases:
FutureWarningWarning about the
(bulk, defect)->(defect, bulk)parameter ordering change for some functions indopedv4.0.TODO: Remove all parameter-order warning handling in v4.1.
- doped.get_mp_context()[source]
Get a multiprocessing context that is compatible with the current OS.
- doped.get_mp_processes(processes: int | None = None)[source]
Get the number of processes to use with
Pool.
- doped.patch_vise_for_windows()[source]
Context manager to patch
vise.defaults.UserSettings._make_yaml_file_list, so that it returns an empty list.Fixes an issue where this function gives an infinite recursive search on Windows, causing hanging.
- doped.pool_manager(processes: int | None = None)[source]
Context manager for
multiprocessingPool, to throw a clearer error message whenRuntimeErrors are raisedmultiprocessingwithindopedis used in a python script.See the Errors with Python Scripts section.
- Parameters:
processes (int | None) – Number of processes to use with
Pool. IfNone, will usemp.cpu_count() - 1(i.e. one less than the number of available CPUs).- Yields:
Pool – A
Poolobject with the specified number of processes.
- doped.vise_handling(level=50)[source]
Suppress logging, patch fatal Windows issue and prevent warning suppression with
vise/pydefect, by combining thesuppress_logging(),patch_vise_for_windows()andwarnings.catch_warnings()context managers.