Source code for pymor.core.exceptions

# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2019 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)

import warnings

warn = warnings.warn


[docs]class ConstError(Exception): """I get thrown when you try to add a new member to a locked class instance""" pass
[docs]class AccuracyError(Exception): """Is raised if the result of a computation is inaccurate"""
[docs]class ExtensionError(Exception): """Is raised if a (basis) extension algorithm fails. This will mostly happen during a basis extension when the new snapshot is already in the span of the basis. """
[docs]class InversionError(Exception): """Is raised if an operator inversion algorithm fails."""
[docs]class LinAlgError(Exception): """Is raised if a linear algebra operation fails."""
[docs]class NewtonError(Exception): """Is raised if the Newton algorithm fails to converge."""
[docs]class SIDGenerationError(Exception): """Is raised when generate_sid fails."""
[docs]class GmshError(Exception): """Is raised when a Gmsh related error occurs."""
[docs]class ImageCollectionError(Exception): """Is raised when a pymor.algorithms.image.estimate_image fails for given operator.""" def __init__(self, op): super().__init__(f'Cannot estimage image for {op}') self.op = op
[docs]class QtMissing(ImportError): """Raise me where having importable Qt bindings is non-optional""" def __init__(self, msg=None): msg = msg or 'cannot visualize: import of Qt bindings failed' super().__init__(msg)
[docs]class RuleNotMatchingError(NotImplementedError): pass
[docs]class NoMatchingRuleError(NotImplementedError): def __init__(self, obj): super().__init__(f'No rule could be applied to {obj}') self.obj = obj