Source code for calphy.errors

"""
calphy: a Python library and command line interface for automated free
energy calculations.

Copyright 2021-2026 (c) Sarath Menon, Yury Lysogorskiy, Ralf Drautz
Interdisciplinary Centre for Advanced Materials Simulation (ICAMS),
Ruhr University Bochum, 44801 Bochum, Germany

calphy is published and distributed under the Academic Software Licence v1.0 (ASL).
calphy is distributed in the hope that it will be useful for non-commercial academic
research, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for details.

The ASL permits academic non-commercial use only. Contact
sarath.menon@ruhr-uni-bochum.de to enquire about commercial use rights.

More information about the program can be found in:
Menon, Sarath, Yury Lysogorskiy, Jutta Rogal, and Ralf Drautz.
"Automated Free Energy Calculation from Atomistic Simulations." Physical Review Materials 5(10), 2021
DOI: 10.1103/PhysRevMaterials.5.103801

For more information contact:
sarath.menon@ruhr-uni-bochum.de
"""

[docs]class CustomError(Exception): """ Base class for raising calphy specific exceptions """ pass
[docs]class MeltedError(CustomError): pass
[docs]class SolidifiedError(CustomError): pass
[docs]class PhaseTransitionError(CustomError): """Raised when the pre-flight temperature-range scan flags a phase transition.""" pass
[docs]class LammpsExecutionError(RuntimeError): """LAMMPS binary exited abnormally. Carries the segment script path, the segment log path, and a short excerpt of the log (or stderr) so the failure can be diagnosed without re-running. """ pass
[docs]class RunnerStateError(RuntimeError): """Invalid command sequence for segmented execution. Raised for an unknown command, a dump left live across a segment boundary, an immediate-evaluation variable crossing a boundary, or a ``fix print`` being replayed -- anything the ExecutableRunner cannot faithfully reproduce. """ pass