Source code for deephyper.core.exceptions

"""Deephyper exceptions

# ! Root exceptions

[docs]class DeephyperError(Exception): """Root deephyper exception."""
[docs]class DeephyperRuntimeError(RuntimeError): """Raised when an error is detected in deephyper and that doesn’t fall in any of the other categories. The associated value is a string indicating what precisely went wrong."""
[docs]class SearchTerminationError(RuntimeError): """Raised when a search is terminated."""
[docs]class MaximumJobsSpawnReached(SearchTerminationError): """Raised when the maximum number of jobs is reached."""
[docs]class RunFunctionError(RuntimeError): """Raised when error occurs in run-function""" def __init__(self, msg: str = None) -> None: self.msg = msg def __str__(self) -> str: return self.msg
[docs]class MissingRequirementError(RuntimeError): """Raised when a requirement is not installed properly."""